mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 17:57:55 -06:00
Update the active extruder index when the global container changes. This
fixes a problem when Cura starts with a single extruder printer but the user then choose a multiextruder printer - CURA-4386 Also added a quality definition in UM3E extruder with the ids of the UM3 extruders, so that the profiles for UM3 are also valid for UM3E and viceversa - CURA-4389 All are related issues with profiles and multiextruder printers
This commit is contained in:
parent
61e65d5cb0
commit
afb83fac88
8 changed files with 37 additions and 36 deletions
|
@ -530,6 +530,16 @@ class ExtruderManager(QObject):
|
||||||
if global_container_stack and global_container_stack.getBottom() and global_container_stack.getBottom().getId() != self._global_container_stack_definition_id:
|
if global_container_stack and global_container_stack.getBottom() and global_container_stack.getBottom().getId() != self._global_container_stack_definition_id:
|
||||||
self._global_container_stack_definition_id = global_container_stack.getBottom().getId()
|
self._global_container_stack_definition_id = global_container_stack.getBottom().getId()
|
||||||
self.globalContainerStackDefinitionChanged.emit()
|
self.globalContainerStackDefinitionChanged.emit()
|
||||||
|
|
||||||
|
# If the global container changed, the number of extruders could be changed and so the active_extruder_index is updated
|
||||||
|
extruder_count = global_container_stack.getProperty("machine_extruder_count", "value")
|
||||||
|
if extruder_count > 1:
|
||||||
|
if self._active_extruder_index == -1:
|
||||||
|
self.setActiveExtruderIndex(0)
|
||||||
|
else:
|
||||||
|
if self._active_extruder_index > -1:
|
||||||
|
self.setActiveExtruderIndex(-1)
|
||||||
|
|
||||||
self.activeExtruderChanged.emit()
|
self.activeExtruderChanged.emit()
|
||||||
|
|
||||||
self.resetSelectedObjectExtruders()
|
self.resetSelectedObjectExtruders()
|
||||||
|
|
|
@ -98,16 +98,10 @@ class ProfilesModel(InstanceContainersModel):
|
||||||
extruder_manager = ExtruderManager.getInstance()
|
extruder_manager = ExtruderManager.getInstance()
|
||||||
active_extruder = extruder_manager.getActiveExtruderStack()
|
active_extruder = extruder_manager.getActiveExtruderStack()
|
||||||
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
||||||
if extruder_stacks:
|
if multiple_extrusion:
|
||||||
if multiple_extrusion:
|
# Place the active extruder at the front of the list.
|
||||||
# Place the active extruder at the front of the list.
|
extruder_stacks.remove(active_extruder)
|
||||||
if active_extruder in extruder_stacks:
|
extruder_stacks = [active_extruder] + extruder_stacks
|
||||||
extruder_stacks.remove(active_extruder)
|
|
||||||
extruder_stacks = [active_extruder] + extruder_stacks
|
|
||||||
else:
|
|
||||||
# The active extruder is the first in the list and only the active extruder is use to compute the usable qualities
|
|
||||||
active_extruder = None
|
|
||||||
extruder_stacks = []
|
|
||||||
|
|
||||||
# Get a list of usable/available qualities for this machine and material
|
# Get a list of usable/available qualities for this machine and material
|
||||||
qualities = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
|
qualities = QualityManager.getInstance().findAllUsableQualitiesForMachineAndExtruders(global_container_stack,
|
||||||
|
|
|
@ -31,16 +31,10 @@ class QualityAndUserProfilesModel(ProfilesModel):
|
||||||
extruder_manager = ExtruderManager.getInstance()
|
extruder_manager = ExtruderManager.getInstance()
|
||||||
active_extruder = extruder_manager.getActiveExtruderStack()
|
active_extruder = extruder_manager.getActiveExtruderStack()
|
||||||
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
||||||
if extruder_stacks:
|
if multiple_extrusion:
|
||||||
if multiple_extrusion:
|
# Place the active extruder at the front of the list.
|
||||||
# Place the active extruder at the front of the list.
|
extruder_stacks.remove(active_extruder)
|
||||||
if active_extruder in extruder_stacks:
|
extruder_stacks = [active_extruder] + extruder_stacks
|
||||||
extruder_stacks.remove(active_extruder)
|
|
||||||
extruder_stacks = [active_extruder] + extruder_stacks
|
|
||||||
else:
|
|
||||||
# The active extruder is the first in the list and only the active extruder is use to compute the usable qualities
|
|
||||||
active_extruder = None
|
|
||||||
extruder_stacks = []
|
|
||||||
|
|
||||||
# Fetch the list of useable qualities across all extruders.
|
# Fetch the list of useable qualities across all extruders.
|
||||||
# The actual list of quality profiles come from the first extruder in the extruder list.
|
# The actual list of quality profiles come from the first extruder in the extruder list.
|
||||||
|
@ -53,6 +47,7 @@ class QualityAndUserProfilesModel(ProfilesModel):
|
||||||
if multiple_extrusion:
|
if multiple_extrusion:
|
||||||
# If the printer has multiple extruders then quality changes related to the current extruder are kept
|
# If the printer has multiple extruders then quality changes related to the current extruder are kept
|
||||||
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and
|
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and
|
||||||
|
qc.getMetaDataEntry("extruder") is not None and
|
||||||
qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition") or
|
qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition") or
|
||||||
qc.getMetaDataEntry("extruder") == active_extruder.definition.getId()]
|
qc.getMetaDataEntry("extruder") == active_extruder.definition.getId()]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -31,16 +31,10 @@ class UserProfilesModel(ProfilesModel):
|
||||||
extruder_manager = ExtruderManager.getInstance()
|
extruder_manager = ExtruderManager.getInstance()
|
||||||
active_extruder = extruder_manager.getActiveExtruderStack()
|
active_extruder = extruder_manager.getActiveExtruderStack()
|
||||||
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
extruder_stacks = extruder_manager.getActiveExtruderStacks()
|
||||||
if extruder_stacks:
|
if multiple_extrusion:
|
||||||
if multiple_extrusion:
|
# Place the active extruder at the front of the list.
|
||||||
# Place the active extruder at the front of the list.
|
extruder_stacks.remove(active_extruder)
|
||||||
if active_extruder in extruder_stacks:
|
extruder_stacks = [active_extruder] + extruder_stacks
|
||||||
extruder_stacks.remove(active_extruder)
|
|
||||||
extruder_stacks = [active_extruder] + extruder_stacks
|
|
||||||
else:
|
|
||||||
# The active extruder is the first in the list and only the active extruder is use to compute the usable qualities
|
|
||||||
active_extruder = None
|
|
||||||
extruder_stacks = []
|
|
||||||
|
|
||||||
# Fetch the list of useable qualities across all extruders.
|
# Fetch the list of useable qualities across all extruders.
|
||||||
# The actual list of quality profiles come from the first extruder in the extruder list.
|
# The actual list of quality profiles come from the first extruder in the extruder list.
|
||||||
|
@ -52,9 +46,13 @@ class UserProfilesModel(ProfilesModel):
|
||||||
|
|
||||||
if multiple_extrusion:
|
if multiple_extrusion:
|
||||||
# If the printer has multiple extruders then quality changes related to the current extruder are kept
|
# If the printer has multiple extruders then quality changes related to the current extruder are kept
|
||||||
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition")]
|
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and
|
||||||
|
qc.getMetaDataEntry("extruder") is not None and
|
||||||
|
qc.getMetaDataEntry("extruder") == active_extruder.definition.getMetaDataEntry("quality_definition") or
|
||||||
|
qc.getMetaDataEntry("extruder") == active_extruder.definition.getId()]
|
||||||
else:
|
else:
|
||||||
# If not, the quality changes of the global stack are selected
|
# If not, the quality changes of the global stack are selected
|
||||||
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and qc.getMetaDataEntry("extruder") is None]
|
filtered_quality_changes = [qc for qc in quality_changes_list if qc.getMetaDataEntry("quality_type") in quality_type_set and
|
||||||
|
qc.getMetaDataEntry("extruder") is None]
|
||||||
|
|
||||||
return filtered_quality_changes
|
return filtered_quality_changes
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker3_extended",
|
"machine": "ultimaker3_extended",
|
||||||
"position": "0"
|
"position": "0",
|
||||||
|
"quality_definition": "ultimaker3_extruder_left"
|
||||||
},
|
},
|
||||||
|
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker3_extended",
|
"machine": "ultimaker3_extended",
|
||||||
"position": "1"
|
"position": "1",
|
||||||
|
"quality_definition": "ultimaker3_extruder_right"
|
||||||
},
|
},
|
||||||
|
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker3",
|
"machine": "ultimaker3",
|
||||||
"position": "0"
|
"position": "0",
|
||||||
|
"quality_definition": "ultimaker3_extruder_left"
|
||||||
},
|
},
|
||||||
|
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
"inherits": "fdmextruder",
|
"inherits": "fdmextruder",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"machine": "ultimaker3",
|
"machine": "ultimaker3",
|
||||||
"position": "1"
|
"position": "1",
|
||||||
|
"quality_definition": "ultimaker3_extruder_right"
|
||||||
},
|
},
|
||||||
|
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue