diff --git a/cura/PrinterOutputDevice.py b/cura/PrinterOutputDevice.py index ed67bbb1ca..56ae34b6f4 100644 --- a/cura/PrinterOutputDevice.py +++ b/cura/PrinterOutputDevice.py @@ -45,6 +45,7 @@ class PrinterOutputDevice(QObject, OutputDevice): self._job_name = "" self._error_text = "" self._accepts_commands = True + self._preheat_bed_timeout = 900 #Default time-out for pre-heating the bed, in seconds. self._printer_state = "" self._printer_type = "unknown" @@ -199,6 +200,11 @@ class PrinterOutputDevice(QObject, OutputDevice): self._target_bed_temperature = temperature self.targetBedTemperatureChanged.emit() + ## + @pyqtProperty(int) + def preheatBedTimeout(self): + return self._preheat_bed_timeout + ## Time the print has been printing. # Note that timeTotal - timeElapsed should give time remaining. @pyqtProperty(float, notify = timeElapsedChanged) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 3d2d4bbc07..bf708f23d7 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -248,7 +248,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # \param duration How long the bed should stay warm, in seconds. Defaults # to a quarter hour. @pyqtSlot(int, int) - def preheatBed(self, temperature, duration=900): + def preheatBed(self, temperature, duration): url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat") data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration) put_request = QNetworkRequest(url) @@ -260,7 +260,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # If the bed is not pre-heated, nothing happens. @pyqtSlot() def cancelPreheatBed(self): - self.preheatBed(temperature=0) + self.preheatBed(temperature = 0, duration = 0) ## Changes the target bed temperature and makes sure that its signal is # emitted. diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 0a34eb8f31..65a56b3441 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -404,7 +404,7 @@ Column connectedPrinter.preheatBed(preheatTemperatureInput.text, 900); var now = new Date(); var end_time = new Date(); - end_time.setTime(now.getTime() + 900 * 1000); //*1000 because time is in milliseconds here. + end_time.setTime(now.getTime() + connectedPrinter.preheatBedTimeout * 1000); //*1000 because time is in milliseconds here. preheatCountdownTimer.endTime = end_time; preheatCountdownTimer.start(); preheatCountdownTimer.update(); //Update once before the first timer is triggered.