52 Commits

Author SHA1 Message Date
Jaime van Kessel
eb17e146bc
Fix some quality_changes being incorrectly shown for some configurations
CURA-7589
2020-08-06 16:59:30 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Jelle Spijker
120541a8db
Updated comments in Models
Converted doxygen style comments to reStructuredText style in the files
 found in Cura/cura/Model directory recursively  using the script
dox_2_rst.py (provided in the Uranium repo). Comments were manually
 checked and changed if needed.

 Note: dox_2rst.py struggles with decorated functions.
2020-05-08 18:59:38 +02:00
Kostas Karmas
ad6f837f44 Force reloading the VariantNode if it exists
When the MachineNode is updated through _loadAll, it was not updating
its VariantNodes when they already existed. This caused an issue to
UM2+Olsson block printers, where changing the G-Code flavor to Marlin
was not updating the VariantNodes to search for materials (since the
variants already existed).

This commit fixes that by forcing an update to the existing Variant
nodes.

CURA-7354
2020-04-21 14:41:17 +02:00
Jaime van Kessel
e74f049142
Fix bunch of issues found by pylint 2020-01-10 16:37:46 +01:00
Nino van Hooff
6725e28c07 Connect materialsChanged signal for printers without variants
Fixes duplicated materials not showing up for third party printers

CURA-7012
2019-12-11 11:55:25 +01:00
Jaime van Kessel
e937cdc937
Fix case where a global profile would be recognised as a extruder profile
CURA-6991
2019-11-21 13:10:01 +01:00
Lipu Fei
8228c6a743 Make sure position is not None
CURA-6974
2019-11-12 14:22:21 +01:00
Ghostkeeper
9f84304829
Defensive against missing global qualities
This is just something I encountered. Could be that some profiles got corrupted. In my case, I had a bug in Uranium that I fixed later.

Contributes to issue CURA-6793.
2019-10-16 12:56:05 +02:00
Lipu Fei
8f66809159 Always show custom qualities
CURA-6882
2019-10-14 14:34:35 +02:00
Lipu Fei
e5b90ee306 Fix is_experimental flag update
CURA-6869
2019-10-09 12:52:49 +02:00
Jaime van Kessel
b3b28bc330
Merge branch 'feature_intent' of github.com:Ultimaker/Cura into feature_intent 2019-10-04 15:46:41 +02:00
Ghostkeeper
05801bb623
Directly ask metadata from node instead of container
We only need the metadata, so far. Found with a test that got broken because I wasn't mocking out the entire container.

Done during Turbo Testing and Tooling.
2019-10-04 15:35:33 +02:00
Ghostkeeper
6c0772cd4a
Provide activeQualityGroupName instead of QualityGroup(QObject)
We don't need to inherit from QObject if we expose the name elsewhere. This prevents having workarounds for C++ vs QML ownership, and also allows us to test this while mocking out CuraApplication.

Done during Turbo Testing and Tooling.
2019-10-04 15:35:32 +02:00
Ghostkeeper
6f2f15c74f
Use pre-cached quality type from node rather than re-requesting it
Minor performance increase.

Done during Turbo Testing and Tooling.
2019-10-04 15:35:32 +02:00
Jaime van Kessel
85ed22de4c
Add some profiling decorators to the ContainerTree 2019-10-04 13:29:22 +02:00
Lipu Fei
a93fd982dd Fix renaming custom profile
CURA-6842
2019-10-02 23:59:48 +02:00
Ghostkeeper
b245be6970
Remove has_machine_materials metadata
It's not behaving as expected here. For instance, Ultimaker 3 wasn't specifying has_machine_materials and thus only the base materials would get loaded, but clearly the Ultimaker 3 has materials specialised for it.
Whether or not a printer has materials specialised for it is now determined by whether the specialisations exist in the material files. So we don't need the metadata entry any more. It seemed to have not been in use anyway, except by one printer which specified that has_machine_materials is true. I've now made it behave as if it's always true.

Contributes to issue CURA-6831.
2019-10-02 08:55:04 +02:00
Lipu Fei
bc524b2c14 Fix unit test due to QualityGroup parent changes 2019-10-01 11:26:10 +02:00
Ghostkeeper
9a5d45282a
Set intent category of quality changes group correctly
If any profile has a different intent than default, the entire group becomes that intent. There can only be one intent that's different from default per group.

Contributes to issue CURA-6600.
2019-09-12 14:54:24 +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
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
Remco Burema
745390e51f Fix typing.
part CURA-6600
2019-08-27 17:57:11 +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
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
Ghostkeeper
a90b4cc136
Fix finding global qualities: Metadata is not boolean
It's a string, strangely.

Contributes to issue CURA-6600.
2019-08-26 15:05:01 +02:00
Ghostkeeper
af9c5cd55c
Find global qualities for quality_definition as well
We don't have global qualities specific to e.g. the Ultimaker 3 Extended.

Contributes to issue CURA-6600.
2019-08-26 14:47:58 +02:00
Ghostkeeper
b1ce9b64d4
Add function to construct QualityChangesGroups for machine
It doesn't cache these any more, but reconstructs them when asked for.

Contributes to issue CURA-6600.
2019-08-23 17:26:57 +02:00
Ghostkeeper
46cf7aafa9
Encode empty containers in container tree if necessary
You can now be assured that there is ALWAYS at least one child node, except for child nodes of intent profiles which don't exist.

Contributes to issue CURA-6600.
2019-08-22 16:44:52 +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
6f77c8735c
Don't load any materials for printers that don't have them
For instance the Ultimaker 2 shouldn't display any materials.

Contributes to issue CURA-6600.
2019-08-22 15:37:05 +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
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
Remco Burema
507cb356d2 Remove (all?, most?) deprecated ContainerNode.getMetaDataEntry calls.
part of CURA-6600
2019-08-20 15:38:45 +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
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
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
Jaime van Kessel
719e69692c Fix import issues
CURA-6600
2019-08-12 15:20:09 +02:00
Ghostkeeper
8f075b644d
Add global quality nodes to machine node
This means that the parent of the quality node could be one of two types. A bit confusing.

Contributes to issue CURA-6600.
2019-08-12 14:18:51 +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
f31d7798ce
Add warning for adding local copies of metadata
Contributes to issue CURA-6600.
2019-08-08 16:26:38 +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