Refactored the config models so they they function are more stand alone units.

The seperation of concern got a bit mixed up, as the printer output model was connecting the signals that the config model needed to function together.
With these changes it's now also possible to use the config model as a part of a printjob, since printjobs can also have a configuration
This commit is contained in:
Jaime van Kessel 2018-08-09 16:22:35 +02:00
parent da23eff2a6
commit 86be07b095
4 changed files with 67 additions and 57 deletions

View file

@ -27,7 +27,13 @@ class ConfigurationModel(QObject):
return self._printer_type
def setExtruderConfigurations(self, extruder_configurations):
self._extruder_configurations = extruder_configurations
if self._extruder_configurations != extruder_configurations:
self._extruder_configurations = extruder_configurations
for extruder_configuration in self._extruder_configurations:
extruder_configuration.extruderConfigurationChanged.connect(self.configurationChanged)
self.configurationChanged.emit()
@pyqtProperty("QVariantList", fset = setExtruderConfigurations, notify = configurationChanged)
def extruderConfigurations(self):