mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 08:17:49 -06:00
Replaced hack for setting extruders with more robust setter
CURA-1263
This commit is contained in:
parent
b175e6876f
commit
053f0ca031
3 changed files with 17 additions and 5 deletions
|
@ -150,6 +150,18 @@ class ExtruderManager(QObject):
|
||||||
if changed:
|
if changed:
|
||||||
self.extrudersChanged.emit(machine_id)
|
self.extrudersChanged.emit(machine_id)
|
||||||
|
|
||||||
|
def registerExtruder(self, extruder_train, machine_id):
|
||||||
|
changed = False
|
||||||
|
|
||||||
|
if machine_id not in self._extruder_trains:
|
||||||
|
self._extruder_trains[machine_id] = {}
|
||||||
|
changed = True
|
||||||
|
if extruder_train:
|
||||||
|
self._extruder_trains[machine_id][extruder_train.getMetaDataEntry("position")] = extruder_train
|
||||||
|
changed = True
|
||||||
|
if changed:
|
||||||
|
self.extrudersChanged.emit(machine_id)
|
||||||
|
|
||||||
## Creates a container stack for an extruder train.
|
## Creates a container stack for an extruder train.
|
||||||
#
|
#
|
||||||
# The container stack has an extruder definition at the bottom, which is
|
# The container stack has an extruder definition at the bottom, which is
|
||||||
|
|
|
@ -301,11 +301,11 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
quality_changes_index = stack.getContainerIndex(old_container)
|
quality_changes_index = stack.getContainerIndex(old_container)
|
||||||
stack.replaceContainer(quality_changes_index, container)
|
stack.replaceContainer(quality_changes_index, container)
|
||||||
|
|
||||||
# TODO: This is nasty hack; this should be made way more robust (setter?)
|
|
||||||
if global_stack.getId() not in ExtruderManager.getInstance()._extruder_trains:
|
|
||||||
ExtruderManager.getInstance()._extruder_trains[global_stack.getId()] = {}
|
|
||||||
for stack in extruder_stacks:
|
for stack in extruder_stacks:
|
||||||
ExtruderManager.getInstance()._extruder_trains[global_stack.getId()][stack.getMetaDataEntry("position")] = stack
|
ExtruderManager.getInstance().registerExtruder(stack, global_stack.getId())
|
||||||
|
else:
|
||||||
|
# Machine has no extruders, but it needs to be registered with the extruder manager.
|
||||||
|
ExtruderManager.getInstance().registerExtruder(None, global_stack.getId())
|
||||||
|
|
||||||
Logger.log("d", "Workspace loading is notifying rest of the code of changes...")
|
Logger.log("d", "Workspace loading is notifying rest of the code of changes...")
|
||||||
# Notify everything/one that is to notify about changes.
|
# Notify everything/one that is to notify about changes.
|
||||||
|
|
|
@ -128,7 +128,7 @@ UM.Dialog
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: visible ? 25 : 0
|
height: visible ? 25 : 0
|
||||||
text: catalog.i18nc("@info:tooltip", "How should the conflict in the material(s) be resolved?")
|
text: catalog.i18nc("@info:tooltip", "How should the conflict in the material(s) be resolved?")
|
||||||
visible: false #manager.materialConflict
|
visible: false //manager.materialConflict
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue