mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-07 22:14:05 -06:00
gcode_macro: Parse variable_X parameters using ast.literal_eval()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
01f3b50e73
commit
8b00580884
5 changed files with 32 additions and 14 deletions
|
@ -80,13 +80,13 @@ gcode:
|
|||
{% endif %}
|
||||
|
||||
[gcode_macro TEST_variable]
|
||||
variable_t: 12
|
||||
variable_t: 12.0
|
||||
gcode:
|
||||
{ printer.gcode.action_respond_info("TEST_variable") }
|
||||
{% if t|float - 12.0 != printer.toolhead.position.y %}
|
||||
{% if t - 12.0 != printer.toolhead.position.y %}
|
||||
M112
|
||||
{% endif %}
|
||||
{% if printer["gcode_macro TEST_variable"].t|float - 12.0 != 0.0 %}
|
||||
{% if printer["gcode_macro TEST_variable"].t - 12.0 != 0.0 %}
|
||||
M112
|
||||
{% endif %}
|
||||
SET_GCODE_VARIABLE MACRO=TEST_variable VARIABLE=t VALUE=17
|
||||
|
@ -95,7 +95,7 @@ gcode:
|
|||
[gcode_macro TEST_variable_part2]
|
||||
gcode:
|
||||
{ printer.gcode.action_respond_info("TEST_variable_part2") }
|
||||
{% if printer["gcode_macro TEST_variable"].t|float != 17.0 %}
|
||||
{% if printer["gcode_macro TEST_variable"].t != 17.0 %}
|
||||
M112
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue