From 3dd4ef7dda12d8ca0afffd3c6300728f762769af Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Fri, 27 Oct 2023 11:41:06 +0200 Subject: [PATCH] printer firmware version is major and minor in case of makerbot CURA-11138 --- .../UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 10 ++++++++-- plugins/UM3NetworkPrinting/src/MeshFormatHandler.py | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index c5c144d273..8a99deb102 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -58,6 +58,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): # 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_METHOD = Version("2.500") # 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. @@ -325,8 +326,13 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): if not self._printers: return False version_number = self.printers[0].firmwareVersion.split(".") - firmware_version = Version([version_number[0], version_number[1], version_number[2]]) - return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION + if len(version_number)> 2: + firmware_version = Version([version_number[0], version_number[1], version_number[2]]) + 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) def supportsPrintJobQueue(self) -> bool: diff --git a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py index 7fc1b4a7d3..3549240976 100644 --- a/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py +++ b/plugins/UM3NetworkPrinting/src/MeshFormatHandler.py @@ -106,6 +106,10 @@ class MeshFormatHandler: if "application/x-ufp" not in machine_file_formats and Version(firmware_version) >= Version("4.4"): machine_file_formats = ["application/x-ufp"] + machine_file_formats + # Exception for makerbot firmware version >=2.500: makerbot is supported + elif "application/x-makerbot" not in machine_file_formats: + machine_file_formats = ["application/x-makerbot"] + machine_file_formats + # Take the intersection between file_formats and machine_file_formats. format_by_mimetype = {f["mime_type"]: f for f in file_formats}