Commit graph

869 commits

Author SHA1 Message Date
Jaime van Kessel
de1065f0a3 Prevent crash if extruder is not yet set
CURA-6598
2019-08-29 14:04:05 +02:00
Jaime van Kessel
ba0c16d968 Update intents model to use container tree
CURA-6598
2019-08-29 13:53:23 +02:00
Jaime van Kessel
a8b818fbdc Ensure that right intents are added to the tree
CURA-6598
2019-08-29 13:52:01 +02:00
Jaime van Kessel
f4dc93fc39 Prevent crash in model if no extruder is set
CURA-6598
2019-08-29 11:57:03 +02:00
Jaime van Kessel
5401a4db15 Ensure that each intent gets it's own bar in recommended
CURA-6598
2019-08-29 11:53:19 +02:00
Jaime van Kessel
24d6d5b102 Update intent models to also house nested qualities
CURA-6598
2019-08-29 11:45:19 +02:00
Ghostkeeper
9614cef135
Move duplicateQualityChanges to QualityManagementModel
This is specific to the quality management page, so moving it here prevents QualityManager from becoming a big ball of spaghetti again.

Contributes to issue CURA-6600.
2019-08-29 09:02:18 +02:00
Ghostkeeper
b046ff6683
Fix updating quality management page profile list
When a custom profile gets added, deleted or renamed we need to update our model.

Contributes to issue CURA-6600.
2019-08-28 16:54:41 +02:00
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
be49956de9
Refer to quality management model to remove quality changes
This function is deprecated now.

Contributes to issue CURA-6600.
2019-08-28 15:29:03 +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
35907e5228
Use Pythonic way of creating list of N elements
Contributes to issue CURA-6600.
2019-08-28 14:17:17 +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
24fd67c360
Also try looking for material-specific profiles, not just by type
Type is only a fallback after the exact ID match.
This way we can also have profiles specific to Ultimaker PLA Red and such in the future.

Contributes to issue CURA-6600.
2019-08-28 13:53:21 +02:00
Ghostkeeper
a05f077df8
Use fdmprinter for machines that don't have printer-specific qualities
This encodes the behaviour of QualityManager.getMachineDefinitionIDForQualitySearch.

Contributes to issue CURA-6600.
2019-08-28 13:35:49 +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
83c8b814d9
Apply intent category when changing to quality changes group
This essentially makes the quality changes depend on the intent that was active when it was created.

Contributes to issue CURA-6600.
2019-08-28 10:33:33 +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
0398c404fb
Update tree when material gets deleted
Contributes to issue CURA-6600.
2019-08-27 18:01:35 +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
f7a15ca507 Merge branch 'feature_intent_container_tree' of https://github.com/Ultimaker/Cura into feature_intent_container_tree 2019-08-27 15:46:59 +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
36dfd23e3f Remove old buildplate function
CURA-6600
2019-08-27 15:06:27 +02:00
Jaime van Kessel
d479e5ec58 Removed no longer used initialize function
CURA-6600
2019-08-27 15:05:39 +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
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
8f34b3dd73
Set quality profiles to preferred quality upon stack creation
A good default.
Possible bug: If there are multiple matching quality profiles but the preferred quality profiles matches none or multiple of them, a random one is chosen. The random profile for the global stack may not match the random one for the extruder?

Contributes to issue CURA-6600.
2019-08-27 09:07:23 +02:00
Ghostkeeper
fcab800a8d
Add function to find preferred quality profile
Not for global yet, so it doesn't appear as if anything is loaded yet.

Contributes to issue CURA-6600.
2019-08-26 17:50:46 +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
599dcb34bc
Fix sorting qualities by quality type
Otherwise the dictionary ends up being filled by container ID which then causes the quality type to not be present in the dictionary, ending up with an empty list of quality groups.

Contributes to issue CURA-6600.
2019-08-26 15:25:11 +02:00