mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Bed temperature is now either a resolved value or a global value.
Contributes to CURA-2007
This commit is contained in:
parent
aba027373b
commit
2402ba3d0e
6 changed files with 34 additions and 5 deletions
|
@ -98,6 +98,7 @@ class CuraApplication(QtApplication):
|
|||
SettingDefinition.addSupportedProperty("settable_per_meshgroup", DefinitionPropertyType.Any, default = True)
|
||||
SettingDefinition.addSupportedProperty("settable_globally", DefinitionPropertyType.Any, default = True)
|
||||
SettingDefinition.addSupportedProperty("global_inherits_stack", DefinitionPropertyType.Function, default = "-1")
|
||||
SettingDefinition.addSupportedProperty("resolve", DefinitionPropertyType.Function, default = None)
|
||||
SettingDefinition.addSettingType("extruder", None, str, Validator)
|
||||
|
||||
SettingFunction.registerOperator("extruderValues", cura.Settings.ExtruderManager.getExtruderValues)
|
||||
|
|
|
@ -203,6 +203,12 @@ class StartSliceJob(Job):
|
|||
keys = stack.getAllKeys()
|
||||
settings = {}
|
||||
for key in keys:
|
||||
# Use resolvement value if available, or take the value
|
||||
resolved_value = stack.getProperty(key, "resolve")
|
||||
if resolved_value is not None:
|
||||
settings[key] = resolved_value
|
||||
else:
|
||||
# Normal case
|
||||
settings[key] = stack.getProperty(key, "value")
|
||||
|
||||
start_gcode = settings["machine_start_gcode"]
|
||||
|
|
|
@ -1089,6 +1089,7 @@
|
|||
"description": "The temperature used for the heated bed. Set at 0 to pre-heat the printer manually.",
|
||||
"unit": "°C",
|
||||
"type": "float",
|
||||
"resolve": "sum(extruderValues('material_bed_temperature')) / len(extruderValues('material_bed_temperature'))",
|
||||
"default_value": 60,
|
||||
"minimum_value": "0",
|
||||
"maximum_value_warning": "260",
|
||||
|
|
|
@ -28,6 +28,9 @@ Item {
|
|||
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
||||
property var state: propertyProvider.properties.state
|
||||
property var settablePerExtruder: propertyProvider.properties.settable_per_extruder
|
||||
property var value: propertyProvider.properties.value
|
||||
property var globalValue: globalPropertyProvider.properties.value
|
||||
property var resolve: propertyProvider.properties.resolve
|
||||
property var stackLevels: propertyProvider.stackLevels
|
||||
property var stackLevel: stackLevels[0]
|
||||
|
||||
|
@ -150,7 +153,15 @@ Item {
|
|||
|
||||
iconSource: UM.Theme.getIcon("link")
|
||||
|
||||
onEntered: { hoverTimer.stop(); base.showTooltip(catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders")) }
|
||||
onEntered: {
|
||||
hoverTimer.stop();
|
||||
var tooltipText = catalog.i18nc("@label", "This setting is always shared between all extruders. Changing it here will change the value for all extruders") + ".";
|
||||
if ((resolve != "None") && (globalValue == null)) {
|
||||
// We come here if a setting has a resolve and the setting is not manually edited.
|
||||
tooltipText += " " + catalog.i18nc("@label", "The value is resolved from the individual value ") + value + ".";
|
||||
}
|
||||
base.showTooltip(tooltipText);
|
||||
}
|
||||
onExited: base.showTooltip(base.tooltipText);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,16 @@ SettingItem
|
|||
{
|
||||
target: input
|
||||
property: "text"
|
||||
value: propertyProvider.properties.value
|
||||
value: {
|
||||
if (propertyProvider.properties.resolve != "None") {
|
||||
// We have a resolve function. Indicates that the setting is not settable per extruder and that
|
||||
// we have to choose between the resolved value (default) and the global value
|
||||
// (if user has explicitly set this).
|
||||
return (globalPropertyProvider.properties.value != null) ? globalPropertyProvider.properties.value : propertyProvider.properties.resolve;
|
||||
} else {
|
||||
return propertyProvider.properties.value;
|
||||
}
|
||||
}
|
||||
when: !input.activeFocus
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ ScrollView
|
|||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
property var propertyProvider: provider
|
||||
property var globalPropertyProvider: inheritStackProvider
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||
|
@ -118,7 +119,7 @@ ScrollView
|
|||
id: inheritStackProvider
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key
|
||||
watchedProperties: [ "global_inherits_stack"]
|
||||
watchedProperties: [ "global_inherits_stack", "value" ]
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
|
@ -127,7 +128,7 @@ ScrollView
|
|||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key ? model.key : ""
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder" ]
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue