Commit graph

10943 commits

Author SHA1 Message Date
Ghostkeeper
56d6664c8c
Guard against materials not having a definition
The empty container has no definition.

Contributes to issue CURA-4243.
2017-11-28 15:33:21 +01:00
Ghostkeeper
eb3981b4e0
Let _fetchInstanceContainers return containers split by loaded or not
It must now return two dictionaries: One for the profiles that have been completely loaded and one for the profiles that are only metadata. We could probably improve on these a little bit, since all of these (except the material model) will now load all available quality profiles. I'll see if it is necessary to optimise that.

Contributes to issue CURA-4243.
2017-11-28 14:26:14 +01:00
Ghostkeeper
e5427eded6
Refactor _getBasicMaterials to only handle metadata
Otherwise the full profile of all materials and all their definitions gets loaded.

Contributes to issue CURA-4243.
2017-11-27 15:38:11 +01:00
Ghostkeeper
952e3974eb
Remove convenience handling of 'None'
Because this parameter has type checking, we'll get warned if this variable is None.

Contributes to issue CURA-4243.
2017-11-27 14:22:09 +01:00
Ghostkeeper
54a12d14c4
Add string representation for debugging
My IDE shows the str(inst) representation of an object when indicating what value is in there. This makes it easier to find stuff. It'll also make debug prints more clear than the default <XmlMaterialProfile.XmlMaterialProfile.XmlMaterialProfile object at 0x12345678> stuff of Python.

Contributes to issue CURA-4243.
2017-11-27 14:19:30 +01:00
Ghostkeeper
99780c3b44
Fix casing of getMetadataEntry
This is done a bit inconsistently because it's unclear whether metadata should be considered as one word or two. I'd say it is one word, not 'meta data', but people seem to disagree.

Contributes to issue CURA-4243.
2017-11-27 13:31:29 +01:00
Ghostkeeper
4189f8dfa3
Use new findDirtyContainers function
This prevents all instance containers from being loaded every time we auto-save.

Contributes to issue CURA-4243.
2017-11-27 11:59:37 +01:00
Ghostkeeper
fab85616c7
Remove test for upgrading from legacy stacks to modern stacks
This is because ContainerRegistry.saveAll has been removed. That function was only used by this test. I don't think it's worth keeping this unit test for the effort. It's only for code that's passed through in the version upgrade from 2.4 to 2.5 anyway.

Contributes to issue CURA-4243.
2017-11-27 11:23:24 +01:00
Ghostkeeper
a2b0c4535c
Only load metadata of machines for derived profiles
We only need the metadata of these machines (now that the ID is in the metadata). We won't need all of those machines because some of them are not added.

Contributes to issue CURA-4243.
2017-11-27 10:55:51 +01:00
Ghostkeeper
9571181178
Fix ID of derived materials
Because the ID is now in the metadata it would get overwritten by this deep copy. We need to set it again.

Contributes to issue CURA-4243.
2017-11-27 10:37:54 +01:00
Ghostkeeper
e0f0e098ff
Use MaterialsModel for materialsModel
This specialized InstanceContainersModel has an override that makes the model a bit more efficient when non-materials get their metadata updated.

Contributes to issue CURA-4243.
2017-11-27 09:54:40 +01:00
Ghostkeeper
9938678347
Fix setting IDs of empty containers
The _id hasn't been used for a very long time.

Contributes to issue CURA-4243.
2017-11-27 09:16:27 +01:00
Ghostkeeper
aa52b9682e
Fix adding name when loading complete material file
Also, don't use setName since that only operates on the base file and sends out unnecessary signals.

Contributes to issue CURA-4243.
2017-11-27 09:10:55 +01:00
Ghostkeeper
ebe766a7c8
Set definition by their ID
The new function for setting the definition just adds the ID to the metadata.

Contributes to issue CURA-4243.
2017-11-24 16:45:09 +01:00
Ghostkeeper
37935a8a90
Load only metadata on start-up
Contributes to issue CURA-4243.
2017-11-23 16:47:55 +01:00
Ghostkeeper
1e07325d8f
Remove unused getIdsFromFile
Since we now return all metadata at once from every file, we don't need this any more. We need to side-load the metadata anyway.

Contributes to issue CURA-4243.
2017-11-23 16:11:02 +01:00
Ghostkeeper
3ee2e0488f
Only load metadata when finding hotends belonging to material
We only need to have the hotend metadata.

Contributes to issue CURA-4243.
2017-11-23 15:31:22 +01:00
Ghostkeeper
def7b6994d
Store correct ID in metadata after deserialising
Contributes to issue CURA-4243.
2017-11-21 12:50:10 +01:00
Ghostkeeper
4fa38c26e8
Don't add any extra metadata to the end of the list you're iterating over
Stupid mistake. This causes infinite loops.

Contributes to issue CURA-4243.
2017-11-21 11:46:14 +01:00
Ghostkeeper
0831451371
Fix returning resulting metadata
Forgot to change that back.

Contributes to issue CURA-4243.
2017-11-21 11:05:11 +01:00
Ghostkeeper
c4debbea8b
Implement deserializeMetadata
Let's hope this works...

Contributes to issue CURA-4243.
2017-11-21 10:59:01 +01:00
Ghostkeeper
202f7f87f8
Remove ID from definition files
Sometimes it's out of sync. Sometimes even missing. Let's just not use that any more.

Contributes to issue CURA-4243.
2017-11-02 12:53:06 +01:00
Ghostkeeper
cf7bad1bbb
Make _profile_name a class method
This way we can execute it statically while getting the metadata.

Contributes to issue CURA-4243.
2017-11-02 10:18:52 +01:00
Ghostkeeper
d369f92020
Make get[ConfigurationType|Version]FromSerialized class methods
This way we can call them before an instance has been created, in order to upgrade the serialized forms.

Contributes to issue CURA-4243.
2017-11-01 16:18:08 +01:00
Ghostkeeper
e48b151d40
Express getConfigurationTypeFromSerialized as function of its parent
This prevents code duplication a bit and allows us to make it a classmethod.

Contributes to issue CURA-4243.
2017-11-01 16:17:26 +01:00
Ghostkeeper
07947d5d2c
Override getIdsFromFile to load multiple IDs
This should result in all IDs in the XML file, since there are multiple per file here.

Contributes to issue CURA-4243.
2017-11-01 14:53:52 +01:00
Ghostkeeper
ddf5ab0494
Make _parseCompatibleValue a class method
It might as well be static, since it doesn't need an instance.

Contributes to issue CURA-4243.
2017-11-01 14:52:57 +01:00
Ghostkeeper
74bd527b03
Load product_id_map from file
For now this file is hard-coded. We should eventually try to generate this in the build system.

Contributes to issue CURA-4243.
2017-11-01 14:52:03 +01:00
Ghostkeeper
a08875c5eb
Remove redundant setting of name
It's just copied along with the rest of the metadata now.

Contributes to issue CURA-4243.
2017-10-31 11:11:56 +01:00
Ghostkeeper
d24fa3bc3b
Set name directly in metadata when clearing
Because the setName function checks if the name is equal to the previous name, but at that point the previous name doesn't exist.

Contributes to issue CURA-4243.
2017-10-31 08:23:57 +01:00
Ghostkeeper
8eaec149fa
Make sure the ID stays in the metadata when clearing it
Previously the ID was also exempted from the clear.

Contributes to issue CURA-4243.
2017-10-30 15:54:26 +01:00
Ghostkeeper
3a9c8d16a2
Fix remaining references to instance_container._id
These must've slipped through the cracks.

Contributes to issue CURA-4243.
2017-10-30 15:07:46 +01:00
Ghostkeeper
839c8ccc52
Fix 'Could not get metadata of container <empty string>'
Turns out that the side bar header was requesting the metadata before the active material was set. Now I'm just saying that if the active material was not set, it should not be compatible.

Contributes to issue CURA-4243, side-ways.
2017-10-30 11:15:41 +01:00
Ghostkeeper
8bbb6c1af5
Load and serialize container ID and name properly: not in metadata
We shouldn't write the name or ID, who are now in the metadata.
Also we should load the name and ID properly from the file.

Contributes to issue CURA-4243.
2017-10-27 16:50:13 +02:00
Ghostkeeper
a31c39b225
Use setters and getters for name and ID
Because their implementation changed, these would have been implemented in some other way. Instead I use the getters and setters which are inherited from the parent class and therefore are already updated.

Contributes to issue CURA-4243.
2017-10-27 16:35:58 +02:00
Ghostkeeper
7ac3c1446b
Make ignored metadata keys a set
It needs to be a set now for Uranium.

Contributes to issue CURA-4243.
2017-10-27 16:25:52 +02:00
Ghostkeeper
6c4c7fff4d
Use findContainersMetadata whenever possible
This ensures that we only load those containers that we actually need the data of.

Contributes to issue CURA-4243.
2017-10-20 15:09:45 +02:00
Ghostkeeper
f7e048aee5
Remove unused variable
Contributes to issue CURA-4243.
2017-10-19 16:37:03 +02:00
Ghostkeeper
2fc198a7ad
Move manual criterion into base criteria filter
This code was filtering on certain criteria, and then filtering the results based on an additional metadata field. Let's just move that last field in the original criteria too...

Contributes to issue CURA-4243.
2017-10-19 15:48:19 +02:00
Ghostkeeper
7745113704
Re-use stack variable
We're creating the variable but then requesting the 0th element from the list each time... That can be more logical and more efficient.

Contributes to issue CURA-4243.
2017-10-19 15:32:21 +02:00
Diego Prado Gesto
1a47ec85ca Merge branch 'master' of https://github.com/Ultimaker/Cura 2017-10-19 13:58:19 +02:00
Diego Prado Gesto
b49610f0c8 Merge branch 'CURA-4248_BAM' 2017-10-19 13:57:30 +02:00
Diego Prado Gesto
0e74f9d881 CURA-4248 - Fix some mistakes in the formulas in quality profiles 2017-10-19 13:54:10 +02:00
Ghostkeeper
5a125aa514
Rename printCoreRow to variantRow
Because on only one of our printers it's actually a print core. Internally we've always called it the variant.
2017-10-19 13:38:08 +02:00
Lipu Fei
946b8ae92d Remove executable bit for non-executable files 2017-10-19 10:28:57 +02:00
Diego Prado Gesto
d3e8915b30 Merge branch 'master' into CURA-4248_BAM 2017-10-19 10:26:25 +02:00
Lipu Fei
475f6223d4 Remove executable bit for json files 2017-10-19 10:24:38 +02:00
A.Sasin
5a8fa92c3f Added semicolon
CURA-4449
2017-10-19 09:01:15 +02:00
alekseisasin
10127240b5 Merge pull request #2593 from petterreinholdtsen/patch-1
List model/x3d+xml in the desktop file
2017-10-18 18:06:22 +02:00
ChrisTerBeke
f4eb2ee256 Merge pull request #2612 from fieldOfView/fix_splashscreen_sub_version_size
Fix size of "beta" classifier on splash screen for HiDPI screens
2017-10-18 16:46:56 +02:00