472 Commits

Author SHA1 Message Date
Ghostkeeper
a7e5830762
Fix case if containers are None
This happens when the number of containers was resized.

Contributes to issue CURA-6600.
2019-08-28 16:50:14 +02:00
Ghostkeeper
5d8fff69e4
Fix referencing nodes for quality changes
Contributes to issue CURA-6600.
2019-08-28 16:32:20 +02:00
Ghostkeeper
5fadc7019d
Move renameQualityChangesGroup to QualityManagementModel
Contributes to issue CURA-6600.
2019-08-28 16:31:50 +02:00
Ghostkeeper
b3fd310d37
Move removeQualityChangesGroup to QualityManagementModel
This is an operation specific to the quality management page, so it should be located there.

Contributes to issue CURA-6600.
2019-08-28 15:21:33 +02:00
Ghostkeeper
7c90b5dd30
Use shortcut to get current quality changes groups
Contributes to issue CURA-6600.
2019-08-28 13:56:37 +02:00
Ghostkeeper
c9191beb61
Fix updating intents list when printer changes
Contributes to issue CURA-6600.
2019-08-28 11:11:13 +02:00
Ghostkeeper
64a8aff627
Remove usage of deprecated getContainer() function
This was the last place where it was used in our code base.

Contributes to issue CURA-6600.
2019-08-28 10:35:56 +02:00
Ghostkeeper
972531b0a6
No longer update upon switching active profile
It's not necessary since our model doesn't depend on that.

Contributes to issue CURA-6600.
2019-08-28 08:49:28 +02:00
Ghostkeeper
944d1090cf
Use ContainerTree to get current quality groups and MachineManager to update
This removes all dependencies from the quality manager.

Contributes to issue CURA-6600.
2019-08-28 08:42:39 +02:00
Ghostkeeper
f5ca29c7aa
Emit materialsChanged from the variant when a material gets added
This allows the material models to update themselves.

Contributes to issue CURA-6600.
2019-08-27 18:01:35 +02:00
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
9297890d78
Fix typing of approximate diameter and add typing to function for it
Seems I forgot to add typing and that's biting my bum right now.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +02:00
Ghostkeeper
3952366798
Move createMaterial to MaterialManagementModel and simplify it a bit
We can reuse our duplicateMaterial function again but in a simpler way. Also finding the preferred material is simpler with our container tree.
However there seems to be a problem with finding the preferred material; it's not finding generic_pla for UM3 and AA0.4 anyway, and then falls back on a random material. This needs to be fixed in the variant node class.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +02:00
Ghostkeeper
957894b614
Fix duplicating a favourite material
The duplicate must also be favourite.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +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
Remco Burema
c333e980dc Merge branch 'feature_intent_container_tree' of https://github.com/Ultimaker/Cura into feature_intent_container_tree 2019-08-27 15:50:21 +02:00
Ghostkeeper
63ae6ee9ec
Fix updating materials models when materials change before first printer switch
Otherwise the _extruder_stack field would not yet be set.

Contributes to issue CURA-6600.
2019-08-27 15:47:41 +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
99ccddefa4
Move setMaterialName to MaterialManagementModel
No longer use the material manager which is deprecated.

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
Remco Burema
d5a8b2640f Fix 'getQualityChangesGroups' now gives a list issues.
part of CURA-6600
2019-08-27 15:46:47 +02:00
Jaime van Kessel
d1a8ce54a1 Merge branch 'feature_intent' of github.com:Ultimaker/Cura into feature_intent_container_tree 2019-08-27 14:18:41 +02:00
Jaime van Kessel
1d9d411732 Merge branch 'master' of github.com:Ultimaker/Cura into feature_intent 2019-08-27 14:17:57 +02:00
Jaime van Kessel
72ea1257d7 Prevent crash when machine isn't configured correctly yet
CURA-6600
2019-08-27 13:50:12 +02:00
Ghostkeeper
3655981c41
Use container tree to get the current printer's quality groups
Contributes to issue CURA-6600.
2019-08-26 14:00:35 +02:00
Ghostkeeper
51710c2868
Use new MachineNode.getQualityChangesGroups instead of quality manager
I hope that the machine node doesn't become a collection of functions that don't fit anywhere else, but this isn't contributing to that hope. However I still think that this is particular to a certain printer, so it's within the object-oriented programming paradigm. And it's also within the scope of the class, which is getting the available profiles. So it still sort of fits.

Contributes to issue CURA-6600.
2019-08-23 17:29:32 +02:00
Ghostkeeper
1febfde3cc
Fix switching to printers without variant
Since the 'empty_variant' nozzle is now just in the tree, this check is no longer even necessary.

Contributes to issue CURA-6600.
2019-08-23 15:38:58 +02:00
Ghostkeeper
4fb656ea7b
Don't use deprecated Preferences.getInstance()
Contributes to issue CURA-6600.
2019-08-23 14:46:42 +02:00
Ghostkeeper
99bf82dee3
Fix displaying list of nozzles
Make it use the ContainerTree structure since the original VariantManager's structure is not populated any more.

Contributes to issue CURA-6600.
2019-08-23 13:22:25 +02:00
Ghostkeeper
0302ae4257
Don't find any variants if the machine says it doesn't have them
Even if there might be a matching variant...

Contributes to issue CURA-6600.
2019-08-22 15:44:41 +02:00
Ghostkeeper
8ef410e826
Update the _available_materials in the actual _update function
It's confusing that this would be updated in the _canUpdate function. Just cleanliness.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
ea1c99b708
Update _favorite_ids in BaseMaterialsModel._update
And make all subclasses run its super _update as well to make sure that this gets updated for them. It's necessary for the _createMaterialItem functionality because it needs to add an is_favorite role.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
5d76f96354
Fix getting available materials without material manager
It's a bit weird still that this is executed in the _canUpdate... Oh well.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
4ad6f4f635
Update materials models when container tree updates
Instead of relying on MaterialManager to do 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 1fa5628cb2e35425d1b42f9dbb20a9bda45da032 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
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
Jaime van Kessel
646222f2ac Fix removing of material
CURA-6600
2019-08-19 13:01:05 +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
Remco Burema
7fb9642e45 Replace deprecated .getContainer() calls with .container
part of CURA-6600
2019-08-15 13:40:08 +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
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