printer firmware version is major and minor in case of makerbot

CURA-11138
This commit is contained in:
saumya.jain 2023-10-27 11:41:06 +02:00
parent 37e236405a
commit 3dd4ef7dda
2 changed files with 12 additions and 2 deletions

View File

@ -58,6 +58,7 @@ 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.500")
# 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.
@ -325,8 +326,13 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
if not self._printers: if not self._printers:
return False return False
version_number = self.printers[0].firmwareVersion.split(".") version_number = self.printers[0].firmwareVersion.split(".")
firmware_version = Version([version_number[0], version_number[1], version_number[2]]) if len(version_number)> 2:
return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION 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) @pyqtProperty(bool, constant = True)
def supportsPrintJobQueue(self) -> bool: def supportsPrintJobQueue(self) -> bool:

View File

@ -106,6 +106,10 @@ class MeshFormatHandler:
if "application/x-ufp" not in machine_file_formats and Version(firmware_version) >= Version("4.4"): 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 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. # Take the intersection between file_formats and machine_file_formats.
format_by_mimetype = {f["mime_type"]: f for f in file_formats} format_by_mimetype = {f["mime_type"]: f for f in file_formats}