mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
CURA-4870 Update the selected configuration in the UI when the
configuration in the printer changes. Modify again the hash function.
This commit is contained in:
parent
d83eb383d9
commit
d02d845d1b
4 changed files with 14 additions and 9 deletions
|
@ -52,7 +52,13 @@ class ConfigurationModel(QObject):
|
|||
return hash(self) == hash(other)
|
||||
|
||||
def __hash__(self):
|
||||
extruder_hash = hash(self.extruderConfigurations[0]) # Use the hash of the first extruder as a seed
|
||||
extruder_hash = hash(0)
|
||||
first_extruder = None
|
||||
for configuration in self.extruderConfigurations:
|
||||
extruder_hash ^= hash(configuration)
|
||||
if configuration.position == 0:
|
||||
first_extruder = configuration
|
||||
if first_extruder:
|
||||
extruder_hash &= hash(first_extruder)
|
||||
|
||||
return hash(self._printer_type) ^ extruder_hash ^ hash(self._buildplate_configuration)
|
Loading…
Add table
Add a link
Reference in a new issue