mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
parsing method printer nozzles
CURA-11138
This commit is contained in:
parent
39ec9c9279
commit
1a139f44bc
2 changed files with 17 additions and 1 deletions
|
@ -51,6 +51,9 @@ class CompatibleMachineModel(ListModel):
|
||||||
for output_device in machine_manager.printerOutputDevices:
|
for output_device in machine_manager.printerOutputDevices:
|
||||||
for printer in output_device.printers:
|
for printer in output_device.printers:
|
||||||
extruder_configs = dict()
|
extruder_configs = dict()
|
||||||
|
# If the printer name already exist in the queue skip it
|
||||||
|
if printer.name in [item["name"] for item in self.items]:
|
||||||
|
continue
|
||||||
|
|
||||||
# initialize & add current active material:
|
# initialize & add current active material:
|
||||||
for extruder in printer.extruders:
|
for extruder in printer.extruders:
|
||||||
|
|
|
@ -40,9 +40,22 @@ 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 = hotend_id
|
self._hotend_id = ExtruderConfigurationModel.getHotendIdIfMakerbot(hotend_id)
|
||||||
self.extruderConfigurationChanged.emit()
|
self.extruderConfigurationChanged.emit()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getHotendIdIfMakerbot(hotendId) -> str:
|
||||||
|
_EXTRUDER_NAME_MAP = {
|
||||||
|
"mk14_hot":"1XA",
|
||||||
|
"mk14_hot_s":"2XA",
|
||||||
|
"mk14_c":"1C",
|
||||||
|
"mk14":"1A",
|
||||||
|
"mk14_s":"2A"
|
||||||
|
}
|
||||||
|
if hotendId in _EXTRUDER_NAME_MAP:
|
||||||
|
return _EXTRUDER_NAME_MAP[hotendId]
|
||||||
|
return hotendId
|
||||||
|
|
||||||
@pyqtProperty(str, fset = setHotendID, notify = extruderConfigurationChanged)
|
@pyqtProperty(str, fset = setHotendID, notify = extruderConfigurationChanged)
|
||||||
def hotendID(self) -> Optional[str]:
|
def hotendID(self) -> Optional[str]:
|
||||||
return self._hotend_id
|
return self._hotend_id
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue