Commit Graph

63 Commits

Author SHA1 Message Date
Vojtech Bubnik
aa3231e2c5 Further slimming of Perl bindings. 2022-05-04 19:10:34 +02:00
Vojtech Bubnik
0f3cabb5d9 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.

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:57:05 +02:00
Vojtech Bubnik
d1cfdcb49e Refactoring of StaticPrintConfig & derived classes:
1) Using boost::preprocessor to reduce code duplicities when defining
   new configuration values.
2) Implemented static hash() and operator== on StaticPrintConfig derived
   classes to support hash tables of instances thereof.
2021-04-26 18:37:10 +02:00
Vojtech Bubnik
a9c3d270e6 ConfigOptions: GUI type as enum, not string.
Fixing compilation error in the new Platform code.
Fixing one issue in FDM support after splitting the top/bottom
interface layers.
2021-03-15 09:55:57 +01:00
Vojtech Bubnik
e0b0a2cdcf Fix of previous commit. 2020-09-24 20:32:52 +02:00
tamasmeszaros
89d376dc35 Add min_object_distance method as free function taking ConfigBase argument 2020-04-23 18:17:37 +02:00
bubnikv
6585e58e83 Fix of perl bindings 2019-10-16 11:34:45 +02:00
bubnikv
69c8b1cd21 new cheaper constructor for DynamicPrintConfig from FullPrintConfig:
DynamicPrintConfig::full_print_config()
new cheaper constructors of DynamicConfig / DynamicPrintConfig from ConfigBase
Unit tests: ported test_model from upstream Slic3r, thanks @lordofhyphens
Unit tests refactored to use less autos and initializer lists for readibility,
DynamicPrintConfig is handled by value, not by shared pointer.
2019-10-16 11:16:50 +02:00
bubnikv
c7cc760067 Merge remote-tracking branch 'origin/master' into vb_undo_redo 2019-07-04 20:22:15 +02:00
bubnikv
27ee68d2f9 WIP Undo / Redo: ModelID / ModelBase renamed to ObjectID / ObjectBase 2019-06-27 11:02:45 +02:00
bubnikv
ac6969c992 Reworked the Perl unit / integration tests to use the same Print
interface that the application is using. Old interface used just
for the integration tests was removed.
2019-06-20 20:23:05 +02:00
bubnikv
a61e833536 Implemented the "Support for support enforcers only" quick selection.
Reduced some memory leaks due to the ConfigDef::default_value pointer.
2019-05-03 18:01:39 +02:00
bubnikv
df8d475363 Fixed perl bindings 2019-03-13 16:53:08 +01:00
bubnikv
18025cc669 Reworked the command line interface based on the current state
of the upstream.
Thanks @alexrj, @lordofhyphens for the original code of slic3r.cpp
2019-03-13 15:44:50 +01:00
bubnikv
add45a8f6e Added C++ command line processing, thanks @alexrj and @loh 2018-09-20 16:48:13 +02:00
bubnikv
6b2b970b9a Added machine evelope configuration parameters
(the MachineEnvelopeConfig class).
Added localization support for libslic3r through a callback
(the callback is not registered yet, so the localization does nothing).
Localized the Print::validate() error messages.
2018-06-20 13:57:37 +02:00
bubnikv
b11d9708ed Updated Controller after the presets C++ port. 2017-11-02 21:51:06 +01:00
bubnikv
2455aee97c Further reduction of Perl Config.pm methods. 2017-10-27 18:52:35 +02:00
bubnikv
3bc79e80d5 Fixed configuration & validate C++ ports. 2017-10-27 16:11:06 +02:00
bubnikv
3731820c48 Optimization of the configuration layer:
The values of StaticPrintConfig derived objects were searched by a name
walking through a huge chained if.
Now they are being mapped with a std::map.
Also initialization of StaticPrintConfig classes from their ConfigOptionDef
defaults is done by maintaining a single global definition of each
StaticPrintConfig derived class, and a new instance is initialized
from this static copy.

Also the ConfigOption instances are casted using static_cast
wherever possible, and their types are verified by a virtual type() method.
This approach avoids insiginificant performance penalty of a dynamic_cast.

Also the compare and clone methods were added to ConfigOption,
and the cloning & compare work on binary values, not by serialization.
2017-10-17 16:01:18 +02:00
bubnikv
247070cd82 Fixed a regression bug of Slic3r::encode() / decode() 2017-08-30 14:57:13 +02:00
bubnikv
2ac981e422 Improved error handling when importing configuration from a G-code. 2017-06-14 20:18:46 +02:00
bubnikv
93dce7a2d3 Ported config load / stored to C++, thanks @alexrj
Implemented import of config values from the G-code.
2017-06-14 17:51:14 +02:00
bubnikv
70db88dd90 Improved retract handling on bowden extruders:
Separated deretract speed from a retract speed,
allowed a partial retract before wipe.
2017-05-19 19:24:21 +02:00
AndylgTom
4528f35bc0 Update Config.xsp (#50)
For fix to display Unicode in category
2017-02-28 10:06:03 +01:00
Alessandro Ranellucci
934bd43e35 More refactoring on Config XS bindings 2015-12-16 12:58:06 +01:00
Alessandro Ranellucci
3c862836f2 Refactored the Config XS bindings 2015-12-16 12:33:19 +01:00
Alessandro Ranellucci
4913e90e10 Remove any Perl related code from libslic3r 2015-12-08 00:39:54 +01:00
Alessandro Ranellucci
3fac8cd77e Large refactoring of the Config classes 2015-12-07 19:39:49 +01:00
Alessandro Ranellucci
3a9cf91f83 Ported a couple more methods to XS 2015-12-02 18:29:33 +01:00
Alessandro Ranellucci
249088b4f8 Ported Config::setenv() to XS 2015-07-01 18:18:25 +02:00
Alessandro Ranellucci
70601eeb51 Tell what options were changed when prompting user for saving a modified preset. Also, check whether the preset was actually modified by performing a proper idempotent diff. #2165 2014-12-25 17:35:31 +01:00
Alessandro Ranellucci
2c64c3dd5b Bugfix: spiral vase was not working when extrusion axis was not E. #2350 2014-11-23 18:59:18 +01:00
Alessandro Ranellucci
3e4c572164 Ported some methods including add_model_object() and apply_config() to XS 2014-11-09 12:25:59 +01:00
Alessandro Ranellucci
e521475b7e Refactoring: moved some low-level G-code generation methods to the new Slic3r::GCode::Base class 2014-10-18 17:41:21 +02:00
Alessandro Ranellucci
6adc3477c9 Moved C++ code into new libslic3r directory 2014-08-03 19:42:29 +02:00
Alessandro Ranellucci
b9e8fbacb7 Put the Default Extruder option in a less confusing position 2014-06-19 20:07:16 +02:00
Alessandro Ranellucci
ee2c1c6127 Refactored the Slic3r::GCode logic for speeds 2014-05-13 08:34:21 +02:00
Alessandro Ranellucci
76a8ec3d9e Replace to_SV_ref() and to_SV_clone_ref() with templated glue functions 2014-05-08 14:52:48 +02:00
Petr Ledvina
028ef3a868 Add missing perlglue.hpp to xsp files
perlglue was missing in some xsp files. If file ordering ib XS.c is changed, header file could be missing. Maybe solves #2000
2014-05-02 14:08:44 +02:00
Alessandro Ranellucci
7041ebdd22 Workaround for upstream module bug causing command line option parsing for multi-boolean options like retract-layer-change and wipe 2014-04-19 19:14:41 +02:00
Alessandro Ranellucci
071097d3f1 Fix extruder assignment and tests 2014-03-27 00:01:33 +01:00
Alessandro Ranellucci
0ff33f47f1 Fix the extruder override logic. All role-based extruder options now default to 0, meaning no override is defined and the default (inherited) extruder is used. The default extruder option does not use the shortcut logic anymore (it was thus moved to be a CLI-specific logic) 2014-03-26 00:08:15 +01:00
Alessandro Ranellucci
7a58457add Prevent GUI from crashing when invalid values were written in numeric fields. Includes basic validation. #1709 2014-03-24 01:07:30 +01:00
Alessandro Ranellucci
7421a7bf63 Turn fill_density into percentage 2014-03-22 16:23:33 +01:00
Alessandro Ranellucci
691db31da0 Some incomplete work for per-region config 2014-02-14 22:26:00 +01:00
Alessandro Ranellucci
cfc1c5037d Mark strings as UTF-8 when passing them to Perl 2014-02-14 22:25:59 +01:00
Alessandro Ranellucci
42519174cd New erase() method for DynamicConfig objects 2014-01-22 21:15:19 +01:00
Alessandro Ranellucci
c523ddea35 Fix option names not showing in plater object settings 2014-01-05 14:58:41 +01:00
Alessandro Ranellucci
07b9b12475 Make tests pass 2014-01-05 00:36:33 +01:00