parsing method printer nozzles

CURA-11138
This commit is contained in:
saumya.jain 2023-10-30 16:13:50 +01:00
parent 39ec9c9279
commit 1a139f44bc
2 changed files with 17 additions and 1 deletions

View file

@ -51,6 +51,9 @@ class CompatibleMachineModel(ListModel):
for output_device in machine_manager.printerOutputDevices:
for printer in output_device.printers:
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:
for extruder in printer.extruders:

View file

@ -40,9 +40,22 @@ class ExtruderConfigurationModel(QObject):
def setHotendID(self, hotend_id: Optional[str]) -> None:
if self._hotend_id != hotend_id:
self._hotend_id = hotend_id
self._hotend_id = ExtruderConfigurationModel.getHotendIdIfMakerbot(hotend_id)
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)
def hotendID(self) -> Optional[str]:
return self._hotend_id