157 Commits

Author SHA1 Message Date
Ghostkeeper
c34de83e3f
Use isLoaded to check if a material is already loaded
This prevents us from having to make an expensive findContainers call if it's not necessary, and also prevents us from unnecessarily loading the subcontainers in a loop during loading.

Contributes to issue CURA-4243.
2017-11-29 18:04:07 +01:00
Ghostkeeper
cacc4b8586
Properly set the definition to the currently processed machine
Otherwise all of them stay at fdmprinter.

Contributes to issue CURA-4243.
2017-11-29 16:41:20 +01:00
Ghostkeeper
99cd139ba4
Remove setting definition double
Contributes to issue CURA-4243.
2017-11-29 13:39:24 +01:00
Ghostkeeper
dad99f5292
Merge branch 'master' into feature_local_container_server
Contributes to issue CURA-4243.
2017-11-29 13:06:08 +01:00
Ghostkeeper
8707396ad7
Remove isReadOnly functionality
Everyone should now ask it from the container registry.

Contributes to issue CURA-4243.
2017-11-28 17:30:00 +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
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
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
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
Lipu Fei
18c7a5acf3 Pass optional file_name for deserialization
CURA-4613

Some upgrades depend on the file_name, so the file_name is needed in
this case.
2017-11-23 11:28:16 +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
ChrisTerBeke
657a91c525 Merge pull request #2685 from Ultimaker/container_stack_improvements
Container stack improvements
2017-11-20 17:42:26 +01:00
Lipu Fei
25c41062e1 Fix material upgrade and version checking
CURA-4519

Less duplicated code, but it's still one of the worst parts...
2017-11-02 13:01:49 +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
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
Lipu Fei
b6dd87081c Add upgrade script for 3.0 to 3.1
CURA-4451

- Add upgrade script for 3.0. to 3.1
- Upgrade old stack files so they will use "empty_quality" as the
  "Not Supported" quality profile.
- Increase SettingVersion to 4
2017-10-30 12:45:25 +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
ChrisTerBeke
64bcf4b44d Remove debug log when XML material file contains unused property 2017-10-20 10:22:09 +02:00
ChrisTerBeke
78ba3c3aa0 Move BAM equations to BAM quality profiles as they are very specific - CURA-4248 2017-10-18 13:51:06 +02:00
ChrisTerBeke
91589ed29d Add surface energy property to get correct behaviour - CURA-4248 2017-10-17 13:03:29 +02:00
ChrisTerBeke
a444e5c883 update material xml parser to support psp values - CURA-4253 2017-10-16 15:55:46 +02:00
Lipu Fei
7e0014eadd Create machine name-to-id map at runtime instead of using a hard-coded map
CURA-4223
2017-10-16 10:28:06 +02:00
Jaime van Kessel
38a2245d74 XML materials are now added in one batch 2017-09-28 16:07:03 +02:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Lipu Fei
51547bf37a Update setting_version to 3 for XMLMaterial
CURA-4270

Technically, this is not right. This is just to postpone a time bomb...
The XML material profile needs a setting number instead of getting it
derived from the schema version.
2017-09-04 15:51:31 +02:00
Lipu Fei
812e262f39 When deserialising a material, also update the material derived from it
CURA-4204
2017-08-22 11:29:35 +02:00
Ghostkeeper
b03847447f
Take manufacturer from XML profile if available
Otherwise we fall back to the manufacturer in the machine definition. If that fails too, we fall back to Unknown (rather than an empty string).

Contributes to issue CURA-4157.
2017-08-11 11:13:23 +02:00
Lipu Fei
024f2384e0 Fix mutable arg problem and rename arg
CURA-4049
2017-07-18 08:32:22 +02:00
Lipu Fei
3c663d576c Do not save setting_version when serializing an XML material
CURA-4053

setting_version is derived from the "version" tag in the XML material
schema.
2017-07-17 13:54:22 +02:00
Lipu Fei
ecdf0bbe33 Fix setting_version in metadata for XMLMaterial
CURA-4053
2017-07-17 13:40:12 +02:00
Lipu Fei
63b71b8661 Fix typo in comments 2017-07-17 13:39:03 +02:00
Lipu Fei
68989f2871 Use optional arg in serialize() to exclude network auth keys
CURA-4049
2017-07-17 11:04:08 +02:00
Ghostkeeper
d6941fef2f
Interpret material compatible 'unknown' as 'yes'
We decide whether it is unknown (or unsupported) based on the availability of profiles for it.

Contributes to issue EM-1662.
2017-07-11 13:23:51 +02:00
Lipu Fei
071005541c Use XMLMaterialProfile version tag to determine its version
CURA-2724
2017-07-06 14:47:59 +02:00
Lipu Fei
b4949a164c WIP: Add temporary fix to make materials work with 2.7 version upgrade
CURA-3975

This is a temporary fix to make materials work with 2.7 version upgrade
because of the setting_version change from 1 to 2. This MUST be fixed
after we have decided on how to determine the versions of an
XMLMaterialProfile.
2017-07-06 14:19:30 +02:00