From 5c7c549be98e4ef986ba4a065b637ea7e5af7e3a Mon Sep 17 00:00:00 2001 From: steeb Date: Sun, 29 Sep 2024 06:57:19 -0700 Subject: [PATCH] printer.cfg modified - 09/29/2024 - 06:57:11 AM --- printer_data/config/printer.cfg | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/printer_data/config/printer.cfg b/printer_data/config/printer.cfg index bf71762..2cf54c1 100644 --- a/printer_data/config/printer.cfg +++ b/printer_data/config/printer.cfg @@ -611,7 +611,7 @@ gcode: M104 S0 ;turn off hotend M140 S0 ;turn off heatbed M106 S0 ; shut off blower - #M84 ;motors off -- disabled so that head can still be moved after print finishes + M84 ;motors off -- disabled so that head can still be moved after print finishes # Use PRINT_END for the slicer ending script - please customise for your slicer of choice [gcode_macro PRINT_END] @@ -852,6 +852,37 @@ gcode: gcode: PROBE_CALIBRATE +[gcode_macro CANCEL_PRINT] +description: Cancel the actual running print +rename_existing: CANCEL_PRINT_BASE +gcode: + ##### get user parameters or use default ##### + {% set client = printer['gcode_macro _CLIENT_VARIABLE'] | default({}) %} + {% set allow_park = client.park_at_cancel | default(false) | lower == 'true' %} + {% set retract = client.cancel_retract | default(5.0) | abs %} + ##### define park position ##### + {% set park_x = "" if (client.park_at_cancel_x | default(none) is none) + else "X=" ~ client.park_at_cancel_x %} + {% set park_y = "" if (client.park_at_cancel_y | default(none) is none) + else "Y=" ~ client.park_at_cancel_y %} + {% set custom_park = park_x | length > 0 or park_y | length > 0 %} + ##### end of definitions ##### + # restore idle_timeout time if needed + {% if printer['gcode_macro RESUME'].restore_idle_timeout > 0 %} + SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro RESUME'].restore_idle_timeout} + {% endif %} + #{% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} + _TOOLHEAD_PARK_PAUSE_CANCEL + _CLIENT_RETRACT LENGTH={retract} + TURN_OFF_HEATERS + M106 S0 + {client.user_cancel_macro | default("")} + SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False + # clear pause_next_layer and pause_at_layer as preparation for next print + SET_PAUSE_NEXT_LAYER ENABLE=0 + SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 + CANCEL_PRINT_BASE + #*# <---------------------- SAVE_CONFIG ----------------------> #*# DO NOT EDIT THIS BLOCK OR BELOW. The contents are auto-generated. #*#