From a76f6375c74ea69b514a26a220c22de6679976fa Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 7 Jul 2016 15:56:14 +0200 Subject: [PATCH] Added way to stop the heating of bed / hotend in checkup CURA-1385 --- .../UMOCheckupMachineAction.py | 10 +++++++ .../UMOCheckupMachineAction.qml | 29 ++++++++++++++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py index 201e415e15..ac4dd99bad 100644 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py +++ b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py @@ -160,6 +160,16 @@ class UMOCheckupMachineAction(MachineAction): except AttributeError as e: # Connection is probably not a USB connection. Something went pretty wrong if this happens. pass + @pyqtSlot() + def cooldownHotend(self): + if self._output_device is not None: + self._output_device.setTargetHotendTemperature(0, 0) + + @pyqtSlot() + def cooldownBed(self): + if self._output_device is not None: + self._output_device.setTargetBedTemperature(0) + @pyqtSlot() def heatupHotend(self): if self._output_device is not None: diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml index 5d5a102e7d..43e1fa8f69 100644 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml @@ -15,6 +15,8 @@ Cura.MachineAction anchors.fill: parent; property int leftRow: checkupMachineAction.width * 0.40 property int rightRow: checkupMachineAction.width * 0.60 + property bool heatupHotendStarted: false + property bool heatupBedStarted: false UM.I18nCatalog { id: catalog; name:"cura"} Label { @@ -51,6 +53,8 @@ Cura.MachineAction text: catalog.i18nc("@action:button","Start Printer Check"); onClicked: { + checkupMachineAction.heatupHotendStarted = false + checkupMachineAction.heatupBedStarted = false manager.startCheck() } } @@ -181,10 +185,19 @@ Cura.MachineAction anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 Button { - text: catalog.i18nc("@action:button","Start Heating") + text: checkupMachineAction.heatupHotendStarted ? catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") + // onClicked: { - manager.heatupHotend() + if (checkupMachineAction.heatupHotendStarted) + { + manager.cooldownHotend() + checkupMachineAction.heatupHotendStarted = false + } else + { + manager.heatupHotend() + checkupMachineAction.heatupHotendStarted = true + } } } } @@ -230,10 +243,18 @@ Cura.MachineAction anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 Button { - text: catalog.i18nc("@action:button","Start Heating") + text: checkupMachineAction.heatupBedStarted ?catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") onClicked: { - manager.heatupBed() + if (checkupMachineAction.heatupBedStarted) + { + manager.cooldownBed() + checkupMachineAction.heatupBedStarted = false + } else + { + manager.heatupBed() + checkupMachineAction.heatupBedStarted = true + } } } }