ENH: config: remove unused custome_defined logic

also improve project_embedded
1. remove unused is_custom_defined
2. improve project_embedded to support multi-extruder diff

jira: no-jira

Change-Id: I1db28c3cfd59ccc31c6855af30305396c71c4e9a
(cherry picked from commit 0434853bf32b063f7850fd4e0c9c3a6045375225)
This commit is contained in:
lane.wei
2024-07-10 17:01:53 +08:00
committed by Noisyfox
parent 18e08ec6a1
commit f52dd41b23
11 changed files with 90 additions and 82 deletions

View File

@@ -809,7 +809,7 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
key_values.emplace(BBL_JSON_KEY_VERSION, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_IS_CUSTOM)) {
key_values.emplace(BBL_JSON_KEY_IS_CUSTOM, it.value());
//skip it
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_NAME)) {
key_values.emplace(BBL_JSON_KEY_NAME, it.value());
@@ -1388,15 +1388,13 @@ ConfigSubstitutions ConfigBase::load_from_gcode_file(const std::string &file, Fo
}
//BBS: add json support
void ConfigBase::save_to_json(const std::string &file, const std::string &name, const std::string &from, const std::string &version, const std::string is_custom) const
void ConfigBase::save_to_json(const std::string &file, const std::string &name, const std::string &from, const std::string &version) const
{
json j;
//record the headers
j[BBL_JSON_KEY_VERSION] = version;
j[BBL_JSON_KEY_NAME] = name;
j[BBL_JSON_KEY_FROM] = from;
if (!is_custom.empty())
j[BBL_JSON_KEY_IS_CUSTOM] = is_custom;
//record all the key-values
for (const std::string &opt_key : this->keys())