Hide checks if the printer is not connected, hide bed temperature if no bed is installed

CURA-1385
This commit is contained in:
fieldOfView 2016-07-07 17:54:43 +02:00
parent 66dd4a7a50
commit a774f06237
2 changed files with 27 additions and 2 deletions

View file

@ -79,6 +79,8 @@ class UMOCheckupMachineAction(MachineAction):
self._z_min_endstop_test_completed = False self._z_min_endstop_test_completed = False
self.onZMinEndstopTestCompleted.emit() self.onZMinEndstopTestCompleted.emit()
self.heatedBedChanged.emit()
@pyqtProperty(bool, notify = onBedTestCompleted) @pyqtProperty(bool, notify = onBedTestCompleted)
def bedTestCompleted(self): def bedTestCompleted(self):
return self._bed_test_completed return self._bed_test_completed
@ -181,3 +183,10 @@ class UMOCheckupMachineAction(MachineAction):
def heatupBed(self): def heatupBed(self):
if self._output_device is not None: if self._output_device is not None:
self._output_device.setTargetBedTemperature(self._bed_target_temp) 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")

View file

@ -17,6 +17,8 @@ Cura.MachineAction
property int rightRow: checkupMachineAction.width * 0.60 property int rightRow: checkupMachineAction.width * 0.60
property bool heatupHotendStarted: false property bool heatupHotendStarted: false
property bool heatupBedStarted: false property bool heatupBedStarted: false
property bool usbConnected: Cura.USBPrinterManager.connectedPrinterList.rowCount() > 0
UM.I18nCatalog { id: catalog; name:"cura"} UM.I18nCatalog { id: catalog; name:"cura"}
Label Label
{ {
@ -96,7 +98,7 @@ Cura.MachineAction
anchors.left: connectionLabel.right anchors.left: connectionLabel.right
anchors.top: parent.top anchors.top: parent.top
wrapMode: Text.WordWrap 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 Label
@ -107,6 +109,7 @@ Cura.MachineAction
anchors.top: connectionLabel.bottom anchors.top: connectionLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Min endstop X: ") text: catalog.i18nc("@label","Min endstop X: ")
visible: checkupMachineAction.usbConnected
} }
Label Label
{ {
@ -116,6 +119,7 @@ Cura.MachineAction
anchors.top: connectionLabel.bottom anchors.top: connectionLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.xMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") text: manager.xMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
visible: checkupMachineAction.usbConnected
} }
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
Label Label
@ -126,6 +130,7 @@ Cura.MachineAction
anchors.top: endstopXLabel.bottom anchors.top: endstopXLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Min endstop Y: ") text: catalog.i18nc("@label","Min endstop Y: ")
visible: checkupMachineAction.usbConnected
} }
Label Label
{ {
@ -135,6 +140,7 @@ Cura.MachineAction
anchors.top: endstopXLabel.bottom anchors.top: endstopXLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.yMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") text: manager.yMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
visible: checkupMachineAction.usbConnected
} }
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
Label Label
@ -145,6 +151,7 @@ Cura.MachineAction
anchors.top: endstopYLabel.bottom anchors.top: endstopYLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Min endstop Z: ") text: catalog.i18nc("@label","Min endstop Z: ")
visible: checkupMachineAction.usbConnected
} }
Label Label
{ {
@ -154,6 +161,7 @@ Cura.MachineAction
anchors.top: endstopYLabel.bottom anchors.top: endstopYLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.zMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked") text: manager.zMinEndstopTestCompleted ? catalog.i18nc("@info:status","Works") : catalog.i18nc("@info:status","Not checked")
visible: checkupMachineAction.usbConnected
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Label Label
@ -165,6 +173,7 @@ Cura.MachineAction
anchors.top: endstopZLabel.bottom anchors.top: endstopZLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Nozzle temperature check: ") text: catalog.i18nc("@label","Nozzle temperature check: ")
visible: checkupMachineAction.usbConnected
} }
Label Label
{ {
@ -174,6 +183,7 @@ Cura.MachineAction
anchors.left: nozzleTempLabel.right anchors.left: nozzleTempLabel.right
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@info:status","Not checked") text: catalog.i18nc("@info:status","Not checked")
visible: checkupMachineAction.usbConnected
} }
Item Item
{ {
@ -183,6 +193,7 @@ Cura.MachineAction
anchors.top: nozzleTempLabel.top anchors.top: nozzleTempLabel.top
anchors.left: bedTempStatus.right anchors.left: bedTempStatus.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
visible: checkupMachineAction.usbConnected
Button Button
{ {
text: checkupMachineAction.heatupHotendStarted ? catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") text: checkupMachineAction.heatupHotendStarted ? catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating")
@ -211,6 +222,7 @@ Cura.MachineAction
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.hotendTemperature + "°C" text: manager.hotendTemperature + "°C"
font.bold: true font.bold: true
visible: checkupMachineAction.usbConnected
} }
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
Label Label
@ -222,6 +234,7 @@ Cura.MachineAction
anchors.top: nozzleTempLabel.bottom anchors.top: nozzleTempLabel.bottom
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: catalog.i18nc("@label","Bed temperature check:") text: catalog.i18nc("@label","Bed temperature check:")
visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
} }
Label Label
@ -232,6 +245,7 @@ Cura.MachineAction
anchors.left: bedTempLabel.right anchors.left: bedTempLabel.right
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.bedTestCompleted ? catalog.i18nc("@info:status","Not checked"): catalog.i18nc("@info:status","Checked") text: manager.bedTestCompleted ? catalog.i18nc("@info:status","Not checked"): catalog.i18nc("@info:status","Checked")
visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
} }
Item Item
{ {
@ -241,6 +255,7 @@ Cura.MachineAction
anchors.top: bedTempLabel.top anchors.top: bedTempLabel.top
anchors.left: bedTempStatus.right anchors.left: bedTempStatus.right
anchors.leftMargin: UM.Theme.getSize("default_margin").width/2 anchors.leftMargin: UM.Theme.getSize("default_margin").width/2
visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
Button Button
{ {
text: checkupMachineAction.heatupBedStarted ?catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating") text: checkupMachineAction.heatupBedStarted ?catalog.i18nc("@action:button","Stop Heating") : catalog.i18nc("@action:button","Start Heating")
@ -268,6 +283,7 @@ Cura.MachineAction
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: manager.bedTemperature + "°C" text: manager.bedTemperature + "°C"
font.bold: true font.bold: true
visible: checkupMachineAction.usbConnected && manager.hasHeatedBed
} }
Label Label
{ {