mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
Add time logging about how long it took to construct the container tree
CURA-6600
This commit is contained in:
parent
47fe4b4c90
commit
6a3a23a725
1 changed files with 4 additions and 1 deletions
|
@ -8,7 +8,7 @@ from UM.Settings.Interfaces import ContainerInterface
|
|||
from cura.Machines.MachineNode import MachineNode
|
||||
|
||||
from typing import Dict
|
||||
|
||||
import time
|
||||
## This class contains a look-up tree for which containers are available at
|
||||
# which stages of configuration.
|
||||
#
|
||||
|
@ -32,12 +32,15 @@ class ContainerTree:
|
|||
## Builds the initial container tree.
|
||||
def _loadAll(self):
|
||||
Logger.log("i", "Building container tree.")
|
||||
start_time = time.time()
|
||||
all_stacks = ContainerRegistry.getInstance().findContainerStacks()
|
||||
for stack in all_stacks:
|
||||
definition_id = stack.definition.getId()
|
||||
if definition_id not in self.machines:
|
||||
self.machines[definition_id] = MachineNode(definition_id)
|
||||
|
||||
Logger.log("d", "Building the container tree took %s seconds", time.time() - start_time)
|
||||
|
||||
## When a printer gets added, we need to build up the tree for that container.
|
||||
def _machineAdded(self, definition_container: ContainerInterface):
|
||||
if not isinstance(definition_container, DefinitionContainer):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue