From bc84c1f6e6b3991c7c5aeda6dc5c8bec9634db8d Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 4 Apr 2018 13:47:40 +0200 Subject: [PATCH] Prevent preheat timeout from occurring during a print --- cura/PrinterOutput/GenericOutputController.py | 14 ++++++++++++++ plugins/USBPrinting/USBPrinterOutputDevice.py | 3 +++ 2 files changed, 17 insertions(+) diff --git a/cura/PrinterOutput/GenericOutputController.py b/cura/PrinterOutput/GenericOutputController.py index 470848c208..45669ca08a 100644 --- a/cura/PrinterOutput/GenericOutputController.py +++ b/cura/PrinterOutput/GenericOutputController.py @@ -152,3 +152,17 @@ class GenericOutputController(PrinterOutputController): for extruder in self._preheat_hotends: self.setTargetHotendTemperature(extruder.getPrinter(), extruder.getPosition(), 0) self._preheat_hotends = set() + + # Cancel any ongoing preheating timers, without setting back the temperature to 0 + # This can be used eg at the start of a print + def stopPreheatTimers(self): + if self._preheat_hotends_timer.isActive(): + for extruder in self._preheat_hotends: + extruder.updateIsPreheating(False) + self._preheat_hotends = set() + + self._preheat_hotends_timer.stop() + + if self._preheat_bed_timer.isActive(): + self._active_printer.updateIsPreheating(False) + self._preheat_bed_timer.stop() diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 24feedd628..74952ece6e 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -96,6 +96,9 @@ class USBPrinterOutputDevice(PrinterOutputDevice): if self._is_printing: return # Aleady printing + # cancel any ongoing preheat timer before starting a print + self._printers[0].stopPreheatTimers() + Application.getInstance().getController().setActiveStage("MonitorStage") # find the G-code for the active build plate to print