-
Notifications
You must be signed in to change notification settings - Fork 102
/
webclient.cfg
109 lines (103 loc) · 4.89 KB
/
webclient.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
[pause_resume]
[display_status]
[respond]
default_type: echo
# Sets the default prefix of the "M118" and "RESPOND" output to one
# of the following:
# echo: "echo: " (This is the default)
# command: "// "
# error: "!! "
#default_prefix: echo:
# Directly sets the default prefix. If present, this value will
# override the "default_type".
#####################################################################
# Macros
#####################################################################
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_execute: False
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% set filter_off = user.peripheral.filter.run_after_print %}
{% set vent_on = user.peripheral.vent.on_val %}
{% set vent_off = user.peripheral.vent.run_after_print %}
{% set retract = user.filament.retract.end if not printer.pause_resume.is_paused
else user.filament.retract.cancel %}
SET_GCODE_VARIABLE MACRO=CANCEL_PRINT VARIABLE=execute VALUE=True
M117 Cancel
CANCEL_PRINT_BASE
{% if printer['gcode_macro PRINT_START'].state == 'Prepare' %}
{% if not printer.extruder.can_extrude %}
{action_respond_info("Extruder Temp to low heat to %3.1f°C" % printer.configfile.settings.extruder.min_extrude_temp)}
M109 S{printer.configfile.settings.extruder.min_extrude_temp}
{% endif %}
M83
G1 E-{retract} F{user.speed.retract}
{% endif %}
TURN_OFF_HEATERS
{% if params.PARK|default(0)|int == 1 or (not printer.pause_resume.is_paused and user.park.park_at_cancel) %}
_TOOLHEAD_PARK P={params.PARK|default(0)} X={user.park.pause.x} Y={user.park.pause.y}
{% endif %}
M107 ; turn off fan
{% if user.hw.chamber.fan %} M141 S{vent_on} {% endif %} ; vent chamber (setting fan to below ambient)
_ADD_PRINT_TIME
{% if params.ERROR|default(0)|int == 1 %}
{% if user.hw.display.ena %} _LCD_KNOB COLOR=RED BLINK=0.2 {% endif %}
_SD_PRINT_STATS R='abort'
{% else %}
{% if user.hw.display.ena %} _LCD_KNOB COLOR=BLUE {% endif %}
_SD_PRINT_STATS R='canceled'
{% endif %}
_SD_PRINTER_STATS
{% if user.hw.caselight.ena %} _CASELIGHT_OFF {% endif %}
{% if user.hw.chamber.fan %} UPDATE_DELAYED_GCODE ID=_DELAY_VENT_OFF DURATION={vent_off} {% endif %}
{% if user.hw.filter.ena %} UPDATE_DELAYED_GCODE ID=_DELAY_FILTER_OFF DURATION={filter_off} {% endif %}
{% if user.unload_sd %} UPDATE_DELAYED_GCODE ID=_DELAY_SDCARD_RESET_FILE DURATION=10 {% endif %}
UPDATE_DELAYED_GCODE ID=_CLEAR_DISPLAY DURATION=10
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
variable_restore: {'absolute': {'coordinates': True, 'extrude': True}, 'speed': 1500}
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
##### store coordinates to restore them at resume #####
{% set restore = {'absolute': {'coordinates': printer.gcode_move.absolute_coordinates,
'extrude' : printer.gcode_move.absolute_extrude},
'speed' : printer.gcode_move.speed} %}
SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore VALUE="{restore}"
{% if user.hw.display.ena %} _LCD_KNOB COLOR=BLUE BLINK=1 {% endif %}
{% if not printer.extruder.can_extrude %}
{action_respond_info("Extruder Temp to low heat to %3.1f°C" % printer.configfile.settings.extruder.min_extrude_temp)}
M109 S{printer.configfile.settings.extruder.min_extrude_temp}
{% endif %}
M83
G0 E-{user.filament.retract.pause} F{user.speed.retract}
PAUSE_BASE
_TOOLHEAD_PARK P=0 X={params.X|default(user.park.pause.x)} Y={params.Y|default(user.park.pause.y)}
M104 S{printer.extruder.target}
[gcode_macro _TOOLHEAD_PARK]
description: Helper: Park toolhead used in PAUSE and CANCEL_PRINT
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% set pos = {'x': user.park.bed.x if params.P|int == 1
else params.X,
'y': user.park.bed.y if params.P|int == 1
else params.Y,
'z': user.park.bed.z if params.P|int == 1
else [(printer.toolhead.position.z + user.park.pause.dz), printer.toolhead.axis_maximum.z]|min} %}
G90
G0 Z{pos.z} F{user.speed.z_hop}
G0 X{pos.x} Y{pos.y} F{user.speed.travel}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
{% set user = printer['gcode_macro _USER_VARIABLE'] %}
{% set restore = printer["gcode_macro PAUSE"].restore %}
{% if user.hw.display.ena %} _LCD_KNOB COLOR=RED {% endif %}
RESUME_BASE VELOCITY={params.VELOCITY|default(user.speed.travel/60)}
G0 E{user.filament.retract.pause} F{user.speed.retract}
G0 F{restore.speed}
{% if restore.absolute.extrude %} M82 {% endif %} ; set back to absolute
{% if not restore.absolute.coordinates %} G91 {% endif %} ; set back to relative