mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Document activeExtruderStackId
Contributes to issues CURA-340, CURA-351 and CURA-1278.
This commit is contained in:
parent
70e6c8093e
commit
7950dfaa07
1 changed files with 8 additions and 2 deletions
|
@ -49,13 +49,19 @@ class ExtruderManager(QObject):
|
|||
def __iter__(self):
|
||||
return iter(self._extruders)
|
||||
|
||||
## Gets the unique identifier of the currently active extruder stack.
|
||||
#
|
||||
# The currently active extruder stack is the stack that is currently being
|
||||
# edited.
|
||||
#
|
||||
# \return The unique ID of the currently active extruder stack.
|
||||
@pyqtProperty(str, notify = activeExtruderChanged)
|
||||
def activeExtruderStackId(self):
|
||||
if not UM.Application.getInstance().getGlobalContainerStack():
|
||||
return None #Whatta ya gonna do?
|
||||
return None #No active machine, so no active extruder.
|
||||
try:
|
||||
return self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][str(self._active_extruder_index)]
|
||||
except KeyError:
|
||||
except KeyError: #Extruder index could be -1 if the global tab is selected, or the entry doesn't exist if the machine definition is wrong.
|
||||
return None
|
||||
|
||||
@pyqtSlot(int)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue