From adf6040e9eeb09299379ad980f8382538c163750 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 25 Feb 2019 21:26:27 -0500 Subject: 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 --- klippy/gcode.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'klippy/gcode.py') 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) -- cgit v1.2.3-70-g09d2