From b400e61e696382551349f5d76c255f54fbe3b0da Mon Sep 17 00:00:00 2001 From: Mr H Date: Wed, 13 Mar 2024 23:57:48 +0100 Subject: [PATCH] Update mainsail.cfg --- mainsail.cfg | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/mainsail.cfg b/mainsail.cfg index 6bedd61..61e1443 100644 --- a/mainsail.cfg +++ b/mainsail.cfg @@ -42,9 +42,9 @@ ## !!! Custom macros, please use with care and review the section of the corresponding macro. ## These macros are for simple operations like setting a status LED. Please make sure your macro does not interfere with the basic macro functions. ## Only single line commands are supported, please create a macro if you need more than one command. -#variable_user_pause_macro : "" ; Everything insight the "" will be executed after the klipper base pause (PAUSE_BASE) function -#variable_user_resume_macro: "" ; Everything insight the "" will be executed before the klipper base resume (RESUME_BASE) function -#variable_user_cancel_macro: "" ; Everything insight the "" will be executed before the klipper base cancel (CANCEL_PRINT_BASE) function +#variable_user_pause_macro : "" ; Everything inside the "" will be executed after the klipper base pause (PAUSE_BASE) function +#variable_user_resume_macro: "" ; Everything inside the "" will be executed before the klipper base resume (RESUME_BASE) function +#variable_user_cancel_macro: "" ; Everything inside the "" will be executed before the klipper base cancel (CANCEL_PRINT_BASE) function #gcode: [virtual_sdcard] @@ -52,6 +52,9 @@ path: ~/printer_data/gcodes on_error_gcode: CANCEL_PRINT [pause_resume] +#recover_velocity: 50. +# When capture/restore is enabled, the speed at which to return to +# the captured position (in mm/s). Default is 50.0 mm/s. [display_status] @@ -125,6 +128,7 @@ gcode: {% set can_extrude = True if printer.toolhead.extruder == '' # no extruder defined in config else printer[printer.toolhead.extruder].can_extrude %} # status of active extruder {% set do_resume = False %} + {% set prompt_txt = [] %} ##### end of definitions ##### #### Printer comming from timeout idle state #### {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %} @@ -138,12 +142,14 @@ gcode: {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' + {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} #### Printer comming out of regular PAUSE state #### {% elif can_extrude %} {% set do_resume = True %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}' + {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %} {% endif %} {% if runout_resume %} {% if do_resume %} @@ -154,6 +160,16 @@ gcode: {% endif %} {% else %} RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}' + {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %} + {% endif %} + ##### Generate User Information box in case of abort ##### + {% if not (runout_resume and do_resume) %} + RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!" + {% for element in prompt_txt %} + RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}' + {% endfor %} + RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info" + RESPOND TYPE=command MSG="action:prompt_show" {% endif %} # Usage: SET_PAUSE_NEXT_LAYER [ENABLE=[0|1]] [MACRO=] @@ -275,4 +291,4 @@ gcode: {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} - \ No newline at end of file +