Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cura
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2016-10-28 16:18:10 +0300
committerGhostkeeper <rubend@tutanota.com>2016-10-28 16:20:13 +0300
commitd5ba89a026178fb87a38a59d2d0023c0ddb2b393 (patch)
tree2863eb24cfca32db327d1016e1bf5e4feaa2e727 /cura
parent78ab1f1a71c08f5fc51f2f2c0b055e1fc309466e (diff)
Add function to get other properties than values from all extruders
I've made sure that the behaviour of getAllExtruderValues remains the same, so that this function may still be used by other pieces of code. It is now just a special case of getAllExtruderSettings. Please suggest a better naming scheme, if you like. Contributes to issue CURA-2823.
Diffstat (limited to 'cura')
-rw-r--r--cura/Settings/ExtruderManager.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py
index 0236f158aa..b127f6575d 100644
--- a/cura/Settings/ExtruderManager.py
+++ b/cura/Settings/ExtruderManager.py
@@ -268,18 +268,22 @@ class ExtruderManager(QObject):
container_registry.addContainer(container_stack)
def getAllExtruderValues(self, setting_key):
+ return self.getAllExtruderSettings(setting_key, "value")
+
+ ## Gets a
+ def getAllExtruderSettings(self, setting_key, property):
global_container_stack = UM.Application.getInstance().getGlobalContainerStack()
- multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
- if not multi_extrusion:
- return [global_container_stack.getProperty(setting_key, "value")]
+ if global_container_stack.getProperty("machine_extruder_count", "value") <= 1:
+ return [global_container_stack.getProperty(setting_key, property)]
result = []
for index in self.extruderIds:
extruder_stack_id = self.extruderIds[str(index)]
- stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id=extruder_stack_id)[0]
- result.append(stack.getProperty(setting_key, "value"))
+ stack = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
+ result.append(stack.getProperty(setting_key, property))
return result
+
## Removes the container stack and user profile for the extruders for a specific machine.
#
# \param machine_id The machine to remove the extruders for.