mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-11 00:37:50 -06:00
Add enabled state to printer, so that it can be displayed.
This ensures that if a printer is set to "Not available", that the interface can correctly show it CL-896
This commit is contained in:
parent
3969463758
commit
dd778f0450
4 changed files with 25 additions and 1 deletions
|
@ -26,6 +26,7 @@ class PrinterOutputModel(QObject):
|
||||||
buildplateChanged = pyqtSignal()
|
buildplateChanged = pyqtSignal()
|
||||||
cameraChanged = pyqtSignal()
|
cameraChanged = pyqtSignal()
|
||||||
configurationChanged = pyqtSignal()
|
configurationChanged = pyqtSignal()
|
||||||
|
enabledChanged = pyqtSignal()
|
||||||
|
|
||||||
def __init__(self, output_controller: "PrinterOutputController", number_of_extruders: int = 1, parent=None, firmware_version = "") -> None:
|
def __init__(self, output_controller: "PrinterOutputController", number_of_extruders: int = 1, parent=None, firmware_version = "") -> None:
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
@ -43,12 +44,22 @@ class PrinterOutputModel(QObject):
|
||||||
self._is_preheating = False
|
self._is_preheating = False
|
||||||
self._printer_type = ""
|
self._printer_type = ""
|
||||||
self._buildplate_name = None
|
self._buildplate_name = None
|
||||||
|
self._enabled = True
|
||||||
|
|
||||||
self._printer_configuration.extruderConfigurations = [extruder.extruderConfiguration for extruder in
|
self._printer_configuration.extruderConfigurations = [extruder.extruderConfiguration for extruder in
|
||||||
self._extruders]
|
self._extruders]
|
||||||
|
|
||||||
self._camera = None
|
self._camera = None
|
||||||
|
|
||||||
|
@pyqtProperty(bool, notify=enabledChanged)
|
||||||
|
def enabled(self) -> bool:
|
||||||
|
return self._enabled
|
||||||
|
|
||||||
|
def updateEnabled(self, enabled: bool) -> None:
|
||||||
|
if self._enabled != enabled:
|
||||||
|
self._enabled = enabled
|
||||||
|
self.enabledChanged.emit()
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def firmwareVersion(self):
|
def firmwareVersion(self):
|
||||||
return self._firmware_version
|
return self._firmware_version
|
||||||
|
|
|
@ -192,7 +192,18 @@ Component
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: activeJobLabel
|
id: activeJobLabel
|
||||||
text: modelData.activePrintJob != null ? modelData.activePrintJob.name : "waiting"
|
text:
|
||||||
|
{
|
||||||
|
if(!modelData.enabled)
|
||||||
|
{
|
||||||
|
return catalog.i18nc("@label:status", "Not available")
|
||||||
|
}
|
||||||
|
if(modelData.activePrintjob != null)
|
||||||
|
{
|
||||||
|
return modelData.activePrintJob.name
|
||||||
|
}
|
||||||
|
return catalog.i18nc("@label:status", "Waiting")
|
||||||
|
}
|
||||||
anchors.top: machineNameLabel.bottom
|
anchors.top: machineNameLabel.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
|
|
|
@ -23,6 +23,7 @@ Component
|
||||||
name: "cura"
|
name: "cura"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: manageQueueLabel
|
id: manageQueueLabel
|
||||||
|
|
|
@ -595,6 +595,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
|
||||||
printer.updateName(data["friendly_name"])
|
printer.updateName(data["friendly_name"])
|
||||||
printer.updateKey(data["uuid"])
|
printer.updateKey(data["uuid"])
|
||||||
printer.updateType(data["machine_variant"])
|
printer.updateType(data["machine_variant"])
|
||||||
|
printer.updateEnabled(data["enabled"])
|
||||||
|
|
||||||
# Do not store the build plate information that comes from connect if the current printer has not build plate information
|
# Do not store the build plate information that comes from connect if the current printer has not build plate information
|
||||||
if "build_plate" in data and machine_definition.getMetaDataEntry("has_variant_buildplates", False):
|
if "build_plate" in data and machine_definition.getMetaDataEntry("has_variant_buildplates", False):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue