mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
Add iteration over extruder manager
This iteration iterates over the extruders. Contributes to issues CURA-1278 and CURA-351.
This commit is contained in:
parent
8369316236
commit
8a8de95969
1 changed files with 7 additions and 0 deletions
|
@ -24,6 +24,7 @@ class ExtruderManager:
|
|||
def __init__(self):
|
||||
self._extruders = [] #Extruders for the current machine.
|
||||
self._global_container_stack = None
|
||||
self._next_item = 0 #For when you use this class as iterator.
|
||||
|
||||
UM.Application.getInstance().globalContainerStackChanged.connect(self._reconnectExtruderReload) #When the current machine changes, we need to reload all extruders belonging to the new machine.
|
||||
|
||||
|
@ -37,6 +38,12 @@ class ExtruderManager:
|
|||
cls.__instance = ExtruderManager()
|
||||
return cls.__instance
|
||||
|
||||
## Creates an iterator over the extruders in this manager.
|
||||
#
|
||||
# \return An iterator over the extruders in this manager.
|
||||
def __iter__(self):
|
||||
return iter(self._extruders)
|
||||
|
||||
## When the global container stack changes, this reconnects to the new
|
||||
# signal for containers changing.
|
||||
def _reconnectExtruderReload(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue