diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-02-25 21:26:27 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-02-25 21:26:27 -0500 |
commit | adf6040e9eeb09299379ad980f8382538c163750 (patch) | |
tree | 349aa2a0d5fd4ac6948f580acd6b1b62607552f5 /klippy/gcode.py | |
parent | ff9605c082b79f4054d57ee660f909b5b2a90010 (diff) | |
download | kutter-adf6040e9eeb09299379ad980f8382538c163750.tar.gz kutter-adf6040e9eeb09299379ad980f8382538c163750.tar.xz kutter-adf6040e9eeb09299379ad980f8382538c163750.zip |
gcode: Use an event to handle restart request actions
Instead of directly turning off motors, heaters, and fans from
gcode.py, raise a new event and allow the heater, fan, and toolhead to
handle the event as needed.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/gcode.py')
-rw-r--r-- | klippy/gcode.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/klippy/gcode.py b/klippy/gcode.py index b7d737c6..519d8e0a 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -673,13 +673,8 @@ class GCodeParser: gcode_pos, base_pos, homing_pos)) def request_restart(self, result): if self.is_printer_ready: - self.toolhead.motor_off() print_time = self.toolhead.get_last_move_time() - if self.heaters is not None: - for heater in self.heaters.get_all_heaters(): - heater.set_temp(print_time, 0.) - if self.fan is not None: - self.fan.set_speed(print_time, 0.) + self.printer.send_event("gcode:request_restart", print_time) self.toolhead.dwell(0.500) self.toolhead.wait_moves() self.printer.request_exit(result) |