Commit graph

993 commits

Author SHA1 Message Date
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
Ghostkeeper
b7213ad020
Don't require material manager any more to find available materials
We have our container tree for that.

Contributes to issue CURA-6600.
2019-08-22 09:25:17 +02:00
Jaime van Kessel
80dd8a0061 Merge branch 'feature_intent_container_tree' of github.com:Ultimaker/Cura into feature_intent_container_tree 2019-08-21 09:43:04 +02:00
Jaime van Kessel
47d082b5dc Fix updating of material models
CURA-6600
2019-08-21 09:42:49 +02:00
ChrisTerBeke
a179d7118d Fix renaming mistake from 1fa5628cb2 2019-08-20 17:17:52 +02:00
Remco Burema
507cb356d2 Remove (all?, most?) deprecated ContainerNode.getMetaDataEntry calls.
part of CURA-6600
2019-08-20 15:38:45 +02:00
Jaime van Kessel
b5d826fab9 Fix deprecation warning
CURA-6600
2019-08-20 14:49:47 +02:00
Ghostkeeper
46b489c3f9
getAvailableMaterialsForMachineExtruder can never return None
So no need to check for it.

Contributes to issue CURA-6600.
2019-08-19 17:32:39 +02:00
Ghostkeeper
5abb03e269
No longer update all material models when favourites change
The MaterialManager.materialsUpdated signal was only called once upon init and for the rest when a favourite was added or removed. So only the FavoriteMaterialsModel would need to listen to it.
Because the MaterialManager is being deprecated, the favourite materials model now just listens to the preferences changing instead, as it was supposed to be doing anyway.

Contributes to issue CURA-6600.
2019-08-19 17:09:16 +02:00
Ghostkeeper
04c53c7190
Fix connecting to metadata changes
Otherwise the number of parameters is wrong.

Contributes to issue CURA-6600.
2019-08-19 16:24:27 +02:00
Ghostkeeper
10dbf3f735
Fix getting GUID from metadata
I keep making this mistake. A donkey may not hit its leg twice on the same stone, but I ain't no ass.

Contributes to issue CURA-6600.
2019-08-19 16:24:00 +02:00
Ghostkeeper
30b2f943fd
Update material node when its metadata changes
This should keep the tree up to date if anything is added, removed or changed in the container registry.

Contributes to issue CURA-6600.
2019-08-19 15:13:19 +02:00
Ghostkeeper
41c573b087
Fix filtering by GUID
Get the correct metadata entry, please.

Contributes to issue CURA-6600.
2019-08-19 15:06:02 +02:00
Ghostkeeper
38937d8ac4
Remove material node when material is deleted
Contributes to issue CURA-6600.
2019-08-19 14:47:08 +02:00
Jaime van Kessel
4ff8991196 Ensure that materials get filtered by diameter again
CURA-6600
2019-08-19 14:10:36 +02:00
Jaime van Kessel
d29b3078b3 Clean up no longer used code
CURA-6600
2019-08-19 13:15:38 +02:00
Jaime van Kessel
fcbfa88d97 Fix creation of new materials
CURA-6600
2019-08-19 13:13:08 +02:00
Jaime van Kessel
88857a7be8 Fix setMaterialName
CURA-6600
2019-08-19 13:06:09 +02:00
Jaime van Kessel
646222f2ac Fix removing of material
CURA-6600
2019-08-19 13:01:05 +02:00
Jaime van Kessel
49e8c8d9d9 Fix the check to see if a material can be removed
CURA-6600
2019-08-19 12:52:31 +02:00
Jaime van Kessel
2417705dfd Prevent crashes when duplicating a material
CURA-6600
2019-08-19 11:42:52 +02:00
Jaime van Kessel
76b58134ae Fix getRootMaterialIdForDiameter
CURA-6600
2019-08-19 11:07:35 +02:00
Jaime van Kessel
4dd5cb1a85 Fix getMaterialByType
CURA-6600
2019-08-19 09:44:39 +02:00
Ghostkeeper
80baeb9873
Remove _added functions for nodes that can't be added during runtime
Among the machines, variants, materials, qualities and intents, only machines and materials can ever be added during runtime. For the rest, we don't need to listen to these signals.

Contributes to issue CURA-6600.
2019-08-16 16:28:42 +02:00
Jaime van Kessel
97e77994a1 Update the removing & duplicating of material
CURA-6600
2019-08-16 10:55:12 +02:00
Jaime van Kessel
8d05ebef9d Fix crash on adding a new printer
CURA-6600
2019-08-16 10:24:50 +02:00
Ghostkeeper
46e5bc897f
Fix deprecated getQualityGroups in QualityManager
It needs to get the actual extruders, not their keys.

Contributes to issue CURA-6600.
2019-08-15 17:01:23 +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
Ghostkeeper
3f944462ed
Use ContainerTree to get quality groups
Contributes to issue CURA-6600.
2019-08-15 17:01:22 +02:00
Ghostkeeper
ed19e9e15c
Use ContainerTree to find quality groups
Contributes to issue CURA-6600.
2019-08-15 17:01:22 +02:00
Ghostkeeper
8a51582210
Pre-fill list of qualities_per_type_per_extruder with empty dicts
Otherwise you get an IndexError later on.

Contributes to issue CURA-6600.
2019-08-15 17:01:21 +02:00
Ghostkeeper
44c98ba0d1
Fix import
Should've checked first...

Contributes to issue CURA-6600.
2019-08-15 17:01:21 +02:00
Ghostkeeper
02fbdd96a4
Don't return quality groups that are not available
And don't return an arbitrary group then. That arbitrary group could also be unavailable.

Contributes to issue CURA-6600.
2019-08-15 17:01:21 +02:00
Ghostkeeper
370d7adcd5
Let getDefaultQualityType use the container tree structure
Contributes to issue CURA-6600.
2019-08-15 17:01:20 +02:00
Ghostkeeper
bee5491879
Move getQualityGroups to MachineNode
It's specific to that machine and the container tree structure, so this is the best place for it we could find.

Contributes to issue CURA-6600.
2019-08-15 17:01:20 +02:00
Ghostkeeper
ca163ea5f0
Skip inactive extruders to determine available quality types
Contributes to issue CURA-6600.
2019-08-15 17:01:20 +02:00
Remco Burema
9374934d72 Merge branch 'feature_intent_container_tree' of https://github.com/Ultimaker/Cura into feature_intent_container_tree 2019-08-15 16:47:29 +02:00
Remco Burema
1609138d4d Remove deprecated ContainerNode.getChildNode(...) calls.
part of CURA-6600
2019-08-15 13:56:41 +02:00
Ghostkeeper
fb509a0692
Fix setting the global quality node
Otherwise you'd get a KeyError there.

Contributes to issue CURA-6600.
2019-08-15 13:41:11 +02:00
Remco Burema
7fb9642e45 Replace deprecated .getContainer() calls with .container
part of CURA-6600
2019-08-15 13:40:08 +02:00
Jaime van Kessel
76729360e1 Remove unused code
CURA-6600
2019-08-15 13:33:17 +02:00
Jaime van Kessel
c0f70c447e Ensure that the materials are loaded again
CURA-6600
2019-08-15 13:32:42 +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
47fe4b4c90
Re-add getMetadata()
We need to deprecate it to not break functionality of old plug-ins and such.

Contributes to issue CURA-6600.
2019-08-13 17:20:59 +02:00
Ghostkeeper
7d1f8e981b
Fix models using new MaterialNode class
The new one doesn't have getMetadata. Maybe we should allow it to have that actually.

Contributes to issue CURA-6600.
2019-08-13 17:20:58 +02:00
Ghostkeeper
5738af4bb8
No longer use deprecated MaterialManager when asking for available materials
Use the ContainerTree structure instead. That's what it's for.

Contributes to issue CURA-6600.
2019-08-13 17:20:58 +02:00
Ghostkeeper
7f84145c9a
Rewrite MaterialManager.getAvailableMaterials to use ContainerTree
Makes it a lot simpler since the nodes in the tree already encoded the fallback mechanism.
However I'm dropping support for filtering by diameter here, since the diameter is not known in the ContainerTree. I'm also dropping support for build plate materials for simplicity and to stay lean.

Contributes to issue CURA-6600.
2019-08-13 17:20:58 +02:00
Ghostkeeper
6a8e1557c3
Merge branch 'feature_intent' into feature_intent_container_tree
Conflicts:
	.gitlab-ci.yml
	cura/Machines/MaterialManager.py
	cura/Machines/VariantManager.py
	cura/Settings/ContainerManager.py
	cura/Settings/MachineManager.py
	tests/TestMachineManager.py
2019-08-13 14:59:05 +02:00
Ghostkeeper
20201c65e6
Merge branch 'master' into feature_intent
Conflicts:
	resources/bundled_packages/cura.json -> 4.1 to 4.2 upgrade package added simultaneously
	tests/TestMachineManager.py -> Due to changes in conftest.py
	tests/conftest.py -> Simultaneously expanding the magic mocks to have some correct properties
2019-08-13 14:43:28 +02:00
Ghostkeeper
8fb0a09460
Remove unused imports
Contributes to issue CURA-6600.
2019-08-13 14:06:42 +02:00