diff --git a/cura/Machines/Models/DiscoveredPrintersModel.py b/cura/Machines/Models/DiscoveredPrintersModel.py index d548b0980c..e639ee2d25 100644 --- a/cura/Machines/Models/DiscoveredPrintersModel.py +++ b/cura/Machines/Models/DiscoveredPrintersModel.py @@ -70,7 +70,7 @@ class DiscoveredPrinter(QObject): # In ClusterUM3OutputDevice, when it updates a printer information, it updates the machine type using the field # "machine_variant", and for some reason, it's not the machine type ID/codename/... but a human-readable string # like "Ultimaker 3". The code below handles this case. - if machine_manager.hasMachineTypeName(self._machine_type): + if machine_manager.hasHumanReadableMachineTypeName(self._machine_type): readable_type = self._machine_type else: readable_type = machine_manager.getMachineTypeNameFromId(self._machine_type) @@ -82,7 +82,7 @@ class DiscoveredPrinter(QObject): def isUnknownMachineType(self) -> bool: from cura.CuraApplication import CuraApplication machine_manager = CuraApplication.getInstance().getMachineManager() - if machine_manager.hasMachineTypeName(self._machine_type): + if machine_manager.hasHumanReadableMachineTypeName(self._machine_type): readable_type = self._machine_type else: readable_type = machine_manager.getMachineTypeNameFromId(self._machine_type) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index d35ce116ac..24d63d5164 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1640,7 +1640,10 @@ class MachineManager(QObject): return abbr_machine - def hasMachineTypeName(self, machine_type_name: str) -> bool: + # Checks if the given machine type name in the available machine list. + # The machine type is a code name such as "ultimaker_3", while the machine type name is the human-readable name of + # the machine type, which is "Ultimaker 3" for "ultimaker_3". + def hasHumanReadableMachineTypeName(self, machine_type_name: str) -> bool: results = self._container_registry.findDefinitionContainersMetadata(name = machine_type_name) return len(results) > 0