mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-02 15:21:15 -07:00
Add some profiling decorators to the ContainerTree
This commit is contained in:
parent
71e9fb8a22
commit
85ed22de4c
6 changed files with 15 additions and 3 deletions
|
|
@ -11,11 +11,13 @@ from cura.Settings.GlobalStack import GlobalStack # To listen only to global st
|
|||
|
||||
from typing import Dict, List, TYPE_CHECKING
|
||||
import time
|
||||
import UM.FlameProfiler
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from cura.Machines.QualityGroup import QualityGroup
|
||||
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
||||
|
||||
|
||||
## This class contains a look-up tree for which containers are available at
|
||||
# which stages of configuration.
|
||||
#
|
||||
|
|
@ -77,6 +79,7 @@ class ContainerTree:
|
|||
# Add a machine node by the id of it's definition.
|
||||
# This is automatically called by the _machineAdded function, but it's sometimes needed to add a machine node
|
||||
# faster than would have been done when waiting on any signals (for instance; when creating an entirely new machine)
|
||||
@UM.FlameProfiler.profile
|
||||
def addMachineNodeByDefinitionId(self, definition_id: str) -> None:
|
||||
if definition_id in self.machines:
|
||||
return # Already have this definition ID.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue