20151 Commits

Author SHA1 Message Date
Ghostkeeper
fff26bb021
Fix imports and references to managers
Use getInstance() where applicable.

Contributes to issue CURA-6600.
2019-08-12 14:15:40 +02:00
Ghostkeeper
91e14a90b2
Update getQualityGroups to use the new ContainerTree structure
Look how greatly this is now simplified.
The fallbacks for which material nodes to check is not yet implemented. Will do that next.

Contributes to issue CURA-6600.
2019-08-12 14:02:19 +02:00
Ghostkeeper
80e27b62d3
Don't cache singletons in constructor
It makes it harder to test these things.

Contributes to issue CURA-6600.
2019-08-09 15:53:08 +02:00
Ghostkeeper
709584cc5e
No longer listen to qualitiesChanged signal to update
It was only being called once upon initialisation. Turns out that this model updates itself properly only because the qualities don't change during runtime unless you change the active quality group (due to materials changing) or the printer itself.

Contributes to issue CURA-6600.
2019-08-09 15:14:52 +02:00
Ghostkeeper
9ed4713cde
Don't cache singletons in fields
This makes it harder to test these things and harder to make it perform well with lazy initialisation.

Contributes to issue CURA-6600.
2019-08-09 14:34:45 +02:00
Ghostkeeper
595b0113b3
Don't link materialsChanged signal to update in MachineManager
The materialsChanged signal only gets called when the favourites are changed, so these updates are all completely unnecessary since they just make sure that the names and such of the materials are up to date.

Contributes to issue CURA-6600.
2019-08-09 14:25:44 +02:00
Ghostkeeper
f65e672887
Don't get build plate variants from tree any more
It's not in that tree.

Contributes to issue CURA-6600.
2019-08-09 13:43:54 +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
d710a58233
Don't require VariantManager any more from CuraStackBuilder
We now use the new container tree structure there.

Contributes to issue CURA-6600.
2019-08-08 17:31:26 +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
65360c31ef
Let Quality/Material/Variant Managers be a proper singleton
Rather than a singleton contained within the CuraApplication class.

Contributes to issue CURA-6600.
2019-08-08 17:04:53 +02:00
Ghostkeeper
f31d7798ce
Add warning for adding local copies of metadata
Contributes to issue CURA-6600.
2019-08-08 16:26:38 +02:00
Jaime van Kessel
e2596e64ef Add tests for quality node 2019-08-08 14:11:00 +02:00
Jaime van Kessel
c26d113002 Add test for the MaterialNode
CURA-6600
2019-08-08 13:52:45 +02:00
Jaime van Kessel
a8fbb80b09 Add tests for the updating of MaterialNodes in the variant node
CURA-6600
2019-08-08 10:46:24 +02:00
Jaime van Kessel
476c7b683d Extend variant node test to also test the material added case
CURA-6600
2019-08-07 17:23:12 +02:00
Jaime van Kessel
2683c31975 Add initial tests for variantNode
CURA-6600
2019-08-07 17:04:39 +02:00
Jaime van Kessel
6e5b0bb609 Fix the filtering of materials based on exclude_materials
CURA-6600
2019-08-07 17:03:41 +02:00
Jaime van Kessel
fa077038fc Add tests for the MachineNode 2019-08-07 16:17:46 +02:00
Jaime van Kessel
a241425aaf Add test for ContainerTree
CURA-6600
2019-08-07 15:35:22 +02:00
Ghostkeeper
accc4ccd21
Only remove excluded materials that were added
Contributes to issue CURA-6600.
2019-08-07 09:50:53 +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
b05784e607
Remove subprofiles from intent nodes
As the documentation says, it has no subprofiles any more.

Contributes to issue CURA-6600.
2019-08-06 16:49:06 +02:00
Ghostkeeper
a0d3cb6742
Make QualityNode part of our normal tree structure
It now constructs itself and its contents automatically. No need for a QualityManager to keep it up to date any more.

Contributes to issue CURA-6600.
2019-08-06 16:46:28 +02:00
Ghostkeeper
8ec1c31b58
Don't make parent a common property
Instead we use properly-typed and appropriately-named variables in each of the sub classes.

Contributes to issue CURA-6600.
2019-08-06 16:31:57 +02:00
Ghostkeeper
d3dc36c187
Find quality nodes as subnodes of material nodes
Similar to the materials and variants.

Contributes to issue CURA-6600.
2019-08-06 16:19:30 +02:00
Ghostkeeper
24346fc8e3
Don't add materials forbidden by the printer definition
Contributes to issue CURA-6600.
2019-08-06 15:21:52 +02:00
Ghostkeeper
3ef0b4292d
Only add variants that fit on my machine
Contributes to issue CURA-6600.
2019-08-06 15:15:02 +02:00
Ghostkeeper
bc3300baa8
Assume that the tree is always constructed after metadata has been loaded
Safe assumption, since the tree can only start constructing after the stacks are loaded.

Contributes to issue CURA-6600.
2019-08-06 15:13:29 +02:00
Ghostkeeper
b46d4eb2b5
Have variant nodes build their own children
When a variant and a variant love each other...

Contributes to issue CURA-6600.
2019-08-06 15:11:16 +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
Ghostkeeper
037f1967c8
Remove override for version number in CuraContainerStack
Otherwise plug-ins can't register ContainerStacks any more.

As discussed in the CCB.
2019-07-10 14:57:26 +02:00
Lipu Fei
9c3d65a6c7
Merge pull request #5993 from Ultimaker/feature_intent_model_per_category
Create an intent model per intent category
2019-07-09 13:12:02 +02:00
Lipu Fei
4e0b9d7b78 Fix typing
CURA-6597
2019-07-09 13:02:01 +02:00
Lipu Fei
8863516aa4 Rename function name and fix tests
CURA-6597
2019-07-09 12:53:44 +02:00
Lipu Fei
f086c1eb11 Minor cleanup changes
CURA-6597
2019-07-09 11:57:46 +02:00
Lipu Fei
659a276f65 Rename signal
CURA-6597
2019-07-09 11:29:27 +02:00
Lipu Fei
ec82d8f58d Fix merge conflicts
CURA-6597
2019-07-09 11:01:51 +02:00
Ghostkeeper
e2fd90506a
Include intent profiles from the default intents
If we have the default intent category, list all quality types available.

Contributes to issue CURA-6597.
2019-07-09 10:56:21 +02:00
Ghostkeeper
86750c0446
Don't continue after returning empty list
Oops. Shouldn't have pushed...

Contributes to issue CURA-6597.
2019-07-09 10:54:47 +02:00
Ghostkeeper
07c5c4d9f0
Return empty model if there is no printer added yet
Contributes to issue CURA-6597.
2019-07-09 10:26:49 +02:00
Ghostkeeper
28f1e670f5
Give special values to the intents
This way we can see if the correct profile actually got loaded.

Contributes to issue CURA-6597.
2019-07-05 14:20:36 +02:00
Ghostkeeper
3729e90b24
Fix getting original intent category
It's now a property so it doesn't need the brackets.

Contributes to issue CURA-6597.
2019-07-05 13:06:27 +02:00
Ghostkeeper
8cea9c5b87
Register IntentManager in QML
This way we can change the intent from the interface.

Contributes to issue CURA-6597.
2019-07-05 13:03:20 +02:00
Ghostkeeper
9aeea22c73
Disable intent category headers
Makes 'em look like headers.

Contributes to issue CURA-6597.
2019-07-05 12:05:44 +02:00
Ghostkeeper
32c5118ae4
Add intents per category to the intent menu
They are in the wrong order currently. The section headers all appear at the end and they are not greyed out. This must be fixed. The order might prove difficult... We'll see, but I want this locked in now because it works.

Contributes to issue CURA-6597.
2019-07-05 11:45:01 +02:00
Ghostkeeper
45cb34c3e4
Refresh list of intents upon changing category
The category is changed after constructing by the QML code in order to set its property.
This is now updating twice: Once for the default category and once for the final one set by QML. This is a bit inefficient. But make it work before optimising it!

Contributes to issue CURA-6597.
2019-07-05 11:19:16 +02:00