diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index 0fc387a53f7..0d72f8e9e2b 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -415,7 +415,17 @@ def firmwareVersion(self) -> str: @pyqtProperty(str, constant = True) def printerType(self) -> str: - return self._properties.get(b"printer_type", b"Unknown").decode("utf-8") + return self.getPrinterType(self._properties.get(b"printer_type", b"Unknown").decode("utf-8")) + + def getPrinterTypeIfMakerBot(printer_type): + method_printer_type = { + "fire_e": "ultimaker_method", + "lava_f": "ultimaker_methodx", + "magma_10": "ultimaker_methodxl" + } + if printer_type in method_printer_type: + return method_printer_type[printer_type] + return printer_type @pyqtProperty(str, constant = True) def ipAddress(self) -> str: diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 5baae741acd..345bab0ba4c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -115,7 +115,7 @@ UM.Dialog // Utils function formatPrintJobName(name) { - var extensions = [ ".gcode.gz", ".gz", ".gcode", ".ufp" ] + var extensions = [ ".gcode.gz", ".gz", ".gcode", ".ufp", ".makerbot" ] for (var i = 0; i < extensions.length; i++) { var extension = extensions[i] diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py index 318fceeb408..e5524a2e45f 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py @@ -82,13 +82,22 @@ def getClustersByMachineType(self, machine_type, on_finished: Callable[[List[Clo # HACK: There is something weird going on with the API, as it reports printer types in formats like # "ultimaker_s3", but wants "Ultimaker S3" when using the machine_variant filter query. So we need to do some # conversion! - - machine_type = machine_type.replace("_plus", "+") - machine_type = machine_type.replace("_", " ") - machine_type = machine_type.replace("ultimaker", "ultimaker ") - machine_type = machine_type.replace(" ", " ") - machine_type = machine_type.title() - machine_type = urllib.parse.quote_plus(machine_type) + # API points to "MakerBot Method" for a makerbot printertypes which we already changed to allign with other printer_type + + method_x = { + "ultimaker_method":"MakerBot Method", + "ultimaker_methodx":"MakerBot Method X", + "ultimaker_methodxl":"MakerBot Method XL" + } + if machine_type in method_x: + machine_type = method_x[machine_type] + else: + machine_type = machine_type.replace("_plus", "+") + machine_type = machine_type.replace("_", " ") + machine_type = machine_type.replace("ultimaker", "ultimaker ") + machine_type = machine_type.replace(" ", " ") + machine_type = machine_type.title() + machine_type = urllib.parse.quote_plus(machine_type) url = f"{self.CLUSTER_API_ROOT}/clusters?machine_variant={machine_type}" self._http.get(url, scope=self._scope, diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py index c8f3be282e7..8a5998b9990 100644 --- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py @@ -34,7 +34,7 @@ def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: b self.host_version = host_version self.host_internal_ip = host_internal_ip self.friendly_name = friendly_name - self.printer_type = printer_type + self.printer_type = self.getPrinterTypeIfMakerBot(printer_type) self.printer_count = printer_count self.capabilities = capabilities if capabilities is not None else [] super().__init__(**kwargs) @@ -51,3 +51,13 @@ def __repr__(self) -> str: :return: A human-readable representation of the data in this object. """ return str({k: v for k, v in self.__dict__.items() if k in {"cluster_id", "host_guid", "host_name", "status", "is_online", "host_version", "host_internal_ip", "friendly_name", "printer_type", "printer_count", "capabilities"}}) + + def getPrinterTypeIfMakerBot(printer_type): + method_printer_type = { + "fire_e": "ultimaker_method", + "lava_f": "ultimaker_methodx", + "magma_10": "ultimaker_methodxl" + } + if printer_type in method_printer_type: + return method_printer_type[printer_type] + return printer_type