CURA-5249 replaced the extruder value of -1 by the more explicit defaultExtruderPosition, so now Cura is aware of the actual extruder position being used. Fixes linked icon next to support settings, like support_angle.

This commit is contained in:
Jack Ha 2018-06-06 11:00:09 +02:00
parent 70d78f3cab
commit 17b127e8c1
5 changed files with 9 additions and 15 deletions

View file

@ -324,6 +324,7 @@ class CuraApplication(QtApplication):
SettingFunction.registerOperator("extruderValues", ExtruderManager.getExtruderValues)
SettingFunction.registerOperator("extruderValue", ExtruderManager.getExtruderValue)
SettingFunction.registerOperator("resolveOrValue", ExtruderManager.getResolveOrValue)
SettingFunction.registerOperator("defaultExtruderPosition", ExtruderManager.getDefaultExtruderPosition)
# Adds all resources and container related resources.
def __addAllResourcesAndContainerResources(self) -> None:

View file

@ -540,6 +540,11 @@ class ExtruderManager(QObject):
return result
## Return the default extruder position from the machine manager
@staticmethod
def getDefaultExtruderPosition() -> str:
return Application.getInstance().getMachineManager().defaultExtruderPosition
## Get all extruder values for a certain setting.
#
# This is exposed to qml for display purposes

View file

@ -287,14 +287,9 @@ class StartSliceJob(Job):
# \return A dictionary of replacement tokens to the values they should be
# replaced with.
def _buildReplacementTokens(self, stack) -> dict:
default_extruder_position = int(Application.getInstance().getMachineManager().defaultExtruderPosition)
result = {}
for key in stack.getAllKeys():
setting_type = stack.definition.getProperty(key, "type")
value = stack.getProperty(key, "value")
if setting_type == "extruder" and value == -1:
# replace with the default value
value = default_extruder_position
result[key] = value
Job.yieldThread()

View file

@ -3644,7 +3644,7 @@
"description": "The extruder train to use for printing the support. This is used in multi-extrusion.",
"type": "extruder",
"default_value": "0",
"value": "-1",
"value": "defaultExtruderPosition()",
"enabled": "(support_enable or support_tree_enable) and extruders_enabled_count > 1",
"settable_per_mesh": false,
"settable_per_extruder": false,
@ -4385,7 +4385,7 @@
"description": "The extruder train to use for printing the skirt/brim/raft. This is used in multi-extrusion.",
"type": "extruder",
"default_value": "0",
"value": "-1",
"value": "defaultExtruderPosition()",
"enabled": "extruders_enabled_count > 1 and resolveOrValue('adhesion_type') != 'none'",
"settable_per_mesh": false,
"settable_per_extruder": false

View file

@ -93,14 +93,7 @@ SettingItem
{
target: control
property: "currentIndex"
value:
{
if(propertyProvider.properties.value == -1)
{
return control.getIndexByPosition(Cura.MachineManager.defaultExtruderPosition);
}
return propertyProvider.properties.value
}
value: control.getIndexByPosition(propertyProvider.properties.value)
// Sometimes when the value is already changed, the model is still being built.
// The when clause ensures that the current index is not updated when this happens.
when: control.model.items.length > 0