Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for expressions in start/end machine/extruder code extruder_nr field #18025

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

casperlamboo
Copy link
Contributor

@casperlamboo casperlamboo commented Jan 15, 2024

Description

When using templated string variables in start/end machine/extruder gcode users may enter an optional extruder nr {expr[, extruder_nr]}. When providing an extruder_nr the expression is evaluated using the extruder stack with the provided extruder_nr. However, this workflow was broken when providing a variable that would evaluate to an extruder nr. E.g. the start code M140 S{material_bed_temperature, 0} will produce the expected result but M140 S{material_bed_temperature, initial_extruder_nr} wouldn't.

This was an oversight when implementing #16962, before merging this PR we did already support this behavior.

fixes #17501
CURA-11536

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Printer definition file(s)
  • Translations

How Has This Been Tested?

YEs

Test Configuration:

  • Operating System: MacOS 13.3

Checklist:

@wawanbreton wawanbreton merged commit 7b1b542 into main Jan 16, 2024
8 checks passed
@wawanbreton wawanbreton deleted the CURA-11536 branch January 16, 2024 12:21
@bellzw
Copy link

bellzw commented Jan 17, 2024

Will this fix the problem of 5.6.0 generating code like M109 T0 S(200.0, 0)? It should be M109 T0 S200.0. Parentheses should not be present, and neither should the 2nd parameter.

@wawanbreton
Copy link
Contributor

Will this fix the problem of 5.6.0 generating code like M109 T0 S(200.0, 0)? It should be M109 T0 S200.0. Parentheses should not be present, and neither should the 2nd parameter.

Yes indeed, that's the exact purpose of this fix 😃 you can now use a variable as the extruder index.

@bellzw
Copy link

bellzw commented Jan 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad gcode produced when interpreting {code1, code2} in M140, M109, M190
3 participants