mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 07:27: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
|
@ -71,7 +71,23 @@ class PrinterConfigurationModel(QObject):
|
|||
return "\n".join(message_chunks)
|
||||
|
||||
def __eq__(self, other):
|
||||
return hash(self) == hash(other)
|
||||
if not isinstance(other, PrinterConfigurationModel):
|
||||
return False
|
||||
|
||||
if self.printerType != other.printerType:
|
||||
return False
|
||||
|
||||
if self.buildplateConfiguration != other.buildplateConfiguration:
|
||||
return False
|
||||
|
||||
if len(self.extruderConfigurations) != len(other.extruderConfigurations):
|
||||
return False
|
||||
|
||||
for self_extruder, other_extruder in zip(sorted(self._extruder_configurations, key=lambda x: x.position), sorted(other.extruderConfigurations, key=lambda x: x.position)):
|
||||
if self_extruder != other_extruder:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
## The hash function is used to compare and create unique sets. The configuration is unique if the configuration
|
||||
# of the extruders is unique (the order of the extruders matters), and the type and buildplate is the same.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue