mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 00:55:59 +08:00
Merge branch 'cura-2007' of github.com:Ultimaker/Cura
This commit is contained in:
commit
114899dc91
@ -13,7 +13,6 @@ from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
|||||||
from UM.Mesh.ReadMeshJob import ReadMeshJob
|
from UM.Mesh.ReadMeshJob import ReadMeshJob
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Preferences import Preferences
|
from UM.Preferences import Preferences
|
||||||
from UM.Platform import Platform
|
|
||||||
from UM.JobQueue import JobQueue
|
from UM.JobQueue import JobQueue
|
||||||
from UM.SaveFile import SaveFile
|
from UM.SaveFile import SaveFile
|
||||||
from UM.Scene.Selection import Selection
|
from UM.Scene.Selection import Selection
|
||||||
@ -50,12 +49,12 @@ from PyQt5.QtGui import QColor, QIcon
|
|||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType
|
from PyQt5.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType
|
||||||
|
|
||||||
import platform
|
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
import numpy
|
import numpy
|
||||||
import copy
|
import copy
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
numpy.seterr(all="ignore")
|
numpy.seterr(all="ignore")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -90,6 +89,7 @@ class CuraApplication(QtApplication):
|
|||||||
SettingDefinition.addSupportedProperty("settable_per_meshgroup", DefinitionPropertyType.Any, default = True, read_only = True)
|
SettingDefinition.addSupportedProperty("settable_per_meshgroup", DefinitionPropertyType.Any, default = True, read_only = True)
|
||||||
SettingDefinition.addSupportedProperty("settable_globally", DefinitionPropertyType.Any, default = True, read_only = True)
|
SettingDefinition.addSupportedProperty("settable_globally", DefinitionPropertyType.Any, default = True, read_only = True)
|
||||||
SettingDefinition.addSupportedProperty("global_inherits_stack", DefinitionPropertyType.Function, default = "-1")
|
SettingDefinition.addSupportedProperty("global_inherits_stack", DefinitionPropertyType.Function, default = "-1")
|
||||||
|
SettingDefinition.addSupportedProperty("resolve", DefinitionPropertyType.Function, default = None)
|
||||||
SettingDefinition.addSettingType("extruder", None, str, Validator)
|
SettingDefinition.addSettingType("extruder", None, str, Validator)
|
||||||
|
|
||||||
SettingFunction.registerOperator("extruderValues", cura.Settings.ExtruderManager.getExtruderValues)
|
SettingFunction.registerOperator("extruderValues", cura.Settings.ExtruderManager.getExtruderValues)
|
||||||
@ -925,3 +925,7 @@ class CuraApplication(QtApplication):
|
|||||||
self._additional_components[area_id].append(component)
|
self._additional_components[area_id].append(component)
|
||||||
|
|
||||||
self.additionalComponentsChanged.emit(area_id)
|
self.additionalComponentsChanged.emit(area_id)
|
||||||
|
|
||||||
|
@pyqtSlot(str)
|
||||||
|
def log(self, msg):
|
||||||
|
Logger.log("d", msg)
|
||||||
|
@ -330,6 +330,17 @@ class ExtruderManager(QObject):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
## Get all extruder values for a certain setting.
|
||||||
|
#
|
||||||
|
# This is exposed to qml for display purposes
|
||||||
|
#
|
||||||
|
# \param key The key of the setting to retieve values for.
|
||||||
|
#
|
||||||
|
# \return String representing the extruder values
|
||||||
|
@pyqtSlot(str, result="QList<int>")
|
||||||
|
def getInstanceExtruderValues(self, key):
|
||||||
|
return ExtruderManager.getExtruderValues(key)
|
||||||
|
|
||||||
## Get the value for a setting from a specific extruder.
|
## Get the value for a setting from a specific extruder.
|
||||||
#
|
#
|
||||||
# This is exposed to SettingFunction to use in value functions.
|
# This is exposed to SettingFunction to use in value functions.
|
||||||
|
@ -203,7 +203,13 @@ class StartSliceJob(Job):
|
|||||||
keys = stack.getAllKeys()
|
keys = stack.getAllKeys()
|
||||||
settings = {}
|
settings = {}
|
||||||
for key in keys:
|
for key in keys:
|
||||||
settings[key] = stack.getProperty(key, "value")
|
# 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"]
|
start_gcode = settings["machine_start_gcode"]
|
||||||
settings["material_bed_temp_prepend"] = "{material_bed_temperature}" not in start_gcode #Pre-compute material material_bed_temp_prepend and material_print_temp_prepend
|
settings["material_bed_temp_prepend"] = "{material_bed_temperature}" not in start_gcode #Pre-compute material material_bed_temp_prepend and material_print_temp_prepend
|
||||||
|
@ -1099,6 +1099,7 @@
|
|||||||
"description": "The temperature used for the heated build plate. Set at 0 to pre-heat the printer manually.",
|
"description": "The temperature used for the heated build plate. Set at 0 to pre-heat the printer manually.",
|
||||||
"unit": "°C",
|
"unit": "°C",
|
||||||
"type": "float",
|
"type": "float",
|
||||||
|
"resolve": "sum(extruderValues('material_bed_temperature')) / len(extruderValues('material_bed_temperature'))",
|
||||||
"default_value": 60,
|
"default_value": 60,
|
||||||
"minimum_value": "-273.15",
|
"minimum_value": "-273.15",
|
||||||
"maximum_value_warning": "260",
|
"maximum_value_warning": "260",
|
||||||
|
@ -27,6 +27,7 @@ Item {
|
|||||||
|
|
||||||
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
// Create properties to put property provider stuff in (bindings break in qt 5.5.1 otherwise)
|
||||||
property var state: propertyProvider.properties.state
|
property var state: propertyProvider.properties.state
|
||||||
|
property var resolve: propertyProvider.properties.resolve
|
||||||
property var stackLevels: propertyProvider.stackLevels
|
property var stackLevels: propertyProvider.stackLevels
|
||||||
property var stackLevel: stackLevels[0]
|
property var stackLevel: stackLevels[0]
|
||||||
|
|
||||||
@ -149,7 +150,15 @@ Item {
|
|||||||
|
|
||||||
iconSource: UM.Theme.getIcon("link")
|
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") && (stackLevel != 0)) {
|
||||||
|
// 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 per-extruder values ") + "[" + ExtruderManager.getInstanceExtruderValues(definition.key) + "].";
|
||||||
|
}
|
||||||
|
base.showTooltip(tooltipText);
|
||||||
|
}
|
||||||
onExited: base.showTooltip(base.tooltipText);
|
onExited: base.showTooltip(base.tooltipText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,16 @@ SettingItem
|
|||||||
{
|
{
|
||||||
target: input
|
target: input
|
||||||
property: "text"
|
property: "text"
|
||||||
value: propertyProvider.properties.value
|
value: {
|
||||||
|
if ((propertyProvider.properties.resolve != "None") && (stackLevel != 0) && (stackLevel != 1)) {
|
||||||
|
// 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 propertyProvider.properties.resolve;
|
||||||
|
} else {
|
||||||
|
return propertyProvider.properties.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
when: !input.activeFocus
|
when: !input.activeFocus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ ScrollView
|
|||||||
property var definition: model
|
property var definition: model
|
||||||
property var settingDefinitionsModel: definitionsModel
|
property var settingDefinitionsModel: definitionsModel
|
||||||
property var propertyProvider: provider
|
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
|
//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,
|
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||||
@ -133,7 +134,7 @@ ScrollView
|
|||||||
|
|
||||||
containerStackId: Cura.MachineManager.activeMachineId
|
containerStackId: Cura.MachineManager.activeMachineId
|
||||||
key: model.key ? model.key : ""
|
key: model.key ? model.key : ""
|
||||||
watchedProperties: [ "value", "enabled", "state", "validationState" ]
|
watchedProperties: [ "value", "enabled", "state", "validationState", "settable_per_extruder", "resolve" ]
|
||||||
storeIndex: 0
|
storeIndex: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user