127 Commits

Author SHA1 Message Date
Remco Burema
ec6903d34f Merge branch 'feature_intent_container_tree' of https://github.com/Ultimaker/Cura into feature_intent_container_tree 2019-08-27 17:57:25 +02:00
Remco Burema
745390e51f Fix typing.
part CURA-6600
2019-08-27 17:57:11 +02:00
Ghostkeeper
1874a6453d
Move duplicateMaterial into MaterialManagementModel
To move away from the deprecated MaterialManager class.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +02:00
Ghostkeeper
3dc7c7b61c
Move removeMaterial to MaterialManagementModel
Moving away from the MaterialManager.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
5b8ed91b04
Create new MaterialManagementModel and move canMaterialBeRemoved
Just like the QualityManagementModel, this class is intended to be used as proxy for the material management page in the preferences. I'm intending to move all relevant pyqtSlots from the material manager into this one. The advantage of this switch is that the material manager had no well-bounded scope and so tended to become a big mess of all sorts of functions. This one has a clear scope: serve as a proxy for the buttons you can press in the preferences screen for materials.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
37bd7c6b0e
Always return a MaterialNode from getDefaultMaterial
Its function is, after all, to find the default. It should always have a default. Sometimes that will be the empty material, but so be it.

Contributes to issue CURA-6600.
2019-08-22 17:13:46 +02:00
Ghostkeeper
81a33af3aa
Use variant node's preferredMaterial function from MaterialManager too
We can reuse that code.

Contributes to issue CURA-6600.
2019-08-22 15:46:29 +02:00
Ghostkeeper
7b83e51439
Use container tree to determine default material
Using the new architecture here.

Contributes to issue CURA-6600.
2019-08-22 15:04:20 +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
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
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
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
Jaime van Kessel
97e77994a1 Update the removing & duplicating of material
CURA-6600
2019-08-16 10:55:12 +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
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
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
8fb0a09460
Remove unused imports
Contributes to issue CURA-6600.
2019-08-13 14:06:42 +02:00
Ghostkeeper
01eaaf045d
Remove initialisation of tree in material manager
This is now all contained in the ContainerTree code.

Contributes to issue CURA-6600.
2019-08-13 14:04:57 +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
8d6136bcf3
Don't crash when materials are not registered
It can't update the nodes structure with the links between materials then.

Contributes to issue CURA-6444.
2019-05-01 13:14:40 +02:00
Ghostkeeper
c79ffab9fb
Merge branch '4.0' 2019-03-18 11:24:23 +01:00
Jaime van Kessel
1138baa26f Added extra tests for materialManager 2019-03-15 13:57:22 +01:00
Jaime van Kessel
8b3290fb1e Prevent the deletion of materials that are still active 2019-03-14 10:50:53 +01:00
Ghostkeeper
1d25f52df6
Merge branch '4.0' 2019-03-06 15:23:55 +01:00
Jaime van Kessel
2af3ae8efb Ensure that the materials get removed in order
If we remove the materials in order, it doesn't cause any issues. This is probably because
loading the base profile causes the others to be properly instantiated (and subsequently deleted)

CURA-6237
2019-03-01 10:53:55 +01:00
Lipu Fei
7291026bec Fix material container removal
CURA-6237
2019-02-22 15:13:53 +01:00
Ghostkeeper
6e883c0431
Use default parameter of getMetaDataEntry
We don't need to do that manually.
2019-02-14 13:33:01 +01:00
Jaime van Kessel
d928e0979d Handle attempting to remove a favorite material that was already removed 2019-01-09 12:54:33 +01:00
Lipu Fei
d93e19d530 Add getAllMaterialGroups()
CURA-6035
2018-12-20 10:45:05 +01:00
Diego Prado Gesto
3ab8568a87
Merge pull request #4679 from fieldOfView/fix_create_new_material
Use preferred material instead of generic PLA when creating a new material
2018-11-08 17:16:36 +01:00
Lipu Fei
9c9e81b30c Move InstanceContainer import into type checking closure
CURA-5898
2018-11-06 11:04:18 +01:00
Jaime van Kessel
412e5977a6 Fix type issues 2018-11-05 11:30:02 +01:00
Jaime van Kessel
eded0f0297 Make quality manager also include profiles with same GUID in fallback.
This ensures that if a (duplicated) material does not have a generic variant, that
the material it was copied from will be added to the fallback list.

CURA-5898
2018-11-05 11:17:39 +01:00
fieldOfView
7899b249fc Use preferred material instead of generic PLA when creating a new material 2018-10-28 12:12:14 +01:00
Remco Burema
fb9d85557e Missed one of the getCompatibleMaterialDiameter typo's in the previous commit.
part of [CURA-5834]
2018-10-23 13:57:42 +02:00
Lipu Fei
97e6354c13 Fix material update upon extruder-compatible diameter change
CURA-5834

Material models and the material container on an extruder need to be
updated when the extruder's compatible diameter gets changes.
2018-10-19 13:48:52 +02:00
Jaime van Kessel
7310a677ce Clean up more code
This fixes some typing and moves a property to protected, as it should be
2018-09-27 16:07:18 +02:00