mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 11:47:54 -06:00
3mf import/export of config data
This commit is contained in:
parent
33553e1c50
commit
8885f5e344
12 changed files with 231 additions and 76 deletions
|
@ -280,8 +280,8 @@ void PresetBundle::load_config_file(const std::string &path)
|
|||
if (boost::iends_with(path, ".gcode") || boost::iends_with(path, ".g")) {
|
||||
DynamicPrintConfig config;
|
||||
config.apply(FullPrintConfig::defaults());
|
||||
config.load_from_gcode(path);
|
||||
Preset::normalize(config);
|
||||
config.load_from_gcode_file(path);
|
||||
Preset::normalize(config);
|
||||
load_config_file_config(path, true, std::move(config));
|
||||
return;
|
||||
}
|
||||
|
@ -320,6 +320,18 @@ void PresetBundle::load_config_file(const std::string &path)
|
|||
}
|
||||
}
|
||||
|
||||
void PresetBundle::load_config_string(const char* str, const char* source_filename)
|
||||
{
|
||||
if (str != nullptr)
|
||||
{
|
||||
DynamicPrintConfig config;
|
||||
config.apply(FullPrintConfig::defaults());
|
||||
config.load_from_gcode_string(str);
|
||||
Preset::normalize(config);
|
||||
load_config_file_config((source_filename == nullptr) ? "" : source_filename, true, std::move(config));
|
||||
}
|
||||
}
|
||||
|
||||
// Load a config file from a boost property_tree. This is a private method called from load_config_file.
|
||||
void PresetBundle::load_config_file_config(const std::string &name_or_path, bool is_external, DynamicPrintConfig &&config)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue