NEW:add "bed type to follow machine preset" function

Jira: STUDIO-5535
Change-Id: I2ef99a0a783a074d9379685adde11fddfd6f8cec
This commit is contained in:
zhou.xu
2023-12-14 22:08:53 +08:00
committed by Lane.Wei
parent ece83b13c8
commit 4b8f9a4cc6
10 changed files with 150 additions and 24 deletions
+2 -1
View File
@@ -172,7 +172,8 @@ void AppConfig::set_defaults()
if (get("zoom_to_mouse").empty())
set_bool("zoom_to_mouse", false);
if (get("user_bed_type").empty())
set_bool("user_bed_type", true);
//#ifdef SUPPORT_SHOW_HINTS
if (get("show_hints").empty())
set_bool("show_hints", true);
+2
View File
@@ -57,6 +57,7 @@
#define BBL_JSON_KEY_FAMILY "family"
#define BBL_JSON_KEY_BED_MODEL "bed_model"
#define BBL_JSON_KEY_BED_TEXTURE "bed_texture"
#define BBL_JSON_KEY_DEFAULT_BED_TYPE "default_bed_type"
#define BBL_JSON_KEY_HOTEND_MODEL "hotend_model"
#define BBL_JSON_KEY_DEFAULT_MATERIALS "default_materials"
#define BBL_JSON_KEY_MODEL_ID "model_id"
@@ -112,6 +113,7 @@ public:
// Vendor & Printer Model specific print bed model & texture.
std::string bed_model;
std::string bed_texture;
std::string default_bed_type;
std::string hotend_model;
PrinterVariant* variant(const std::string &name) {
+3
View File
@@ -3170,6 +3170,9 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
else if (boost::iequals(it.key(), BBL_JSON_KEY_BED_MODEL)) {
//get bed model
model.bed_model = it.value();
} else if (boost::iequals(it.key(), BBL_JSON_KEY_DEFAULT_BED_TYPE)) {
// get bed type
model.default_bed_type = it.value();
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_BED_TEXTURE)) {
//get bed texture