CURA-4870 Fix an error in the hash function that detects a matching when

the extruders are inverted.
Add pretty output to the configuration model.
This commit is contained in:
Diego Prado Gesto 2018-03-06 08:44:43 +01:00
parent 51686943e6
commit d83eb383d9
3 changed files with 20 additions and 6 deletions

View file

@ -35,8 +35,13 @@ class ExtruderConfigurationModel(QObject):
def hotendID(self):
return self._hotend_id
def __str__(self):
if self._material is None or self._hotend_id is None:
return "No information"
return "Position: " + str(self._position) + " - Material: " + self._material + " - HotendID: " + self._hotend_id
def __eq__(self, other):
return hash(self) == hash(other)
def __hash__(self):
return hash(self.position) ^ hash(self.material) ^ hash(self.hotendID)
return hash(self._position) ^ hash(self._material) ^ hash(self._hotend_id)