Skip to content

Commit

Permalink
Update mainsail.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
systemerror-codenotfound authored Mar 13, 2024
1 parent 98c3c6f commit b400e61
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions mainsail.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,19 @@
## !!! 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]
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]

Expand Down Expand Up @@ -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 %}
Expand All @@ -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 %}
Expand All @@ -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=<name>]
Expand Down Expand Up @@ -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}


0 comments on commit b400e61

Please sign in to comment.