Correctly update the quality profiles in the extruders when changing quality changes, taking the different materials into account.

Contributes to CURA-2320 Filtering Quality-Changes profiles on material?
This commit is contained in:
Simon Edwards 2016-09-27 13:59:27 +02:00
parent fc69b110f3
commit 4bb6ddaf28
3 changed files with 118 additions and 85 deletions

View file

@ -303,19 +303,25 @@ class ExtruderManager(QObject):
for name in self._extruder_trains[machine_id]:
yield self._extruder_trains[machine_id][name]
## Returns a generator that will iterate over the global stack and per-extruder stacks.
## Returns a list containing the global stack and active extruder stacks.
#
# The first generated element is the global container stack. After that any extruder stacks are generated.
# The first element is the global container stack, followed by any extruder stacks.
# \return \type{List[ContainerStack]}
def getActiveGlobalAndExtruderStacks(self):
global_stack = UM.Application.getInstance().getGlobalContainerStack()
if not global_stack:
return
return None
yield global_stack
result = [global_stack]
result.extend(self.getActiveExtruderStacks())
return result
global_id = global_stack.getId()
for name in self._extruder_trains[global_id]:
yield self._extruder_trains[global_id][name]
## Returns the list of active extruder stacks.
#
# \return \type{List[ContainerStack]} a list of
def getActiveExtruderStacks(self):
global_stack = UM.Application.getInstance().getGlobalContainerStack()
return list(self._extruder_trains[global_stack.getId()].values()) if global_stack else []
def __globalContainerStackChanged(self):
self._addCurrentMachineExtruders()