CURA-4680 Checking if there is global stack in the ExtruderManager.

Intead of checking for it in all the methods in MachineManager, now the
check is done in ExtruderManager when there is no printer in the list.
This commit is contained in:
Diego Prado Gesto 2017-12-06 14:12:51 +01:00
parent c0a502f99c
commit 9561827bda
2 changed files with 5 additions and 22 deletions

View file

@ -356,14 +356,16 @@ class ExtruderManager(QObject):
# \return \type{List[ContainerStack]} a list of
def getActiveExtruderStacks(self) -> List["ExtruderStack"]:
global_stack = Application.getInstance().getGlobalContainerStack()
if not global_stack:
return None
result = []
machine_extruder_count = global_stack.getProperty("machine_extruder_count", "value")
if global_stack and global_stack.getId() in self._extruder_trains:
if global_stack.getId() in self._extruder_trains:
for extruder in sorted(self._extruder_trains[global_stack.getId()]):
result.append(self._extruder_trains[global_stack.getId()][extruder])
machine_extruder_count = global_stack.getProperty("machine_extruder_count", "value")
return result[:machine_extruder_count]
def __globalContainerStackChanged(self) -> None: