23 Commits

Author SHA1 Message Date
Jaime van Kessel
85ed22de4c
Add some profiling decorators to the ContainerTree 2019-10-04 13:29:22 +02:00
Ghostkeeper
c8be172343
Add debugging functionality to visualise the container tree
Could be useful for later, don't you think?

Contributes to issue CURA-6831.
2019-10-02 08:55:12 +02:00
Jaime van Kessel
7e3f265068
Add a function to add a MachineNode to the tree.
This solves the issue that machines created by the stack builder broke the material updating

CURA-6791
2019-09-23 13:18:11 +02:00
Ghostkeeper
5debdd4cf6
Fix getting extruder list everywhere
Didn't test this beyond my own automated test, it seems.

Contributes to issue CURA-6600.
2019-09-09 16:47:29 +02:00
Ghostkeeper
8bcd9b339a
Use GlobalStack.extrudersList instead of GlobalStack.extruders to iterate
Otherwise the iteration can happen in any arbitrary order (due to the dict) and this can cause the result to not match to the desired combination of configurations per extruder.

Contributes to issue CURA-6600.
2019-09-06 17:20:03 +02:00
Ghostkeeper
4bdc819f12
Fix nondetermistic result with dictionary values list
Because global_stack.extruders.values can be returned in any order, the configurations matching with the lists doesn't always give a result.
It happened to work on my computer with the test, but there is no guarantee of that.

This is probably also going wrong in other places. I don't think we should use the .extruders property anywhere really!

Contributes to issue CURA-6600.
2019-09-06 17:15:45 +02:00
Ghostkeeper
3f5563514c
Remove _current_quality_changes_group shadow administration
Get the quality changes group back from whichever one is actually active on the stack. This prevents the two from getting out of sync, which makes the code easier to maintain.

Contributes to issue CURA-6600.
2019-08-27 13:03:29 +02:00
Ghostkeeper
557c3d9515
Skip global stacks better
Otherwise it wouldn't skip custom-defined stacks, such as the PPA's stack class.

Contributes to issue CURA-6600.
2019-08-26 17:11:22 +02:00
Ghostkeeper
60939d220b
Log time it takes to add container tree for a printer
It's useful to know, at least while we're building this.

Contributes to issue CURA-6600.
2019-08-26 16:58:13 +02:00
Ghostkeeper
16ee96def9
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.
2019-08-26 16:30:16 +02:00
Ghostkeeper
01c0472872
Don't create container tree for extruder definitions
That wouldn't work properly anyway, but it still took quite a lot of time to create these.

Contributes to issue CURA-6600.
2019-08-26 15:49:52 +02:00
Ghostkeeper
d06ce211ff
Document new requirement that there must always be one child
Contributes to issue CURA-6600.
2019-08-22 16:47:57 +02:00
Ghostkeeper
6c6dd0efad
Add signals to signal that a material got changed or removed
The material models need to know this.

Contributes to issue CURA-6600.
2019-08-22 09:25:25 +02:00
Jaime van Kessel
8d05ebef9d Fix crash on adding a new printer
CURA-6600
2019-08-16 10:24:50 +02:00
Ghostkeeper
d4cd5a7ea5
Add convenience function to get quality groups for current printer
This is used very often all over the code.

Contributes to issue CURA-6600.
2019-08-15 17:01:22 +02:00
Jaime van Kessel
6a3a23a725 Add time logging about how long it took to construct the container tree
CURA-6600
2019-08-15 13:11:45 +02:00
Ghostkeeper
bd714f947a
Register container tree to be built once all metadata is in
So if we ever change the order of initialisation this stays working.

Contributes to issue CURA-6600.
2019-08-09 13:40:11 +02:00
Ghostkeeper
e106692165
Make ContainerTree singleton but construct in run() of application
We want to make sure that this tree is constructed during start-up after all containers have been registered, so we call getInstance() there once. If you need the tree before that, the tree will not yet have been filled and you won't get complete information, so you'd need to listen for updates.
The singleton is there so you don't need to go via CuraApplication.

Contributes to issue CURA-6600.
2019-08-08 17:30:24 +02:00
Ghostkeeper
8e49991087
Resolve circular imports
Some of these are only used for the type checks.

Contributes to issue CURA-6600.
2019-08-06 17:04:29 +02:00
Ghostkeeper
65b1a43e88
Load tree when all metadata has been loaded
This should build up the tree initially.

Contributes to issue CURA-6600.
2019-08-06 09:16:41 +02:00
Ghostkeeper
2565be01f3
Add variants as they get added to the registry
Contributes to issue CURA-6600.
2019-08-06 08:58:34 +02:00
Ghostkeeper
e84a75094a
Add a MachineNode once a definition for it gets loaded
This means that we've added this machine. We need to pre-load all of the containers for that printer then.

Contributes to issue CURA-6600.
2019-08-05 17:49:21 +02:00
Ghostkeeper
9fda7bd0b9
Rework container tree structure
This sets up a few new classes, subclasses of ContainerNode.

This is intended to simplify the current structure in the QualityManager.

Contributes to issue CURA-6600.
2019-08-05 17:39:19 +02:00