mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 01:15:55 +08:00
Only get extruder settings from extruder stack - CURA-4482
This commit is contained in:
parent
38fdb5e56f
commit
723f6ce226
@ -398,16 +398,12 @@ class ExtruderManager(QObject):
|
|||||||
# \param setting_key \type{str} The setting to get the property of.
|
# \param setting_key \type{str} The setting to get the property of.
|
||||||
# \param property \type{str} The property to get.
|
# \param property \type{str} The property to get.
|
||||||
# \return \type{List} the list of results
|
# \return \type{List} the list of results
|
||||||
def getAllExtruderSettings(self, setting_key, property):
|
def getAllExtruderSettings(self, setting_key: str, prop: str):
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
|
||||||
if global_container_stack.getProperty("machine_extruder_count", "value") <= 1:
|
|
||||||
return [global_container_stack.getProperty(setting_key, property)]
|
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
for index in self.extruderIds:
|
for index in self.extruderIds:
|
||||||
extruder_stack_id = self.extruderIds[str(index)]
|
extruder_stack_id = self.extruderIds[str(index)]
|
||||||
stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
extruder_stack = ContainerRegistry.getInstance().findContainerStacks(id = extruder_stack_id)[0]
|
||||||
result.append(stack.getProperty(setting_key, property))
|
result.append(extruder_stack.getProperty(setting_key, prop))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
## Gets the extruder stacks that are actually being used at the moment.
|
## Gets the extruder stacks that are actually being used at the moment.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user