From a774f06237bc119fe3abcd301fcd64f3be8970b7 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 7 Jul 2016 17:54:43 +0200 Subject: [PATCH] Hide checks if the printer is not connected, hide bed temperature if no bed is installed CURA-1385 --- .../UMOCheckupMachineAction.py | 11 ++++++++++- .../UMOCheckupMachineAction.qml | 18 +++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py index b374138791..b46c92a82c 100644 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py +++ b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.py @@ -79,6 +79,8 @@ class UMOCheckupMachineAction(MachineAction): self._z_min_endstop_test_completed = False self.onZMinEndstopTestCompleted.emit() + self.heatedBedChanged.emit() + @pyqtProperty(bool, notify = onBedTestCompleted) def bedTestCompleted(self): return self._bed_test_completed @@ -180,4 +182,11 @@ class UMOCheckupMachineAction(MachineAction): @pyqtSlot() def heatupBed(self): if self._output_device is not None: - self._output_device.setTargetBedTemperature(self._bed_target_temp) \ No newline at end of file + self._output_device.setTargetBedTemperature(self._bed_target_temp) + + heatedBedChanged = pyqtSignal() + + @pyqtProperty(bool, notify = heatedBedChanged) + def hasHeatedBed(self): + global_container_stack = Application.getInstance().getGlobalContainerStack() + return global_container_stack.getProperty("machine_heated_bed", "value") \ No newline at end of file diff --git a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml index 43e1fa8f69..86429ed119 100644 --- a/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOCheckupMachineAction.qml @@ -17,6 +17,8 @@ Cura.MachineAction property int rightRow: checkupMachineAction.width * 0.60 property bool heatupHotendStarted: false property bool heatupBedStarted: false + property bool usbConnected: Cura.USBPrinterManager.connectedPrinterList.rowCount() > 0 + UM.I18nCatalog { id: catalog; name:"cura"} Label { @@ -96,7 +98,7 @@ Cura.MachineAction anchors.left: connectionLabel.right anchors.top: parent.top wrapMode: Text.WordWrap - text: Cura.USBPrinterManager.connectedPrinterList.rowCount() > 0 ? catalog.i18nc("@info:status","Connected"): catalog.i18nc("@info:status","Not connected") + text: checkupMachineAction.usbConnected ? catalog.i18nc("@info:status","Connected"): catalog.i18nc("@info:status","Not connected") } ////////////////////////////////////////////////////////// Label @@ -107,6 +109,7 @@ Cura.MachineAction anchors.top: connectionLabel.bottom wrapMode: Text.WordWrap text: catalog.i18nc("@label","Min endstop X: ") + visible: checkupMachineAction.usbConnected } Label { @@ -116,6 +119,7 @@ Cura.MachineAction anchors.top: connectionLabel.bottom wrapMode: Text.WordWrap text: manager.xMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + visible: checkupMachineAction.usbConnected } ////////////////////////////////////////////////////////////// Label @@ -126,6 +130,7 @@ Cura.MachineAction anchors.top: endstopXLabel.bottom wrapMode: Text.WordWrap text: catalog.i18nc("@label","Min endstop Y: ") + visible: checkupMachineAction.usbConnected } Label { @@ -135,6 +140,7 @@ Cura.MachineAction anchors.top: endstopXLabel.bottom wrapMode: Text.WordWrap text: manager.yMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + visible: checkupMachineAction.usbConnected } ///////////////////////////////////////////////////////////////////// Label @@ -145,6 +151,7 @@ Cura.MachineAction anchors.top: endstopYLabel.bottom wrapMode: Text.WordWrap text: catalog.i18nc("@label","Min endstop Z: ") + visible: checkupMachineAction.usbConnected } Label { @@ -154,6 +161,7 @@ Cura.MachineAction anchors.top: endstopYLabel.bottom wrapMode: Text.WordWrap text: manager.zMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") + visible: checkupMachineAction.usbConnected } //////////////////////////////////////////////////////////// Label @@ -165,6 +173,7 @@ Cura.MachineAction anchors.top: endstopZLabel.bottom wrapMode: Text.WordWrap text: catalog.i18nc("@label","Nozzle temperature check: ") + visible: checkupMachineAction.usbConnected } Label { @@ -174,6 +183,7 @@ Cura.MachineAction anchors.left: nozzleTempLabel.right wrapMode: Text.WordWrap text: catalog.i18nc("@info:status","Not checked") + visible: checkupMachineAction.usbConnected } Item { @@ -183,6 +193,7 @@ Cura.MachineAction anchors.top: nozzleTempLabel.top anchors.left: bedTempStatus.right anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 + visible: checkupMachineAction.usbConnected Button { text: checkupMachineAction.heatupHotendStarted ? catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") @@ -211,6 +222,7 @@ Cura.MachineAction wrapMode: Text.WordWrap text: manager.hotendTemperature + "°C" font.bold: true + visible: checkupMachineAction.usbConnected } ///////////////////////////////////////////////////////////////////////////// Label @@ -222,6 +234,7 @@ Cura.MachineAction anchors.top: nozzleTempLabel.bottom wrapMode: Text.WordWrap text: catalog.i18nc("@label","Bed temperature check:") + visible: checkupMachineAction.usbConnected && manager.hasHeatedBed } Label @@ -232,6 +245,7 @@ Cura.MachineAction anchors.left: bedTempLabel.right wrapMode: Text.WordWrap text: manager.bedTestCompleted ? catalog.i18nc("@info:status","Not checked"): catalog.i18nc("@info:status","Checked") + visible: checkupMachineAction.usbConnected && manager.hasHeatedBed } Item { @@ -241,6 +255,7 @@ Cura.MachineAction anchors.top: bedTempLabel.top anchors.left: bedTempStatus.right anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 + visible: checkupMachineAction.usbConnected && manager.hasHeatedBed Button { text: checkupMachineAction.heatupBedStarted ?catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") @@ -268,6 +283,7 @@ Cura.MachineAction wrapMode: Text.WordWrap text: manager.bedTemperature + "°C" font.bold: true + visible: checkupMachineAction.usbConnected && manager.hasHeatedBed } Label {