Commit graph

873 commits

Author SHA1 Message Date
Lipu Fei
dd8f6dc10e Fix ContainerTree reacting to duplicating materials
CURA-6863
2019-10-14 12:24:05 +02:00
Lipu Fei
8b913f4009 Merge remote-tracking branch 'origin/master' into CURA-6863_duplicated_material_oddness 2019-10-14 12:23:49 +02:00
Remco Burema
26a7de5a27 Fix boolean check.
part of CURA-6863
2019-10-14 11:02:58 +02:00
Remco Burema
4277ede64f Fix 1/2 of the duplication material bug.
The material is added multiple times to the variant nodes, and overwriting it with the eventual right one was going wrong.
This does not solve it entirely (because the less specific one still ends up selected _initially_ because it gets added first, and the order can't be guaranteed.
part of CURA-6863
2019-10-14 01:01:19 +02:00
Jaime van Kessel
be675d9343
Remove unused signal 2019-10-11 14:33:08 +02:00
Ghostkeeper
f6d83d7a6b
Fix sign of __contains__
Should've been the other way around!

Contributes to issue CURA-6793.
2019-10-10 16:10:19 +02:00
Ghostkeeper
ab4fade017
Fix check if definition with ID exists
It's not an InstanceContainer but a DefinitionContainer.
Also, when checking with the ID, it'll short circuit to the dictionary look up by ID. Then it's faster to directly check without specifying what type of container it is to prevent another nested function call.

Contributes to issue CURA-6793.
2019-10-10 15:36:19 +02:00
Ghostkeeper
38e723b51c
Fix loading GlobalStacks on different thread
The findContainerStacks() will list all container stacks and lazily load them. However this lazy loading is done on the thread that's calling it. The lazy loading will create GlobalStack objects, which are QObjects. The QML code then can't access those QObjects because they are created on different threads. So now instead we'll do the find query on the main thread but all the rest on the background thread.

Contributes to issue CURA-6973.
2019-10-10 15:32:14 +02:00
Ghostkeeper
9323ed5d04
Add implementation of get() for the pretend-dict
Some places are using this.

Contributes to issue CURA-6973.
2019-10-10 14:56:00 +02:00
Ghostkeeper
268da885ee
Remove unused _loadAll function
This one is no longer used since we no longer load all stacks upon start-up.

Contributes to issue CURA-6793.
2019-10-10 14:48:46 +02:00
Nino van Hooff
d60b26db15 None-check for material diameter.
Fixes a crash for materials which don't have that metadata-entry,
such as an empty material (UM2)

CURA-6873
2019-10-10 09:27:23 +02:00
Ghostkeeper
c5b957d0b1
Remove debug code
Contributes to issue CURA-6793.
2019-10-09 16:45:43 +02:00
Ghostkeeper
5199e3e6db
Add background job to pre-load other added printers
Not just the active one.

Contributes to issue CURA-6793.
2019-10-09 16:44:00 +02:00
Lipu Fei
e5b90ee306 Fix is_experimental flag update
CURA-6869
2019-10-09 12:52:49 +02:00
Ghostkeeper
4ffda015db
Implement lazy loading for machine nodes
Should be completely transparent. It'll fail the unit tests though because it now pretends that all printers have machine nodes.

Contributes to issue CURA-6793.
2019-10-09 10:53:58 +02:00
Ghostkeeper
23904e1dca
Don't cache machine manager and application
This makes testing harder. Also fixed the typing of the application this way.

Contributes to issue CURA-6793.
2019-10-08 14:16:19 +02:00
Jaime van Kessel
17ce0f5eb1
Remove unused imports 2019-10-08 10:59:37 +02:00
Lipu Fei
e4fa89ea4b Simplify quality display name (label name) generation
CURA-6706
2019-10-07 13:28:12 +02:00
Lipu Fei
d99386cf2e Fix recommended mode
CURA-6706
2019-10-07 12:58:41 +02:00
Lipu Fei
2033f24a17 Use catalog to translate intent category name
CURA-6706
2019-10-07 12:41:52 +02:00
Lipu Fei
c42feae11c Make intents work on quality management page
CURA-6706
2019-10-07 09:22:47 +02:00
Lipu Fei
1981a7c65b
Merge pull request #6479 from Ultimaker/CURA-6840_intent_profile_visibility
Cura 6840 intent profile visibility
2019-10-07 08:18:28 +02:00
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