From 8ffbe0d4dfbe74c0a060f34ab84eb371b2b7ba3b Mon Sep 17 00:00:00 2001 From: Jamshed Javed Date: Tue, 27 Dec 2022 16:50:19 +0000 Subject: [PATCH] Fix: Corrected variable declarations in CANCEL_PRINT --- mainsail.cfg | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mainsail.cfg b/mainsail.cfg index 7fca595..5e92861 100644 --- a/mainsail.cfg +++ b/mainsail.cfg @@ -52,9 +52,11 @@ description: Cancel the actual running print rename_existing: CANCEL_PRINT_BASE gcode: ##### get user parameters or use default ##### - {% set allow_park = False if printer['gcode_macro _CLIENT_VARIABLE'] is not defined - else False if printer['gcode_macro _CLIENT_VARIABLE'].park_at_cancel is not defined - else True if printer['gcode_macro _CLIENT_VARIABLE'].park_at_cancel|lower == 'true' + {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} + {% set allow_park = False if not macro_found + else False if client.park_at_cancel is not defined + else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set sp_retract = 2100 if not macro_found else client.speed_retract|default(35) * 60 %}