mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Fixed highlighting matching configuration if a material is empty
This commit is contained in:
parent
8210317c91
commit
c32c642ba5
2 changed files with 35 additions and 2 deletions
|
@ -62,7 +62,24 @@ class ExtruderConfigurationModel(QObject):
|
|||
return " ".join(message_chunks)
|
||||
|
||||
def __eq__(self, other) -> bool:
|
||||
return hash(self) == hash(other)
|
||||
if not isinstance(other, ExtruderConfigurationModel):
|
||||
return False
|
||||
|
||||
if self._position != other.position:
|
||||
return False
|
||||
# Empty materials should be ignored for comparison
|
||||
if self.activeMaterial is not None and other.activeMaterial is not None:
|
||||
if self.activeMaterial.guid != other.activeMaterial.guid:
|
||||
if self.activeMaterial.guid != "" and other.activeMaterial.guid != "":
|
||||
return False
|
||||
else:
|
||||
# At this point there is no material, so it doesn't matter what the hotend is.
|
||||
return True
|
||||
|
||||
if self.hotendID != other.hotendID:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
# Calculating a hash function using the position of the extruder, the material GUID and the hotend id to check if is
|
||||
# unique within a set
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue