mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Function name changed to make it a bit generic
CURA-11138
This commit is contained in:
parent
1a139f44bc
commit
ce132e4c3f
3 changed files with 8 additions and 8 deletions
|
@ -40,11 +40,11 @@ class ExtruderConfigurationModel(QObject):
|
||||||
|
|
||||||
def setHotendID(self, hotend_id: Optional[str]) -> None:
|
def setHotendID(self, hotend_id: Optional[str]) -> None:
|
||||||
if self._hotend_id != hotend_id:
|
if self._hotend_id != hotend_id:
|
||||||
self._hotend_id = ExtruderConfigurationModel.getHotendIdIfMakerbot(hotend_id)
|
self._hotend_id = ExtruderConfigurationModel.applyNameMappingHotend(hotend_id)
|
||||||
self.extruderConfigurationChanged.emit()
|
self.extruderConfigurationChanged.emit()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getHotendIdIfMakerbot(hotendId) -> str:
|
def applyNameMappingHotend(hotendId) -> str:
|
||||||
_EXTRUDER_NAME_MAP = {
|
_EXTRUDER_NAME_MAP = {
|
||||||
"mk14_hot":"1XA",
|
"mk14_hot":"1XA",
|
||||||
"mk14_hot_s":"2XA",
|
"mk14_hot_s":"2XA",
|
||||||
|
|
|
@ -415,17 +415,17 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
def printerType(self) -> str:
|
def printerType(self) -> str:
|
||||||
return NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(self._properties.get(b"printer_type", b"Unknown").decode("utf-8"))
|
return NetworkedPrinterOutputDevice.applyPrinterTypeMapping(self._properties.get(b"printer_type", b"Unknown").decode("utf-8"))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getPrinterTypeIfMakerBot(printer_type):
|
def applyPrinterTypeMapping(printer_type):
|
||||||
method_printer_type = {
|
_PRINTER_TYPE_NAME = {
|
||||||
"fire_e": "ultimaker_method",
|
"fire_e": "ultimaker_method",
|
||||||
"lava_f": "ultimaker_methodx",
|
"lava_f": "ultimaker_methodx",
|
||||||
"magma_10": "ultimaker_methodxl"
|
"magma_10": "ultimaker_methodxl"
|
||||||
}
|
}
|
||||||
if printer_type in method_printer_type:
|
if printer_type in _PRINTER_TYPE_NAME:
|
||||||
return method_printer_type[printer_type]
|
return _PRINTER_TYPE_NAME[printer_type]
|
||||||
return printer_type
|
return printer_type
|
||||||
|
|
||||||
@pyqtProperty(str, constant = True)
|
@pyqtProperty(str, constant = True)
|
||||||
|
|
|
@ -35,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 = NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(printer_type)
|
self.printer_type = NetworkedPrinterOutputDevice.applyPrinterTypeMapping(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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue