901 Commits

Author SHA1 Message Date
Lipu Fei
1967dd8404 Fix code style
CURA-6840
2019-10-07 08:12:54 +02:00
Ghostkeeper
54c1980f78
Fix preferring correct diameter over correct preference
If the diameter doesn't match up, then the print fails. If the preference is not held up, then it chooses some random material and the user will understand what it chose.

Done during Turbo Testing and Tooling because a test was failing.
2019-10-04 17:35:38 +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
faa32ed33e
Remove another workaround in construction of QualityGroup
Like the previous commit.

Done during Turbo Testing and Tooling.
2019-10-04 15:35:32 +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
Ghostkeeper
0a6842703c
Update documentation
This class no longer applies to quality changes. Quality changes groups don't exist any more.

Done during Turbo Testing and Tooling.
2019-10-04 15:35:24 +02:00
Lipu Fei
4579b06f6d Fix typing 2019-10-04 15:10:42 +02:00
Lipu Fei
3c4d29a814 Merge remote-tracking branch 'origin/feature_intent' into CURA-6840_intent_profile_visibility 2019-10-04 15:00:21 +02:00
Nino van Hooff
8d223c01d4 Add type annotation for layer_heights_added
CURA-6840
2019-10-04 14:07:57 +02:00
Jaime van Kessel
85ed22de4c
Add some profiling decorators to the ContainerTree 2019-10-04 13:29:22 +02:00
Nino van Hooff
88e0a57374 Fix typing and deduplicate fetch_layer_height
CURA-6840
2019-10-04 13:25:58 +02:00
Nino van Hooff
68f334e141 Fix: Consider all active extruder intent profiles for display.
Remove the notion of a singular 'active' extruder from the code.
Visibility of intent profiles should consider all enabled extruders.
This fix makes sure that it doesn't matter in what order materials are
loaded, the available intent profiles will be the same.

CURA-6840
2019-10-04 11:21:25 +02:00
Lipu Fei
a93fd982dd Fix renaming custom profile
CURA-6842
2019-10-02 23:59:48 +02:00
Ghostkeeper
649ca99fe0
Only match on printer-specific materials, not variant-specific too
If a submaterial doesn't exist for the current variant node but it does exist for a different variant node, then it would not be found in the variant-specific materials and then would be looked up in the printer-specific materials. It then depends on the order in which findInstanceContainersMetadata returns things for whether the actual printer-specific material is selected or a different variant-specific material is selected. No longer now, because the variant name is specified to be absent so it may not match on variant-specific profiles any more.
Maybe this even gives us a small performance gain when combining these dictionaries, since there are now like 80% fewer profiles in that query.

Contributes to issue CURA-6831.
2019-10-02 08:55:13 +02:00
Ghostkeeper
0b610ccd58
Fix getting correct metadata entry for variant name
Turns out that the material profiles deserialise the variant to the 'variant_name' metadata entry, not just 'variant'. This caused it to find no variant-specific material profiles at all anywhere. It would always fall back to the machine-specific names.

Contributes to issue CURA-6831.
2019-10-02 08:55:12 +02:00
Ghostkeeper
c8be172343
Add debugging functionality to visualise the container tree
Could be useful for later, don't you think?

Contributes to issue CURA-6831.
2019-10-02 08:55:12 +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
296f8af59c Always clear ListModel so layer height selector will align properly
CURA-6836
2019-10-01 16:15:36 +02:00
Lipu Fei
ad7b58e460 Get diameter from material container
CURA-6821
2019-10-01 15:05:35 +02:00
Lipu Fei
55a5464ed3 Fix missing import 2019-10-01 11:41:17 +02:00
Lipu Fei
bc524b2c14 Fix unit test due to QualityGroup parent changes 2019-10-01 11:26:10 +02:00
Lipu Fei
961e1e0d7e Fix material node update for empty_material
CURA-6821
2019-10-01 10:56:17 +02:00
Lipu Fei
df105bc822 Fix update material due to compatible material diameter change
CURA-6821
2019-10-01 10:40:16 +02:00
Ghostkeeper
900761b373
Fix documentation of quality node class
It's a quality container, not a material container. This was a copy-paste mistake.
Also added that this may be a global quality container, not always a per-extruder quality container.

Found during testing & tooling.
2019-09-27 15:31:58 +02:00
Lipu Fei
e5d94fd2e4 Change to "name" property
CURA-6599
2019-09-26 17:19:15 +02:00
Lipu Fei
9ced5e9205 Fix QObject segfaults in QML
CURA-6599
2019-09-25 14:38:38 +02:00
Lipu Fei
d1330e5ffa Fix updating custom quality menu model
CURA-6599
2019-09-25 14:36:46 +02:00
Lipu Fei
f395c92732 Fix custom profile menu
CURA-6599
2019-09-25 08:28:24 +02:00
Lipu Fei
f2e518da6b Fix code style and typing 2019-09-25 08:23:57 +02:00
Lipu Fei
94e89ad4ac Fix merge conflicts with master 2019-09-24 14:26:43 +02:00
Jaime van Kessel
f469b99471
Create intent nodes based on the selected quality type
Previously it would use the material type from the material, but since
the material from the node can be different to that of the quality, we need
to use the one from quality instead (This is due to the fallback system)

CURA-6807
2019-09-24 11:57:50 +02:00
Jaime van Kessel
7e3f265068
Add a function to add a MachineNode to the tree.
This solves the issue that machines created by the stack builder broke the material updating

CURA-6791
2019-09-23 13:18:11 +02:00
Lipu Fei
1aa6708677 Fix typing 2019-09-23 10:59:31 +02:00
Ghostkeeper
4a68e7ec95
Fix favorite materials without material manager
We just track it via the preference value itself rather than duplicating that in any other data structure. It's simple enough.

Contributes to issue CURA-6776.
2019-09-20 09:57:36 +02:00
Ghostkeeper
12043df367
Don't use material manager to find or remove materials
That remove function in the material manager was very weird...

Contributes to issue CURA-6776.
2019-09-20 09:57:36 +02:00
Ghostkeeper
105e782e75
Remove unused imports to MaterialManager
Contributes to issue CURA-6776.
2019-09-20 09:57:35 +02:00
Jaime van Kessel
a69a394514
Fix container tree generation for machines that only have global profiles
CURA-6775
2019-09-19 17:16:15 +02:00
Jaime van Kessel
fc67090a2f
Fix crash when adding UMO 2019-09-19 16:15:00 +02:00
Jaime van Kessel
7dcf083991
Fix container tree for printers that have no variants but do have qualities & materials
CURA-6775
2019-09-19 15:56:06 +02:00
Jaime van Kessel
7016e791c8
Fix containertree for machines without materials but with specific qualities
CURA-6775
2019-09-19 15:33:19 +02:00
Jaime van Kessel
830b22e381
Fix crash when adding a machine without materials
CURA-6775
2019-09-19 15:12:29 +02:00
Jaime van Kessel
3e474c1107
Ensure that enabling & disabling an extruder gets handled correctly
CURA-6775
2019-09-19 14:54:58 +02:00
Jaime van Kessel
884a3ea819
Fix selection for intents if only one of the extruders has an intent
CURA-6598
2019-09-19 09:54:47 +02:00
Jaime van Kessel
78ab218cc2
No longer reset to default intent when configuration changed
This caused the intent to be reset every time a change was made.

CURA-6600
2019-09-18 14:52:51 +02:00
Ghostkeeper
2571f54d3c
Simplify looping over quality groups
Contributes to issue CURA-6600.
2019-09-18 14:01:23 +02:00
Ghostkeeper
b460ffeb9b
Use removeMaterial from MaterialManagementModel
Contributes to issue CURA-6600.
2019-09-17 17:59:50 +02:00
Ghostkeeper
8710bb77a7
Use MaterialManagementModel to rename materials
It's the replacement for the deprecation.

Contributes to issue CURA-6600.
2019-09-17 17:57:32 +02:00
Ghostkeeper
9392a3553c
Use implementation from MaterialManagementModel
The material manager is deprecated now.

Contributes to issue CURA-6600.
2019-09-17 17:54:26 +02:00