84 Commits

Author SHA1 Message Date
supermerill
7d2fa12f92 update string for new "bad setting" dialog 2021-08-21 02:49:14 +02:00
remi durand
f34a3b1a6f Merge branch 'dev' into merill-merge 2021-08-08 01:06:02 +02:00
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
remi durand
33e033cfc5 fix localization 2021-07-01 09:54:56 +02:00
bubnikv
3782d6a864 Forward compatibility, parameter susbtitution: Substitute vector values
(extruder specific) with their default, if the default
is a single value vector.
Show the "Physical Printers" label in the substitution window.
2021-07-01 08:44:02 +02:00
bubnikv
e7a6323470 Configuration compatibility - implemented substitution and reporting for vectors
of bools (including the nullable bools).
2021-06-30 18:55:43 +02:00
bubnikv
ab5e02f20c Fix of the previous commit. 2021-06-30 16:52:55 +02:00
bubnikv
21cbcd876a Forward compatibility - config substitutions:
1) Verify whether a value looks like an enum
2) Always report substitution of an enum with a boolean.
2021-06-30 16:19:06 +02:00
Vojtech Bubnik
28472ee03f Renamed "marlinfirmware" G-code flavor to "marlin2". 2021-06-29 15:48:41 +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
226bf929fb Fixed loading of system presets with incompatible system profile keys
before the "reconfigure" dialog is shown.

Replaced boost::filesystem::copy_file() with Slic3r::copy_file()
in config snapshot loading code.
2021-06-28 17:26:59 +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
remi durand
573d2d8a22 fix spacing doesn't do anything until width is modified
supermerill/SuperSlicer#1341
2021-06-24 20:34:01 +02:00
remi durand
e371b3088f changes in french localization 2021-06-24 01:37:55 +02:00
remi durand
bcbe5178de deprecated use of (int) vs int32_t for config storage
and add phony to cereal serialization for history storage.
2021-06-01 19:56:16 +02:00
remi durand
833edf1d28 fix for macos: phony is stored on 4 bytes 2021-05-20 11:10:28 +02:00
remi durand
b6891a036d securing thread-safe StaticConfig creations
supermerill/SuperSlicer#1110
2021-05-02 17:04:28 +02:00
remi durand
b6d278a36f Add 'export to prusa' menu item
An other way to transfert a config to prusa, with the .3mf file.
It's more mandatory now that there is extrusion_spacing
2021-04-25 03:15:55 +02:00
remi durand
715d58da88 Add some spacing settings at the side of width
- now a setting can be "phony"
 - a phony setting isn't saved in a config file
 - a phony setting should be computed from other settings
 - change/add colors, icons, and callbacks (in PrintConfig.cpp) to make phony settings works
2021-04-25 03:15:40 +02:00
Joseph Lenox
194fb73249 Update branding. 2021-04-02 21:44:31 -05:00
Joseph Lenox
181b1e73dc Silence warnings: add cases for hollowing and milling_extruders, catch reference for polymorphic exception 2021-04-02 21:38:28 -05:00
remi durand
eb8a08dade Get most of software name from the define. 2021-03-30 19:40:11 +02:00
remi durand
a50b4cd544 Merge tag 'version_2.3.0'
version_2.3.0
2021-02-22 13:28:28 +01:00
remi durand
ca3d8239c4 Merge remote-tracking branch 'remotes/prusa/master' 2021-01-09 17:11:12 +01:00
Vojtech Bubnik
fb29325b14 Fix of G-code Viewer not loading .gco files #5536
".gcode", ".gco", ".g" and ".ngc" were considered to be G-code file
extensions by the G-code import / export file dialogs, but not by
various other functions. Now the G-code extension is tested by
a single function is_gcode_file(string).
2021-01-05 12:26:11 +01:00
Vojtech Bubnik
7b9f2093bb Configuration layer: Support for vectors of FloatsOrPercents and
FloatsOrPercentsNullable, to support further filament overrides
of Print preset values, namely Avoid Crossing Perimeters.
2020-12-14 15:58:47 +01:00
supermerill
19d2115f20 allow bad key/value from imported .3mf/gcode
these will be silently ignored and so the default value will be used.
2020-11-28 20:50:24 +01:00
supermerill
db21177093 Fix various config display problems
- typo
 - missing ironing name
 - sort after translation
2020-11-26 19:18:30 +01:00
supermerill
1a19b023f0 Merge remote-tracking branch 'remotes/prusa/master'
note: new infill connect, maybe a good idea to get the previous one in case it's better (no useless lines)
note2: fillline overextrude, tofix
2020-11-23 00:28:47 +01:00
supermerill
47886f241c #305 fix brim height
(missing get_abs)
2020-11-15 19:11:13 +01:00
David Kocik
0a4ce079e8 escape_ampersand function and changed order of printer names and pictures in config wizard 2020-11-11 16:08:27 +01:00
supermerill
6fdd615b6e Merge remote-tracking branch 'remotes/prusa/master' into dev 2020-10-18 00:27:32 +02:00
Vojtech Bubnik
067cde85f1 WIP Refactoring of exceptions:
1) All slicer's exceptions are now derived from Slic3r::Exception.
2) New exceptions are defined for slicing errors.
3) Exceptions are propagated to the Plater to show.
It remains to modify the slicing back-end to throw the new SlicingError
exceptions instead of std::runtime_error and to show the other exceptions
by a message dialog instead of a notification.
2020-09-14 18:03:22 +02:00
supermerill
653aa22757 #279 fix milling icon. 2020-06-11 21:07:34 +02:00
supermerill
2f31776ca6 #269 fix to makes it recognize slic3r++ config from gcode 2020-06-05 16:52:22 +02: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
supermerill
5fbc891707 Slic3r++ to SuperSlicer renamed in all files.
and going to version 51
2020-05-30 03:52:56 +02:00
supermerill
c4140ef707 little update to config: debug message & fill_smooth_distribution type 2020-05-09 00:59:51 +02:00
bubnikv
b843a094f6 Slic3r::format(), Slic3r::GUI::format_wxstr():
wrappers around boost::format using C++17 variadic templates,
replacing the ugly and verbose
	(boost::format("template") % arg1 % arg2).str()
syntax.
The wrappers also implictely convert input parameters including the template
from wxString to UTF8.

The new format wrapper has been applied at multiple places as a start,
also some double macros _(L()) with new single macro _L().
2020-04-01 09:49:04 +02:00
supermerill
f087cf1239 Merge remote-tracking branch 'remotes/prusa/master'
seems to work
need to update profiles & ui
2020-03-26 12:10:30 +01:00
bubnikv
8d7f88b381 Imported error reporting when loading presets with option keys
or option values that our poor software does not understand.
This applies to configs added by some forks of slic3r, for example
slic3r++
PrusaSlicer has encountered an error: Failed loading the preset file: #3909
2020-03-25 16:04:11 +01:00
bubnikv
059bdb4711 Implemented handling of complex ConfigOptionFloatOrPercent chains
by the PlaceholderParser.

Namely, all the options with the "ratio_over" reference are now handled
correctly by the PlaceholderParser with the exception
of the "first_layer_extrusion_width", which overrides speed of extrusions
by their respective extrusion type.

Also the various extrusion widths (extrusion_width, first_layer_extrusion_width,
external_perimeter_extrusion_width etc.) produce the same numbers
as if ran through the back-end, with the assumption of not overriding
layer height by the variable layer height editing tool or layer height
modifiers.
2020-02-04 15:27:38 +01:00
bubnikv
9406b50447 Const correctness improvements:
removed some unnecessary const_casts that remove const.
2020-01-03 16:33:04 +01:00
supermerill
b88c58c324 Merge commit '305ccfd9072dffdad7a9c6fa4b3e881d830daee8'
also add a better message when a config bundle is problematic.
2020-01-02 18:25:02 +01:00
bubnikv
fd3651d994 Fixed C++17 incompatibility. 2019-12-18 18:14:06 +01:00
supermerill
dda438c74b Merge commit '5e3e5492487690fb48cd7c4bb0b7e0e019e30a5c' (wip) 2019-12-05 20:53:02 +01:00
supermerill
7854bed9c4 enum for "Add settings" contextual menu
add missing category for options that need it for contextual menu.
todo: refactor even more to have an automatic tab.cpp, via a structured categories->subcat->line object tree created in-place, and also use that to order the contextual menu.
Also use only colored icon, as the greyscale version isn't in the resource repo anymore.
2019-11-04 01:19:01 +01: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
bubnikv
c228a49fe0 Ported test_support_material from upstream Slic3r.
Reworked the FFF testing framework & ConfigBase::set_deserialize()
for more compact tests: set_deserialize() now accepts list
of key / value pairs.

Fixed an incorrect assert in LayerRegion.
2019-10-17 17:09:15 +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