mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 20:19:32 +08:00
Expose definition container of extruders
This contains important metadata which we'll need. It's also more consistent with the rest. Contributes to issues CURA-1278 and CURA-351.
This commit is contained in:
parent
25a6a99286
commit
df363a024a
@ -79,11 +79,33 @@ class Extruder:
|
||||
|
||||
self._container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
|
||||
definition_changed = UM.Signal()
|
||||
material_changed = UM.Signal()
|
||||
name_changed = UM.Signal()
|
||||
nozzle_changed = UM.Signal()
|
||||
quality_changed = UM.Signal()
|
||||
|
||||
## Gets the definition container of this extruder.
|
||||
#
|
||||
# \return The definition container of this extruder.
|
||||
@property
|
||||
def definition(self):
|
||||
return self._definition
|
||||
|
||||
## Changes the definition container of this extruder.
|
||||
#
|
||||
# \param value The new definition for this extruder.
|
||||
@definition.setter
|
||||
def definition(self, value):
|
||||
try:
|
||||
position = self._container_stack.index(self._definition)
|
||||
except ValueError: #Definition is not in the list. Big trouble!
|
||||
UM.Logger.log("e", "I've lost my old extruder definition, so I can't find where to insert the new definition.")
|
||||
return
|
||||
self._container_stack.replaceContainer(position, value)
|
||||
self._definition = value
|
||||
self.definition_changed.emit()
|
||||
|
||||
## Gets the currently active material on this extruder.
|
||||
#
|
||||
# \return The currently active material on this extruder.
|
||||
|
Loading…
x
Reference in New Issue
Block a user