mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-06-22 14:10:50 +08:00

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.
32 lines
695 B
C++
32 lines
695 B
C++
#ifndef slic3r_GUI_Init_hpp_
|
|
#define slic3r_GUI_Init_hpp_
|
|
|
|
#include <libslic3r/Preset.hpp>
|
|
#include <libslic3r/PrintConfig.hpp>
|
|
|
|
namespace Slic3r {
|
|
|
|
namespace GUI {
|
|
|
|
struct GUI_InitParams
|
|
{
|
|
int argc;
|
|
char **argv;
|
|
|
|
// Substitutions of unknown configuration values done during loading of user presets.
|
|
PresetsConfigSubstitutions preset_substitutions;
|
|
|
|
std::vector<std::string> load_configs;
|
|
DynamicPrintConfig extra_config;
|
|
std::vector<std::string> input_files;
|
|
|
|
bool start_as_gcodeviewer;
|
|
};
|
|
|
|
int GUI_Run(GUI_InitParams ¶ms);
|
|
|
|
} // namespace GUI
|
|
} // namespace Slic3r
|
|
|
|
#endif // slic3r_GUI_Init_hpp_
|