Allow gcode commands with preheat options (#274)

* Allow gcode commands with preheat options

I use this to run a heatsoak macro during preheat.
  It moves to bed center, maxes the part cooling fan,
  and starts my nevermore chamber filter to circulate
  more air.

* Add documentation for preheat gcode
This commit is contained in:
Frank Tackitt 2021-09-18 07:32:13 -07:00 committed by GitHub
parent 414ac3f211
commit e1c478be83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -86,6 +86,8 @@ z_babystep_values: 0.01, 0.05
bed: 40 bed: 40
# Temperature for the tools # Temperature for the tools
extruder: 195 extruder: 195
# optional GCode to run when the option is selected
gcode: MY_HEATSOAK_MACRO
``` ```
## Menu ## Menu

View File

@ -406,6 +406,7 @@ class KlipperScreenConfig:
item = { item = {
"extruder": cfg.getint("extruder", 0), "extruder": cfg.getint("extruder", 0),
"bed": cfg.getint("bed", 0), "bed": cfg.getint("bed", 0),
"heater_generic": cfg.getint("heater_generic", 0) "heater_generic": cfg.getint("heater_generic", 0),
"gcode": cfg.get("gcode", None)
} }
return item return item

View File

@ -131,6 +131,9 @@ class PreheatPanel(ScreenPanel):
self.preheat_options[setting]["extruder"]) self.preheat_options[setting]["extruder"])
self._printer.set_dev_stat(heater, "target", int(self.preheat_options[setting]["extruder"])) self._printer.set_dev_stat(heater, "target", int(self.preheat_options[setting]["extruder"]))
if self.preheat_options[setting]['gcode']:
self._screen._ws.klippy.gcode_script(self.preheat_options[setting]['gcode'])
def process_update(self, action, data): def process_update(self, action, data):
if action != "notify_status_update": if action != "notify_status_update":
return return