8 Commits

Author SHA1 Message Date
remi durand
f87b5fccde Merge remote-tracking branch 'remotes/prusa/stable' into dev
need to merge profiles
need to test & iron out the PresetConfigSubstitutions thingy
2021-07-10 15:31:19 +02:00
Vojtech Bubnik
745aa3536d Improved error reporting when importing various configuration files:
1) Slic3r::RuntimeError was replaced with ConfigurationError,
   all exceptions thrown by the configuration layer are derived
   from ConfigurationError.
2) When parsing configuration files, ConfigurationError is catched and
   rethrown extended with the file name being parsed.
2021-06-29 15:41:57 +02:00
Vojtech Bubnik
84b28a25e8 Support for forward compatibility of configurations, user and system
config bundles, project files (3MFs, AMFs). When loading these files,
the caller may decide whether to substitute some of the configuration
values the current PrusaSlicer version does not understand with
some reasonable default value, and whether to report it. If substitution
is disabled, an exception is being thrown as before this commit.
If substitution is enabled, list of substitutions is returned by the
API to be presented to the user. This allows us to introduce for example
new firmware flavor key in PrusaSlicer 2.4 while letting PrusaSlicer
2.3.2 to fall back to some default and to report it to the user.

As a preparation for PrusaSlicer 2.4.0, the new firmware_flavor
"marlinfirmware" (signifying Marlin 2.0 and newer) that is not
supported by 2.3.2 yet will default to "marlin" (signifying legacy
Marlin).

When slicing from command line, substutions are performed by default
and reported into the console, however substitutions may be either
disabled or made silent with the new "config-compatibility" command
line option.

Substitute enums and bools only.  Allow booleans to be parsed as
    true: "1", "enabled", "on" case insensitive
    false: "0", "disabled", "off" case insensitive
This will allow us in the future for example to switch the draft_shield
boolean to an enum with the following values: "disabled" / "enabled" / "limited".

Added "enum_bitmask.hpp" - support for type safe sets of options.
See for example PresetBundle::load_configbundle(...
LoadConfigBundleAttributes flags) for an example of intended usage.

WIP: GUI for reporting the list of config substitutions needs to be
implemented by @YuSanka.
2021-06-27 16:14:16 +02:00
Joseph Lenox
3e28eb136c Adjust some branding back to mainline Slic3r;
Move test_data.cpp/hpp out of fff_print so it can be used for config tests.

Add a short test to ensure that z_steps_per_mm config option is converted appropriately.
2021-04-02 21:41:02 -05:00
supermerill
488e4d83e4 Merge remote-tracking branch 'remotes/prusa/master' into dev
optionsgroup is wonky with sizers.
2020-11-05 00:21:16 +01:00
Vojtech Bubnik
3cfccf1a5a Fixed unit tests broken with 3502f256fac0d0793f8314a7ab4a2788e93d74f8 2020-10-29 12:39:03 +01:00
supermerill
1afaa6ef49 create little hierarchy of config to better use ratio_over
fixes on ratio_over
fix Flow::extrusion_width (bad computation of first_layer_height)
fix enum visibility
moving test classes to prusaslicer test directory (wip)
all that because i was trying to write a test class for a modification in min_object_distance (and i didn't even start)
2020-05-31 03:54:58 +02:00
bubnikv
13cc74ef0a Ported test_config.cpp from upstream Slic3r.
Extended ConfigBase with set() functions similar to the upstream Slic3r.
ConfigBase::set_deserialize() newly throws if the operation fails.
Extrusion width parameters are newly tested for negative values.
2019-10-18 11:53:19 +02:00