mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:29:03 +08:00
Make name of extruder a property
This stores the name for later use, for instance when displaying the extruder. Contributes to issues CURA-1278 and CURA-351.
This commit is contained in:
parent
8a8de95969
commit
25a6a99286
@ -25,8 +25,8 @@ class Extruder:
|
||||
self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = self._definition.getId())
|
||||
|
||||
#Create a container stack for this extruder.
|
||||
name = self._uniqueName(self._definition.getId())
|
||||
self._container_stack = UM.Settings.ContainerStack(name)
|
||||
self._name = self._uniqueName(self._definition.getId())
|
||||
self._container_stack = UM.Settings.ContainerStack(self._name)
|
||||
self._container_stack.addMetaDataEntry("type", "extruder_train")
|
||||
self._container_stack.addContainer(self._definition)
|
||||
|
||||
@ -73,15 +73,16 @@ class Extruder:
|
||||
self._container_stack.addContainer(self._quality)
|
||||
|
||||
#Add an empty user profile.
|
||||
self._user_profile = UM.Settings.InstanceContainer(name + "_current_settings")
|
||||
self._user_profile = UM.Settings.InstanceContainer(self._name + "_current_settings")
|
||||
self._user_profile.addMetaDataEntry("type", "user")
|
||||
self._container_stack.addContainer(self._user_profile)
|
||||
|
||||
self._container_stack.setNextStack(UM.Application.getInstance().getGlobalContainerStack())
|
||||
|
||||
nozzle_changed = UM.Signal.Signal()
|
||||
material_changed = UM.Signal.Signal()
|
||||
quality_changed = UM.Signal.Signal()
|
||||
material_changed = UM.Signal()
|
||||
name_changed = UM.Signal()
|
||||
nozzle_changed = UM.Signal()
|
||||
quality_changed = UM.Signal()
|
||||
|
||||
## Gets the currently active material on this extruder.
|
||||
#
|
||||
@ -104,6 +105,19 @@ class Extruder:
|
||||
self._material = value
|
||||
self.material_changed.emit()
|
||||
|
||||
## Gets the name of this extruder.
|
||||
#
|
||||
# \return The name of this extruder.
|
||||
@property
|
||||
def name(self):
|
||||
return self._name
|
||||
|
||||
## Changes the name of this extruder.
|
||||
@name.setter
|
||||
def name(self, value):
|
||||
self._name = value
|
||||
self.name_changed.emit()
|
||||
|
||||
## Gets the currently active nozzle on this extruder.
|
||||
#
|
||||
# \return The currently active nozzle on this extruder.
|
||||
|
Loading…
x
Reference in New Issue
Block a user