345 Commits

Author SHA1 Message Date
Ghostkeeper
5c49adc52e
Also return tuple if upgrading failed
It is checked if the file data is None or empty (the upgrade is then considered 'failed'). But to unpack the file data, it needs to be a tuple.

Contributes to issue CURA-844.
2016-09-14 15:41:32 +02:00
Ghostkeeper
89fb92edbd
Disable upgrading current settings altogether
The current settings in 2.1 specified a machine instance. In 2.2 they specify a machine definition. There is not enough information in one file to be able to translate that.

Contributes to issue CURA-844.
2016-09-13 14:58:13 +02:00
Ghostkeeper
03c3b2ac2f
Make empty profile for current settings when upgrading from UM2+
This change causes the stack to make a new profile at the top to store current settings in.

Contributes to issue CURA-844.
2016-09-09 17:23:13 +02:00
Ghostkeeper
1e23141b18 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-09 16:20:06 +02:00
Ghostkeeper
ba6ce52d29 Use translation of built-in profiles instead of constructing it
Makes the code much simpler, though some repetition is hard-coded now.

Contributes to issue CURA-844.
2016-09-09 16:20:06 +02:00
Ghostkeeper
e77ab83084 Set quality to normal, not quality type
Even though this key says it's quality, it's not a quality profile, it's a quality type.

Contributes to issue CURA-844.
2016-09-09 16:20:06 +02:00
Ghostkeeper
318b6cf87b Always set type to quality_changes
Custom profiles are always quality changes. They should always say quality in the original anyway; that was an assumption we've made thousands of times.

Contributes to issue CURA-844.
2016-09-09 16:20:06 +02:00
Ghostkeeper
a4c47f26d6 Always set quality type to normal
We don't know the actual quality type, the quality profile that this profile is based on. Maybe there isn't one, even. As a solution we always base imported custom quality profiles on normal.

Contributes to issue CURA-844.
2016-09-09 16:20:06 +02:00
Ghostkeeper
84e91e2bf2 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-09 16:20:06 +02:00
Simon Edwards
cce94c8043 Added skin_overlap <= infill_overlap mapping.
Contributes to CURA-844 Profile converter 2.1 ==> 2.2
2016-09-07 11:32:25 +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
Ghostkeeper
b836311d67
Remove double type-metadata
One was in metadata. That is the correct one. The other is unnecessary and was being ignored, but we don't need to write it.

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
fieldOfView
86ad1777af Fix setting weight of upgraded profile
self._weight sometimes becomes an int, and ConfigParser does not like ints.
2016-08-23 13:54:03 +02:00
Ghostkeeper
a0df0c76de
Use correct material profile in extruder stack
The material profile is more specific inside a material profile if the machine has material quality profiles.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +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
9c7a28fa2d
Don't break if current settings machine is unknown
Currently it sets the user profile to 'empty', which is bad because empty is read-only. But it allows me to continue for now. I'll find a solution for that later.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
36b027b290
Fix copying ConfigParser
Turns out that copy.copy() doesn't work on ConfigParsers. It returns a different instance but modifying that instance still modifies the old configs. Deep copy isn't allowed. But this dictionary copy works.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
71505a8b35
Use normal config only if not material(-specific) profile
Other profiles should just return an array with only their single profile.

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
7481f0802e
Split profiles into multiple if new printer has material profiles
If the old profile didn't specify any material, it would be global. But if the new machine specifies that its profiles are material-specific, these profiles have to be split into multiple profiles in order to be able to show them in Cura 2.2.

Contributes to issue CURA-844.
2016-08-09 18:06:23 +02:00
Ghostkeeper
af86375ba3
Output arrays of files rather than a single file
This is needed because the version upgrade system now allows for a version upgrader to output any number of files.

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
b33c2f9c25
Even better fallbacks for unknown subprofiles
These fallbacks specify their types so that they can be found with the filters.

Contributes to issue CURA-844.
2016-07-13 12:06:18 +02:00
Ghostkeeper
6fbac2f7ee Better fallbacks if MachineInstance missing profiles
They now fallback to "empty" so that it can still construct a valid
instance, albeit with a missing profile (such as material), if some
profile is missing from the original machine instance file.

Contributes to issue CURA-844.
2016-07-11 00:49:18 +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
19b4ec655e Move some things to metadata section
Why there is a difference between 'general' and 'metadata', only His Noodleness knows. Also put in a default for the type. It should apparently be 'quality' unless it is a user profile.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
8f34186a9b Rename settings section to values
It should be called 'values' in the new version.

Contributes to issue CURA-844.
2016-07-07 13:51:41 +02:00
Ghostkeeper
b841738b76 Translate variants in profile
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
439629d0b5 Translate variants and machine names
I'm not quite pleased with the variant translation being inside this function, so I'll move it to VersionUpgrade21to22 soon I think.

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
b5efb2eee8 Make profile translation use new translateSettingName
Forgot about this one.

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
7939a03114 Fix translating current_settings
It is not entirely accurate in the translated version, since the new current_settings is not machine-dependent any more. However, without information on the original file name, this is as good as it gets, since that instance profile there only mentions the machine it is dependent on in the file name.

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
39212a601e Fix import
Didn't see this due to the sea of errors that it gives.

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