52 Commits

Author SHA1 Message Date
Ghostkeeper
b67d8d4103
Fix type of fallback variable
These have to be strings because the configparser getter can only return strings.

Contributes to issue CURA-5936.
2018-11-14 13:46:13 +01:00
Ghostkeeper
ae2b312472
Add typing for all version upgrade plug-ins
Hopefully we'll take this typing along when we next copy-paste the stuffs.

Contributes to issue CURA-5936.
2018-11-14 13:41:23 +01:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Lipu Fei
d02d004986 Correct profile_translations in VersionUpgrade21to22
CURA-3777
2017-05-17 13:44:34 +02:00
Jaime van Kessel
e40f60a52b Changed profile names
CURA-3777
2017-05-15 16:52:25 +02:00
Ghostkeeper
55b2392a1d
Load setting version from metadata
I'm not really awake today, am I? The functionality happened to still work because of how our real data is structured right now, but the tests still failed. Those are successful now.

Contributes to issue CURA-3427.
2017-05-12 14:55:19 +02:00
Ghostkeeper
9820dac4a6
Actually use setting_version to get the setting version number
This was sort of hidden because we've always incremented the normal version number up until now.

Contributes to issue CURA-3427.
2017-05-12 14:51:44 +02:00
Ghostkeeper
0a84a181c4
Track cfg version numbers with major-minor, sorta
We now have a (format) version and a setting version. Ideally we'd like major-minor version numbers in our profiles. However, introducing major-minor version numbers requires substantial changes to the version upgrade manager to compare version numbers, find a path towards the current version, or even keeping track of the current version. Therefore we just collapse the two version numbers into one: Multiply the major version number by a million and you'll never exceed it in the minor versioning. The only problem is that we now have to update the versioning for all of our three upgrade plug-ins, because they all need to know locally how to find the version number of their file types (because the upgrade manager has no knowledge of the file types) and they have no access to each other because a plug-in may be disabled.

Contributes to issue CURA-3427.
2017-05-11 17:31:37 +02:00
Ghostkeeper
d391639b48
Translate Fan Speed Full At Layer to one-based counting
All layer counts should increment by 1.

Contributes to issue CURA-2314.
2016-09-16 16:50:27 +02:00
Ghostkeeper
ef3b6905b7
Translate skin overlap properly
From this dict it also gets updated in other places, such as the preferences.

Contributes to issue CURA-844.
2016-09-15 12:47:39 +02:00
Ghostkeeper
c223044541
Don't modify original dict while iterating over it
Just store the results in a new dict and return that one.
2016-09-15 12:47:39 +02:00
Ghostkeeper
5c5d188889
Remove support_area_smoothing setting
Contributes to issue CURA-2296.
2016-09-14 15:41:32 +02:00
Ghostkeeper
e35bc595b6
Fall back to different quality depending on stack
Falling back to normal.inst.cfg isn't enough. That profile may be filtered out by the machine, variant and material. We need to fall back to a different quality profile depending on the machine, variant and material.

Contributes to issue CURA-844.
2016-09-08 19:23:18 +02:00
Ghostkeeper
e16a32ee54
Add missing built-in profiles to _profile_translations
These profiles were not thought of as built-in. Instead, they were sorta constructed from pieces. That complex piece of code won't be necessary any more after I add this and after Cura 2.3 has proper profile inheritance again.

Contributes to issue CURA-844.
2016-09-08 19:23:18 +02:00
Simon Edwards
720cca63bd Added skin_overlap <= infill_overlap mapping.
Contributes to CURA-844 Profile converter 2.1 ==> 2.2
2016-09-07 11:31:02 +02:00
Ghostkeeper
d046cd764a
Update version upgrade system for new quality-changes profiles
The quality profile now sometimes gets updated to a quality profile, and sometimes to a quality-changes profile, depending on whether the profile is built-in or not.

Contributes to issue CURA-2006.
2016-08-24 14:35:40 +02:00
Ghostkeeper
368a836ff2
Move material translations to separate dictionary
This prevents a mix-up of how material names should be translated for quality profiles and how material names should be translated for material profiles.

Contributes to issue CURA-844.
2016-08-24 14:35:40 +02:00
fieldOfView
f1ee6b2b15 Update VersionUpgrade21to22 for new materials 2016-08-23 13:56:20 +02:00
Ghostkeeper
4d13622a6e
Split profiles also per variant
But of course the variant names are strange in the new material profiles.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
9a555fcab0
Fix call to VersionUpgrade21to22.machinesWithMachineQuality
It needs that stupidly long path if we're using imports inside a plug-in.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
1428f67798
Rename machines_with_machine_quality to machinesWithMachineQuality
As per the code style conventions. Sorry, I'm used to other conventions in one of my own projects.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
36f84017cf
Move _machines_with_machine_quality to VersionUpgrade21to22
It's going to need to be used by the upgrader of machine instances as well, that's why.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
f759b24034
Add translations for support roof to support interface
These setting names were changed.

Contributes to issue CURA-1013.
2016-08-01 15:03:14 +02:00
Ghostkeeper
70acdb168b
Automate removing settings from old profiles for renames
So we don't have to edit the actual code for simple setting renames.
2016-08-01 14:56:18 +02:00
Ghostkeeper
54685e8898
Rename setting skirt_minimal_length to skirt_brim_minimal_length
Also updated the description and made it a bit more accurate. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 17:12:34 +02:00
Ghostkeeper
d4f96ab62d
Rename setting skirt_line_width to skirt_brim_line_width
Also updated the description. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 17:00:30 +02:00
Ghostkeeper
cb4c1fd08c
Rename skirt_speed to skirt_brim_speed
Also updated the description. Because this concerns not only the skirt, but also the brim.

Contributes to issue CURA-1678.
2016-07-22 16:45:11 +02:00
Ghostkeeper
31901606b8
Properly translate default profiles
Otherwise the machine instance doesn't get loaded.

Contributes to issue CURA-844.
2016-07-18 16:02:41 +02:00
Ghostkeeper
8f5e56c66e
Make documentation specify filename without extension
Contributes to issue CURA-844.
2016-07-07 15:22:27 +02:00
Ghostkeeper
e6efba3868
Make version upgrade also translate file names
This was required since Cura 2.1 produced files with the same filename (bar extension). This then resulted in two containers with the same ID. If you had bad luck, an instance container was chosen as global container (depending on which was first in the unordered dictionary). This gives the current settings the postfix _current_settings, fixing that issue.

Contributes to issue CURA-844.
2016-07-07 15:13:58 +02:00
Ghostkeeper
1b0974ba9f Rename translation dicts to plural form
This is more in line with the rest of the code.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
c50619e363 Add additional settings transformations since 2.1
These should be all the settings that were changed since Cura 2.1.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
93041191c2 Move translateVariant to VersionUpgrade21to22
Also make it a dictionary look-up, like the rest, instead of a series of if-statements.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
f13db7de10 Make translatePrinter use dict
A translation dictionary makes it much easier to edit the translations. Also this now just translates one printer, instead of a list.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
88b36ad3d7 Make translateSettingName use dictionary look-up
This solution is a bit neater in code. It makes the function perform a single purpose, since it no longer translates a list of setting names but just one. Also it now neatly puts the translations in a separate, easy-to-modify dict. Only disadvantage is when simple key look-up is not sufficient, such as when renaming lots of settings at once, where substring matching would make the code a bit shorter. But we shouldn't do such a rename anyway.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
f07598a228 Translate profile names too
Not all profile name translations are entered yet, I think. I just did the material ones.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
86544d4172 Fix translate function
It was expected to return a list of translated names, even though it actually translates in-place.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
a87e756a42 Translate machine names
Some names might be changed. I know of at least one: ultimaker2plus -> ultimaker2_plus.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
51aa82bd6c Use preferences upgrader
Instead of the placeholder.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
11d59709ef Add stub preferences converter
Needs to be implemented like the rest of them.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
66df680e1b Move getCfgVersion back inside class
To ask the cfgversion from the actual plug-in is more object-oriented programming.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
5143d0b9f1 Implement getCfgVersion
This code is basically moved from Uranium to here. This is needed to allow for upgrade plug-ins to define their own configuration types.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
28da3c1a4f Improve documentation for translate function
It says now that the function updates the settings to what they should be in the new version.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f7ca489877 Rename exportTo -> export
Because exportTo doesn't make sense if there is no parameter to which we're exporting.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
f2f993916d Rename import/export functions
They no longer mention the version number in their function names. I'd rather have named them import/export but that gave a name clash with Python's 'import' keyword.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
7ad2fbc95d Codestyle: Start comments with space
We didn't really discuss this one, but apparently it's in PEP8 so I'd better do it.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
0e92929be4 Codestyle: Wrap doxygen documentation at 80 chars
Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
41ee575cc1 Correct copyright year
These files were made in 2016.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
cce642a3e1 Extrapolate settings translations
It is now in one place. Or rather, two: There is another function to translate only setting names.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
ccf9796b51 Remove superfluous import
Preferences doesn't exist any more.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00