mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
printertype Parsing function made static
CURA-11138
This commit is contained in:
parent
c2e2511fdc
commit
39ec9c9279
2 changed files with 5 additions and 12 deletions
|
@ -415,9 +415,10 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def printerType(self) -> str:
|
def printerType(self) -> str:
|
||||||
return self.getPrinterTypeIfMakerBot(self._properties.get(b"printer_type", b"Unknown").decode("utf-8"))
|
return NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(self._properties.get(b"printer_type", b"Unknown").decode("utf-8"))
|
||||||
|
|
||||||
def getPrinterTypeIfMakerBot(self, printer_type):
|
@staticmethod
|
||||||
|
def getPrinterTypeIfMakerBot(printer_type):
|
||||||
method_printer_type = {
|
method_printer_type = {
|
||||||
"fire_e": "ultimaker_method",
|
"fire_e": "ultimaker_method",
|
||||||
"lava_f": "ultimaker_methodx",
|
"lava_f": "ultimaker_methodx",
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
|
|
||||||
|
from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice
|
||||||
from ..BaseModel import BaseModel
|
from ..BaseModel import BaseModel
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +35,7 @@ class CloudClusterResponse(BaseModel):
|
||||||
self.host_version = host_version
|
self.host_version = host_version
|
||||||
self.host_internal_ip = host_internal_ip
|
self.host_internal_ip = host_internal_ip
|
||||||
self.friendly_name = friendly_name
|
self.friendly_name = friendly_name
|
||||||
self.printer_type = self.getPrinterTypeIfMakerBot(printer_type)
|
self.printer_type = NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(printer_type)
|
||||||
self.printer_count = printer_count
|
self.printer_count = printer_count
|
||||||
self.capabilities = capabilities if capabilities is not None else []
|
self.capabilities = capabilities if capabilities is not None else []
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
|
@ -52,12 +53,3 @@ class CloudClusterResponse(BaseModel):
|
||||||
"""
|
"""
|
||||||
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"}})
|
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(self, 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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue