From 559b40867ef88c37379244fed2947743058f7da2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 7 Feb 2017 13:29:57 +0100 Subject: [PATCH] Call pre-heat if pre-heat button is pressed Contributes to issue CURA-3161. --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 2 ++ resources/qml/PrintMonitor.qml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index e43e522c0c..59c04dd822 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -246,6 +246,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # Celsius. # \param duration How long the bed should stay warm, in seconds. Defaults # to a quarter hour. + @pyqtSlot(float, float) def preheatBed(self, temperature, duration=900): url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat") data = """{"temperature": "{temperature}", "timeout": "{timeout}"}""".format(temperature=str(temperature), timeout=str(duration)) @@ -256,6 +257,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): ## Cancels pre-heating the heated bed of the printer. # # If the bed is not pre-heated, nothing happens. + @pyqtSlot() def cancelPreheatBed(self): self.preheatBed(temperature=0) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index c1fbdef983..4ff6d02c54 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -362,7 +362,7 @@ Column onClicked: { - print("Click!"); + connectedPrinter.preheatBed(preheatTemperatureInput.text, 900) } } }