Merge remote-tracking branch 'master'

This commit is contained in:
Lipu Fei 2017-09-11 11:11:24 +02:00
commit e26be6b14a
2 changed files with 21 additions and 9 deletions

View file

@ -319,18 +319,24 @@ class StartSliceJob(Job):
# \param message object_lists message to put the per object settings in
def _handlePerObjectSettings(self, node, message):
stack = node.callDecoration("getStack")
if not stack: # Check if the node has a stack attached to it and the stack has any settings in the top container.
# Check if the node has a stack attached to it and the stack has any settings in the top container.
if not stack:
return
# Check all settings for relations, so we can also calculate the correct values for dependent settings.
top_of_stack = stack.getTop() #Cache for efficiency.
top_of_stack = stack.getTop() # Cache for efficiency.
changed_setting_keys = set(top_of_stack.getAllKeys())
# Add all relations to changed settings as well.
for key in top_of_stack.getAllKeys():
instance = top_of_stack.getInstance(key)
self._addRelations(changed_setting_keys, instance.definition.relations)
Job.yieldThread()
# Ensure that the engine is aware what the build extruder is
Logger.log("d", "changed_setting_keys=%s", changed_setting_keys)
# Ensure that the engine is aware what the build extruder is.
if stack.getProperty("machine_extruder_count", "value") > 1:
changed_setting_keys.add("extruder_nr")
@ -339,14 +345,20 @@ class StartSliceJob(Job):
setting = message.addRepeatedMessage("settings")
setting.name = key
extruder = int(round(float(stack.getProperty(key, "limit_to_extruder"))))
if extruder >= 0 and key not in top_of_stack.getAllKeys(): #Limited to a specific extruder, but not overridden by per-object settings.
# Check if limited to a specific extruder, but not overridden by per-object settings.
if extruder >= 0 and key not in changed_setting_keys:
limited_stack = ExtruderManager.getInstance().getActiveExtruderStacks()[extruder]
else:
limited_stack = stack #Just take from the per-object settings itself.
limited_stack = stack
setting.value = str(limited_stack.getProperty(key, "value")).encode("utf-8")
Logger.log("d", "key=%s value=%s", key, setting.value)
Job.yieldThread()
## Recursive function to put all settings that require eachother for value changes in a list
## Recursive function to put all settings that require each other for value changes in a list
# \param relations_set \type{set} Set of keys (strings) of settings that are influenced
# \param relations list of relation objects that need to be checked.
def _addRelations(self, relations_set, relations):

View file

@ -166,7 +166,7 @@
"setting_control_highlight": [255, 255, 255, 0],
"setting_control_border": [127, 127, 127, 255],
"setting_control_border_highlight": [12, 169, 227, 255],
"setting_control_text": [127, 127, 127, 255],
"setting_control_text": [27, 27, 27, 255],
"setting_control_depth_line": [127, 127, 127, 255],
"setting_control_button": [127, 127, 127, 255],
"setting_control_button_hover": [70, 84, 113, 255],
@ -198,7 +198,7 @@
"checkbox_border": [64, 69, 72, 255],
"checkbox_border_hover": [12, 169, 227, 255],
"checkbox_mark": [119, 122, 124, 255],
"checkbox_text": [166, 168, 169, 255],
"checkbox_text": [27, 27, 27, 255],
"mode_switch": [255, 255, 255, 255],
"mode_switch_hover": [255, 255, 255, 255],
@ -226,7 +226,7 @@
"message_progressbar_background": [255, 255, 255, 255],
"message_progressbar_control": [12, 169, 227, 255],
"tool_panel_background": [31, 36, 39, 255],
"tool_panel_background": [255, 255, 255, 255],
"status_offline": [0, 0, 0, 255],
"status_ready": [0, 205, 0, 255],