mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
Fix skipping definition containers when adding new printers
The speed improvement didn't work. It still doesn't seem to have a lot of effect. Maybe it's not the creating of the tree that causes this slowdown? Contributes to issue CURA-6600.
This commit is contained in:
parent
be36ae278b
commit
16ee96def9
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,7 @@ from UM.Settings.Interfaces import ContainerInterface
|
|||
from UM.Signal import Signal
|
||||
import cura.CuraApplication # Imported like this to prevent circular dependencies.
|
||||
from cura.Machines.MachineNode import MachineNode
|
||||
from cura.Settings.GlobalStack import GlobalStack # To listen only to global stacks being added.
|
||||
from cura.Settings.ExtruderStack import ExtruderStack # To skip extruder stacks being added.
|
||||
|
||||
from typing import Dict, TYPE_CHECKING
|
||||
import time
|
||||
|
@ -64,7 +64,7 @@ class ContainerTree:
|
|||
start_time = time.time()
|
||||
all_stacks = ContainerRegistry.getInstance().findContainerStacks()
|
||||
for stack in all_stacks:
|
||||
if not isinstance(stack, GlobalStack):
|
||||
if isinstance(stack, ExtruderStack):
|
||||
continue # Only want to load global stacks. We don't need to create a tree for extruder definitions.
|
||||
definition_id = stack.definition.getId()
|
||||
if definition_id not in self.machines:
|
||||
|
@ -77,6 +77,8 @@ class ContainerTree:
|
|||
def _machineAdded(self, definition_container: ContainerInterface):
|
||||
if not isinstance(definition_container, DefinitionContainer):
|
||||
return # Not our concern.
|
||||
if definition_container.getMetaDataEntry("position") is not None:
|
||||
return # This is an extruder definition. Not our concern.
|
||||
definition_id = definition_container.getId()
|
||||
if definition_id in self.machines:
|
||||
return # Already have this definition ID.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue