351 Commits

Author SHA1 Message Date
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
fdf5dc049e Update all containers to setting_version 3
CURA-4270
2017-09-04 15:47:04 +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
fieldOfView
0f8a57e785 Add support for serialising namespaced Cura settings in XML materials 2017-08-12 16:33:37 +02:00
fieldOfView
e163871360 Add support for deserialising namespaced Cura settings in XML materials 2017-08-12 16:03:56 +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
Ghostkeeper
cd4bffb380
Set author to Ultimaker B.V. instead of Ultimaker
To be consistent with the rest of the plug-ins and with the material files.

Contributes to issue CURA-3857.
2017-06-28 13:50:37 +02:00
Lipu Fei
4ea8cc448a Use semantic versioning for all plugin.json
CURA-3712
2017-06-22 08:57:47 +02:00
Lipu Fei
73f598ff9f Fix code style
CURA-3712
2017-06-22 08:54:04 +02:00
Jaime van Kessel
e3629cec39 Replaced catalog metadata entry with i18n-catalog
CURA-3712 & Cura-3856
2017-06-21 14:24:00 +02:00
Jaime van Kessel
44125d3275 Moved certain meta data entries to seperate file
CURA-3856 & CURA-3712
2017-06-21 11:22:35 +02:00
Ghostkeeper
694254e299
Fix MIME type of material resources
Because of this wrong MIME type, the material profile would get saved using the preferred extension of the instance container, .inst.cfg. This would then get interpreted as having the MIME type of instance containers, and then it would fail to load because it is not an INI file.

Now it stores it as .xml.fdm_material and so the MIME type database interprets it as an XML file.

Contributes to issue CURA-3937.
2017-06-16 15:54:42 +02:00
fieldOfView
49f2fb2cea
Fix filtering maerials after editing materials
NB: previously the "approximate_diameter" metadata was stored as a number. This caused some issues passing arguments from QML to Python. Now "approximate_diameter" is stored as a string.
2017-06-14 10:42:04 +02:00
fieldOfView
a7cdf49018
Fix setting metadata on fdmmaterial containers 2017-06-14 10:41:12 +02:00
fieldOfView
5550fe0da8
Fix confusion around the use of the word "global" 2017-06-14 10:40:52 +02:00
fieldOfView
944318d44a
Fix loading material diameter and GUID from XML file 2017-06-14 10:40:43 +02:00
Lipu Fei
8ede981a2c Set version in <fdmmaterial> when saving XML material files
CURA-3884
2017-05-29 14:19:52 +02:00
Lipu Fei
9a08e0cc27 Only use <fdmmaterial version> for detecting material file version
CURA-3540
2017-05-23 11:51:31 +02:00
Jaime van Kessel
4b826b747b Added exception handling to XML parsing
CURA-3843
2017-05-19 13:54:31 +02:00
Jaime van Kessel
75b3f08318 Removed unneeded logging
THis caused a massive logging spam
2017-05-19 13:09:41 +02:00
Lipu Fei
5a6049ddea Change XmlMaterialUpgrader to use UNIX EOLs
CURA-3756
2017-05-19 11:06:01 +02:00