45 Commits

Author SHA1 Message Date
Ghostkeeper
2d41a992f1
Remove splitting profiles for each material
The material is no longer listed in the profiles and no longer filtered for, so we don't need to create a new profile for each material.

Contributes to issues CURA-844 and CURA-2320.
2016-10-06 11:41:39 +02:00
Ghostkeeper
3f85ac264c
Properly serialise the machine instance name
Otherwise we get spaces and unescaped plusses in the file name of the user profile.

Contributes to issue CURA-844.
2016-09-21 17:34:22 +02:00
Ghostkeeper
ebb9507083
Add extension to new file
The upgrade plug-in can do this because he know that he's upgrading to version 2.3.

Contributes to issue CURA-844.
2016-09-21 17:34:22 +02:00
Ghostkeeper
7d41c1dcb3
Give canonical name to user settings
All user profiles are named Current settings, so we should just give it the same name as well.

Contributes to issue CURA-844.
2016-09-21 17:34:22 +02:00
Ghostkeeper
d962cad347
Ensure directory exists to store user profile in
Create it if it doesn't exist. Also fix up the directory to be absolute instead of relative.

Contributes to issue CURA-844.
2016-09-21 17:34:22 +02:00
Ghostkeeper
c1a593c3d8
Create new user profile upon upgrading machine instance
This defines a new configuration type: 'user', for the user profile.

Contributes to issue CURA-844.
2016-09-21 17:34:22 +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
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
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
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
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
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
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
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
28cc1e8cf7 Translate material, variant and profile along
They might not exist any more because the relation of profiles to printers changed from 2.1 to 2.2 for some machines (notably the UM2+ variants). But then it'll just make it empty when loading.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
fbffff4c8d Write list creation as literal
Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
2de811accf Update how machine instances are translated to stacks
Lots of things have changed in how this works. Sadly, I can't translate things like the material, from PLA to ultimaker2_plus_0.4mm_pla. Not without implementing the entire container registry in the plug-in anyway.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
07b6507133 Fix calls to translateSettings and translateSettingNames
They are one module deeper, due to the way that plug-ins are imported by Uranium.

Contributes to issue CURA-844.
2016-07-07 13:46:40 +02:00
Ghostkeeper
24946d3f13 Fix references to exception classes
These were moved to VersionUpgrade module.

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
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
f7be4831b8 Add translation for combing
Combing was made into an enum instead of a boolean.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
149e873eb6 Pass strings to writing configparser
When setting fields in configparser, it must be a string. No ints.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
aeecdd9e0e Add self to parameters of function
Yeah this was a method, not a static method.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
816e94c760 Fix multiple exceptions
Turns out that this syntax needs to be surrounded in brackets.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
724f9ce010 Return None if config file wasn't correct
This was actually specified in the original function description.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
0d553c10f1 Fix import of SettingsError
It is in a submodule.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
00f356f06e Add translation of speed_support_lines
This setting had its key changed to speed_support_infill

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
b643fe8fd0 Translucent translation of machine instances
Machine instances are translucently translated from version 1 to version 2. No setting changes are applied yet, nor has the format itself changed.

Contributes to issue CURA-844.
2016-07-07 13:46:39 +02:00
Ghostkeeper
2f4e63a944 Add boilerplate version upgrade plug-in
This plug-in does nothing at the moment. It merely says that it is able to upgrade configuration from version 2.1 to 2.2, but then raises exceptions when you actually try to use it. This is by design. I will now implement the functions that do the conversion.

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