mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
CURA-4870 Wait until the configuration has all the mandatory data before
add it to the list of unique configurations. Remove some connections to signals and reuse already defined listeners.
This commit is contained in:
parent
d807ce57a5
commit
dfb903fb81
6 changed files with 36 additions and 21 deletions
|
@ -45,9 +45,7 @@ class PrinterOutputModel(QObject):
|
|||
self._buildplate_name = None
|
||||
# Update the printer configuration every time any of the extruders changes its configuration
|
||||
for extruder in self._extruders:
|
||||
extruder.extruderConfigurationChanged.connect(self._updatePrinterConfiguration)
|
||||
self.printerTypeChanged.connect(self._updatePrinterConfiguration)
|
||||
self.buildplateChanged.connect(self._updatePrinterConfiguration)
|
||||
extruder.extruderConfigurationChanged.connect(self._updateExtruderConfiguration)
|
||||
|
||||
self._camera = None
|
||||
|
||||
|
@ -80,16 +78,20 @@ class PrinterOutputModel(QObject):
|
|||
def updateType(self, printer_type):
|
||||
if self._printer_type != printer_type:
|
||||
self._printer_type = printer_type
|
||||
self._printer_configuration.printerType = self._printer_type
|
||||
self.printerTypeChanged.emit()
|
||||
self.configurationChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify = buildplateChanged)
|
||||
def buildplate(self):
|
||||
return self._buildplate_name
|
||||
|
||||
def updateBuildplate(self, buildplate_name):
|
||||
def updateBuildplateName(self, buildplate_name):
|
||||
if self._buildplate_name != buildplate_name:
|
||||
self._buildplate_name = buildplate_name
|
||||
self._printer_configuration.buildplateConfiguration = self._buildplate_name
|
||||
self.buildplateChanged.emit()
|
||||
self.configurationChanged.emit()
|
||||
|
||||
@pyqtProperty(str, notify=keyChanged)
|
||||
def key(self):
|
||||
|
@ -260,10 +262,10 @@ class PrinterOutputModel(QObject):
|
|||
# Returns the configuration (material, variant and buildplate) of the current printer
|
||||
@pyqtProperty(QObject, notify = configurationChanged)
|
||||
def printerConfiguration(self):
|
||||
return self._printer_configuration
|
||||
if self._printer_configuration.isValid():
|
||||
return self._printer_configuration
|
||||
return None
|
||||
|
||||
def _updatePrinterConfiguration(self):
|
||||
self._printer_configuration.printerType = self._printer_type
|
||||
def _updateExtruderConfiguration(self):
|
||||
self._printer_configuration.extruderConfigurations = [extruder.extruderConfiguration for extruder in self._extruders]
|
||||
self._printer_configuration.buildplateConfiguration = self._buildplate_name
|
||||
self.configurationChanged.emit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue