mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Switching from dual extrusion to single extrusion machine is now possible again
CURA-3497
This commit is contained in:
parent
ab6240bd31
commit
f062322ebf
2 changed files with 16 additions and 11 deletions
|
@ -183,7 +183,10 @@ class PrintInformation(QObject):
|
||||||
|
|
||||||
def _onActiveMaterialChanged(self):
|
def _onActiveMaterialChanged(self):
|
||||||
if self._active_material_container:
|
if self._active_material_container:
|
||||||
self._active_material_container.metaDataChanged.disconnect(self._onMaterialMetaDataChanged)
|
try:
|
||||||
|
self._active_material_container.metaDataChanged.disconnect(self._onMaterialMetaDataChanged)
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
active_material_id = Application.getInstance().getMachineManager().activeMaterialId
|
active_material_id = Application.getInstance().getMachineManager().activeMaterialId
|
||||||
active_material_containers = ContainerRegistry.getInstance().findInstanceContainers(id=active_material_id)
|
active_material_containers = ContainerRegistry.getInstance().findInstanceContainers(id=active_material_id)
|
||||||
|
|
|
@ -234,14 +234,16 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
def _onGlobalContainerChanged(self):
|
def _onGlobalContainerChanged(self):
|
||||||
if self._global_container_stack:
|
if self._global_container_stack:
|
||||||
self._global_container_stack.nameChanged.disconnect(self._onMachineNameChanged)
|
try:
|
||||||
self._global_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
|
self._global_container_stack.nameChanged.disconnect(self._onMachineNameChanged)
|
||||||
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
self._global_container_stack.containersChanged.disconnect(self._onInstanceContainersChanged)
|
||||||
|
self._global_container_stack.propertyChanged.disconnect(self._onPropertyChanged)
|
||||||
material = self._global_container_stack.findContainer({"type": "material"})
|
except:
|
||||||
|
pass
|
||||||
|
material = self._global_container_stack.material
|
||||||
material.nameChanged.disconnect(self._onMaterialNameChanged)
|
material.nameChanged.disconnect(self._onMaterialNameChanged)
|
||||||
|
|
||||||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
quality = self._global_container_stack.quality
|
||||||
quality.nameChanged.disconnect(self._onQualityNameChanged)
|
quality.nameChanged.disconnect(self._onQualityNameChanged)
|
||||||
|
|
||||||
if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1:
|
if self._global_container_stack.getProperty("machine_extruder_count", "value") > 1:
|
||||||
|
@ -264,11 +266,11 @@ class MachineManager(QObject):
|
||||||
# For multi-extrusion machines, we do not want variant or material profiles in the stack,
|
# For multi-extrusion machines, we do not want variant or material profiles in the stack,
|
||||||
# because these are extruder specific and may cause wrong values to be used for extruders
|
# because these are extruder specific and may cause wrong values to be used for extruders
|
||||||
# that did not specify a value in the extruder.
|
# that did not specify a value in the extruder.
|
||||||
global_variant = self._global_container_stack.findContainer(type = "variant")
|
global_variant = self._global_container_stack.variant
|
||||||
if global_variant != self._empty_variant_container:
|
if global_variant != self._empty_variant_container:
|
||||||
self._global_container_stack.setVariant(self._empty_variant_container)
|
self._global_container_stack.setVariant(self._empty_variant_container)
|
||||||
|
|
||||||
global_material = self._global_container_stack.findContainer(type = "material")
|
global_material = self._global_container_stack.material
|
||||||
if global_material != self._empty_material_container:
|
if global_material != self._empty_material_container:
|
||||||
self._global_container_stack.setMaterial(self._empty_material_container)
|
self._global_container_stack.setMaterial(self._empty_material_container)
|
||||||
|
|
||||||
|
@ -277,10 +279,10 @@ class MachineManager(QObject):
|
||||||
extruder_stack.containersChanged.connect(self._onInstanceContainersChanged)
|
extruder_stack.containersChanged.connect(self._onInstanceContainersChanged)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
material = self._global_container_stack.findContainer({"type": "material"})
|
material = self._global_container_stack.material
|
||||||
material.nameChanged.connect(self._onMaterialNameChanged)
|
material.nameChanged.connect(self._onMaterialNameChanged)
|
||||||
|
|
||||||
quality = self._global_container_stack.findContainer({"type": "quality"})
|
quality = self._global_container_stack.quality
|
||||||
quality.nameChanged.connect(self._onQualityNameChanged)
|
quality.nameChanged.connect(self._onQualityNameChanged)
|
||||||
|
|
||||||
self._updateStacksHaveErrors()
|
self._updateStacksHaveErrors()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue