Switch to the first enabled extruder after setActiveMachine

CURA-5930
This commit is contained in:
Lipu Fei 2019-04-05 10:51:06 +02:00
parent 6892307be3
commit 3adf7d49d0

View file

@ -362,7 +362,6 @@ class MachineManager(QObject):
# Mark global stack as invalid
ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId())
return # We're done here
ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder
self._global_container_stack = global_stack
self._application.setGlobalContainerStack(global_stack)
@ -370,6 +369,11 @@ class MachineManager(QObject):
self._initMachineState(global_stack)
self._onGlobalContainerChanged()
# Switch to the first enabled extruder
self.updateDefaultExtruder()
default_extruder_position = int(self.defaultExtruderPosition)
ExtruderManager.getInstance().setActiveExtruderIndex(default_extruder_position)
self.__emitChangedSignals()
## Given a definition id, return the machine with this id.