klippain icon indicating copy to clipboard operation
klippain copied to clipboard

Update start_print.cfg with FORCE_MESH

Open 0rinsb3lt opened this issue 2 years ago • 22 comments

Added FORCE_MESH as a parameter to ADAPTIVE_BED_MESH

0rinsb3lt avatar Dec 19 '23 01:12 0rinsb3lt

Can you elaborate the use case? Actually it is missing something. 1. I don't see the variable in variables.cfg. 2. is it an option for start_print as parameter within the slicer? That would be missing too

Surion79 avatar Dec 19 '23 06:12 Surion79

Can you elaborate the use case? Actually it is missing something. 1. I don't see the variable in variables.cfg. 2. is it an option for start_print as parameter within the slicer? That would be missing too

I think he must add {% set force_mesh = params.FORCE_MESH|default(False) %} in the param from the slicer?

Benoitone avatar Dec 19 '23 06:12 Benoitone

He remarks an unknown user variable. So not sure of the integration. It would mean defaulting to the variable and not to a hard coded default.

Surion79 avatar Dec 19 '23 06:12 Surion79

?

{% set force_mesh = params.FORCE_MESH|default(False) %} in the param from the slicer? Is just set to a default variable?

Benoitone avatar Dec 19 '23 07:12 Benoitone

?

{% set force_mesh = params.FORCE_MESH|default(False) %} in the param from the slicer? Is just set to a default variable?

no, that is setting to a default (hard coded) VALUE. not a default variable. Default variable is declared in his PR, but I was either blind or the variable is not available in variables.cfg

Surion79 avatar Dec 19 '23 08:12 Surion79

You are correct I didn't put it into variables.cfg. This PR is to give the user the option to force a bed mesh. Most of the code was already there it just defaulted to False and never actually read from the variables.cfg file (User variables) or gave the end user a way to enable it.

I will update with a default variables_force_mesh: False in variables.cfg

0rinsb3lt avatar Dec 19 '23 14:12 0rinsb3lt

i would also like to have it as parameter in start_print available, if we are already integrating it

Surion79 avatar Dec 19 '23 15:12 Surion79

i would also like to have it as parameter in start_print available, if we are already integrating it

So that you could enable from the slicer?

0rinsb3lt avatar Dec 19 '23 15:12 0rinsb3lt

yes. you can look the start_print macro with PARAMS. and adapt it accordingly for bed mesh. I expect some integration since the bed mesh module which is a starting module was modified.

Surion79 avatar Dec 19 '23 15:12 Surion79

I don't really see the real point of adding another user variable with all the problems that can cause (when upgrading Klippain) for a function that has limited interest. Why make a bed mesh when the printed part is very small? So in my opinion it could remain something marginal that the user would be able to pass into their slicer start g_code and which would be used here .

And in this case I don't see how replacing {% set force_mesh = printer["gcode_macro _USER_VARIABLES"].force_mesh %} by {% set force_mesh = params.FORCE_MESH|default(False) %} could cause a problem.

Finally, in the event that you absolutely want to add the new user variable entry in variables.cfg the description can easily lead to confusion: the way it is worded can make you think that there will be no bed mesh if you leave it on False...

Benoitone avatar Dec 19 '23 17:12 Benoitone

the whole thing makes no sense since the addition is in the bed_mesh_module within the start print sequence. you either need to pass it through start_print params or through variables. if neither is done, the addition is plain never in use. Please look at the change. it is NOT done in the START_PRINT macro.

Surion79 avatar Dec 19 '23 20:12 Surion79

and i agree, the var wording creates more issues than it solves

Surion79 avatar Dec 19 '23 20:12 Surion79

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

Surion79 avatar Dec 20 '23 05:12 Surion79

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

It seems perfect for me... @Surion79 @Frix-x : Just for my knowledge... is there a difference if we use False instead of 0 as the default value in this case?

Benoitone avatar Dec 20 '23 08:12 Benoitone

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

It seems perfect for me... @Surion79 @Frix-x : Just for my knowledge... is there a difference if we use False instead of 0 as the default value in this case?

i made it int, 0/1 as frix stated it in an above comment

Surion79 avatar Dec 20 '23 11:12 Surion79

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

It seems perfect for me... @Surion79 @Frix-x : Just for my knowledge... is there a difference if we use False instead of 0 as the default value in this case?

i made it int, 0/1 as frix stated it in an above comment

Because in https://github.com/Frix-x/klippain/blob/a20763997ef134cb24b401cb071eac245126f724/macros/calibration/adaptive_bed_mesh.cfg#L67 it seems to be a boolean...

Benoitone avatar Dec 20 '23 13:12 Benoitone

And maybe take the opportunity to include this function in configuration.md... https://github.com/Frix-x/klippain/blob/e1a6cba3f009e8248b473754599ea1ad2f7bf8c1/docs/configuration.md

Benoitone avatar Dec 20 '23 13:12 Benoitone

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

It seems perfect for me... @Surion79 @Frix-x : Just for my knowledge... is there a difference if we use False instead of 0 as the default value in this case?

i made it int, 0/1 as frix stated it in an above comment

Because in

https://github.com/Frix-x/klippain/blob/a20763997ef134cb24b401cb071eac245126f724/macros/calibration/adaptive_bed_mesh.cfg#L67

it seems to be a boolean...

could you please comment the line directly in the PR? I don't see it in the current version of the PR

Surion79 avatar Dec 20 '23 15:12 Surion79

i took the liberty to correct it directly. Should be fine now, since it is 100% matching Module coding

It seems perfect for me... @Surion79 @Frix-x : Just for my knowledge... is there a difference if we use False instead of 0 as the default value in this case?

i made it int, 0/1 as frix stated it in an above comment

Because in https://github.com/Frix-x/klippain/blob/a20763997ef134cb24b401cb071eac245126f724/macros/calibration/adaptive_bed_mesh.cfg#L67

it seems to be a boolean...

could you please comment the line directly in the PR? I don't see it in the current version of the PR

I don't see how to do this on mobile app... it's in macros/calibration/adaptive_bed_mesh.cfg -> Ligne67

Benoitone avatar Dec 20 '23 15:12 Benoitone

oooh, you mean outside this PR. Silly me :D

@Frix-x regarding your statement of force_mesh being 0/1 and in bed mesh it was programmed true/false. Which way to go? Stay int, go boolean or switch from int to bool?

Surion79 avatar Dec 20 '23 15:12 Surion79

understood and done. usually I don't do that :)

Surion79 avatar Dec 20 '23 16:12 Surion79

Ok, so now the PR is ready to be merged. I just want to test it thoroughly to make sure it's working before I merge it. So please give me some time to do that (currently batch printing Christmas decorations haha)

Frix-x avatar Dec 21 '23 09:12 Frix-x