All method printers are cloud connected

CURA-11377
This commit is contained in:
c.lamboo 2023-11-24 15:35:31 +01:00
parent 4f0840d7b5
commit 31976e591f

View File

@ -58,7 +58,6 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
# The minimum version of firmware that support print job actions over cloud. # The minimum version of firmware that support print job actions over cloud.
PRINT_JOB_ACTIONS_MIN_VERSION = Version("5.2.12") PRINT_JOB_ACTIONS_MIN_VERSION = Version("5.2.12")
PRINT_JOB_ACTIONS_MIN_VERSION_METHOD = Version("2.700")
# Notify can only use signals that are defined by the class that they are in, not inherited ones. # Notify can only use signals that are defined by the class that they are in, not inherited ones.
# Therefore, we create a private signal used to trigger the printersChanged signal. # Therefore, we create a private signal used to trigger the printersChanged signal.
@ -319,19 +318,29 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
PrintJobUploadErrorMessage(message).show() PrintJobUploadErrorMessage(message).show()
self.writeError.emit() self.writeError.emit()
@pyqtProperty(bool, notify=_cloudClusterPrintersChanged)
def isMethod(self) -> bool:
"""Whether the printer that this output device represents is a Method series printer."""
if not self._printers:
return False
[printer, *_] = self._printers
return printer.pinterType in ("ultimaker_methodx", "ultimaker_methodxl")
@pyqtProperty(bool, notify=_cloudClusterPrintersChanged) @pyqtProperty(bool, notify=_cloudClusterPrintersChanged)
def supportsPrintJobActions(self) -> bool: def supportsPrintJobActions(self) -> bool:
"""Whether the printer that this output device represents supports print job actions via the cloud.""" """Whether the printer that this output device represents supports print job actions via the cloud."""
if not self._printers: if not self._printers:
return False return False
if self.isMethod:
return True
version_number = self.printers[0].firmwareVersion.split(".") version_number = self.printers[0].firmwareVersion.split(".")
if len(version_number)> 2: firmware_version = Version([version_number[0], version_number[1], version_number[2]])
firmware_version = Version([version_number[0], version_number[1], version_number[2]]) return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION
return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION
else:
firmware_version = Version([version_number[0], version_number[1]])
return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION_METHOD
@pyqtProperty(bool, constant = True) @pyqtProperty(bool, constant = True)