forked from zellneralex/klipper_config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webclient.cfg
188 lines (173 loc) · 7.33 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
[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_var = printer['gcode_macro _USER_VARIABLE'] %}
{% set filter_off = user_var.peripheral.filter.run_after_print %}
{% set vent_on = user_var.peripheral.vent.on_val %}
{% set vent_off = user_var.peripheral.vent.run_after_print %}
{% set retract = user_var.filament.retract.end if printer.pause_resume.is_paused|lower == 'false'
else user_var.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_var.speed.retract}
{% endif %}
TURN_OFF_HEATERS
{% if params.PARK|default(0)|int == 1 or (not printer.pause_resume.is_paused and user_var.park.park_at_cancel) %}
_TOOLHEAD_PARK P={params.PARK|default(0)} X={user_var.park.pause.x} Y={user_var.park.pause.y}
{% endif %}
M107 ; turn off fan
{% if user_var.hw_ena.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_var.hw_ena.display == 'true' %} _LCD_KNOB COLOR=RED BLINK=0.2 {% endif %}
_SD_PRINT_STATS R='abort'
{% else %}
{% if user_var.hw_ena.display == 'true' %} _LCD_KNOB COLOR=BLUE {% endif %}
_SD_PRINT_STATS R='canceled'
{% endif %}
_SD_PRINTER_STATS
{% if user_var.hw_ena.caselight == 'true' %} _CASELIGHT_OFF {% endif %}
{% if user_var.hw_ena.chamber == 'fan' %} UPDATE_DELAYED_GCODE ID=_DELAY_VENT_OFF DURATION={vent_off} {% endif %}
{% if user_var.hw_ena.filter == 'true' %} UPDATE_DELAYED_GCODE ID=_DELAY_FILTER_OFF DURATION={filter_off} {% endif %}
{% if user_var.unload_sd|lower == 'true' %} 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_var = 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_var.hw_ena.display == 'true' %} _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_var.filament.retract.pause} F{user_var.speed.retract}
PAUSE_BASE
_TOOLHEAD_PARK P=0 X={params.X|default(user_var.park.pause.x)} Y={params.Y|default(user_var.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_var = printer['gcode_macro _USER_VARIABLE'] %}
{% set pos = {'x': user_var.park.bed.x if params.P|int == 1
else params.X,
'y': user_var.park.bed.y if params.P|int == 1
else params.Y,
'z': user_var.park.bed.z if params.P|int == 1
else [(printer.toolhead.position.z + user_var.park.pause.dz), printer.toolhead.axis_maximum.z]|min} %}
G90
G0 Z{pos.z} F{user_var.speed.z_hop}
G0 X{pos.x} Y{pos.y} F{user_var.speed.travel}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
{% set user_var = printer['gcode_macro _USER_VARIABLE'] %}
{% set restore = printer["gcode_macro PAUSE"].restore %}
{% if user_var.hw_ena.display == 'true' %} _LCD_KNOB COLOR=RED {% endif %}
RESUME_BASE VELOCITY={params.VELOCITY|default(user_var.speed.travel/60)}
G0 E{user_var.filament.retract.pause} F{user_var.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
#####################################################################
# LCD menu that works with mainsail #
#####################################################################
# Main
# ...
# + SD Card
# + Show loaded file
# + Load File (only if not printing and no file loaded)
# + Unload File (only if not printing and a file is loaded)
# + Start printing (only if not printing and a file is loaded)
# + Pause printing (only while printing)
# + Resume printing (only while paused)
# + Cancel printing (only while paused)
[menu __main __sdcard]
type: list
enable: {'virtual_sdcard' in printer}
name: SD Card
[menu __main __sdcard __file]
type: command
name: File: {printer.print_stats.filename}
index: 0
[menu __main __sdcard __load]
type: vsdlist
#type: list
#event_sender: __vsdfiles
enable: {not printer.virtual_sdcard.file_path and not (printer.print_stats.state == "printing" or printer.print_stats.state == "paused")}
name: Load file
index: 1
[menu __main __sdcard __unload]
type: command
enable: {printer.virtual_sdcard.file_path and not (printer.print_stats.state == "printing" or printer.print_stats.state == "paused")}
name: Unload file
index: 2
gcode:
# back is needed to reload the modified menu structure
{menu.back()}
SDCARD_RESET_FILE
[menu __main __sdcard __start]
type: command
enable: {printer.virtual_sdcard.file_path and not (printer.print_stats.state == "printing" or printer.print_stats.state == "paused")}
name: Start print
index: 3
gcode:
{menu.exit()}
UPDATE_DELAYED_GCODE ID=_DELAY_DISPLAY_OFF DURATION=10
M24
[menu __main __sdcard __pause]
type: command
enable: {printer.print_stats.state == "printing"}
name: Pause print
gcode:
# back is needed to reload the modified menu structure
{menu.back()}
PAUSE
[menu __main __sdcard __resume]
type: command
enable: {printer.print_stats.state == "paused"}
name: Resume print
gcode:
{menu.exit()}
UPDATE_DELAYED_GCODE ID=_DELAY_DISPLAY_OFF DURATION=10
RESUME
[menu __main __sdcard __cancel]
type: command
enable: {printer.print_stats.state == "paused"}
name: Cancel print
gcode:
{menu.exit()}
UPDATE_DELAYED_GCODE ID=_DELAY_DISPLAY_OFF DURATION=10
CANCEL_PRINT