Make send to DF in monitor for abstract printer work (again-ish).

Already moslty implemented, but a new approach of the base feature (abstract cloud printers) made a more? elegant and functioning implementation possible.

(re)implements CURA-9422
This commit is contained in:
Remco Burema 2022-08-31 14:13:47 +02:00
parent 4c55befad7
commit 4ea437ba28
6 changed files with 186 additions and 60 deletions

View file

@ -1,4 +1,4 @@
# Copyright (c) 2021 Ultimaker B.V.
# Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import time
@ -531,9 +531,9 @@ class MachineManager(QObject):
def printerConnected(self) -> bool:
return bool(self._printer_output_devices)
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsAbstract(self) -> bool:
return (self.activeMachine is not None) and parseBool(self.activeMachine.getMetaDataEntry("is_abstract_machine", False))
@pyqtProperty(bool, notify = globalContainerChanged)
def activeMachineIsAbstractCloudPrinter(self) -> bool:
return len(self._printer_output_devices) == 1 and self._printer_output_devices[0].__class__.__name__ == "AbstractCloudOutputDevice"
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineIsGroup(self) -> bool:
@ -559,8 +559,6 @@ class MachineManager(QObject):
@pyqtProperty(bool, notify = printerConnectedStatusChanged)
def activeMachineHasCloudRegistration(self) -> bool:
if self.activeMachineIsAbstract:
return any(m.getMetaDataEntry("is_online", False) for m in self.getMachinesWithDefinition(self.activeMachine.definition.getId(), True))
return self.activeMachine is not None and ConnectionType.CloudConnection in self.activeMachine.configuredConnectionTypes
@pyqtProperty(bool, notify = printerConnectedStatusChanged)