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:
Ghostkeeper 2016-06-02 13:24:53 +02:00
parent 25a6a99286
commit df363a024a
No known key found for this signature in database
GPG Key ID: 701948C5954A7385

View File

@ -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.