FIX: no need to set spiral vase again if it's already eanbled

jira: 6516

Change-Id: I58e44001ebad9581c1a133c20a1beaa7d880b151
This commit is contained in:
liz.li 2024-03-22 11:35:26 +08:00 committed by Lane.Wei
parent 6c12b711fa
commit f26df7e6ae
1 changed files with 24 additions and 8 deletions

View File

@ -283,6 +283,8 @@ void PartPlate::set_spiral_vase_mode(bool spiral_mode, bool as_global)
m_config.erase(key);
else {
if (spiral_mode) {
if (get_spiral_vase_mode())
return;
// Secondary confirmation
auto answer = static_cast<TabPrintPlate*>(wxGetApp().plate_tab)->show_spiral_mode_settings_dialog(false);
if (answer == wxID_YES) {
@ -2359,16 +2361,30 @@ void PartPlate::set_vase_mode_related_object_config(int obj_id) {
}
else
obj_ptrs = get_objects_on_this_plate();
DynamicPrintConfig* global_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
DynamicPrintConfig new_conf;
new_conf.set_key_value("wall_loops", new ConfigOptionInt(1));
new_conf.set_key_value("top_shell_layers", new ConfigOptionInt(0));
new_conf.set_key_value("sparse_infill_density", new ConfigOptionPercent(0));
new_conf.set_key_value("enable_support", new ConfigOptionBool(false));
new_conf.set_key_value("enforce_support_layers", new ConfigOptionInt(0));
new_conf.set_key_value("ensure_vertical_shell_thickness", new ConfigOptionBool(true));
new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
auto applying_keys = global_config->diff(new_conf);
for (ModelObject* object : obj_ptrs) {
ModelConfigObject& config = object->config;
config.set_key_value("wall_loops", new ConfigOptionInt(1));
config.set_key_value("top_shell_layers", new ConfigOptionInt(0));
config.set_key_value("sparse_infill_density", new ConfigOptionPercent(0));
config.set_key_value("enable_support", new ConfigOptionBool(false));
config.set_key_value("enforce_support_layers", new ConfigOptionInt(0));
config.set_key_value("ensure_vertical_shell_thickness", new ConfigOptionBool(true));
config.set_key_value("detect_thin_wall", new ConfigOptionBool(false));
config.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
for (auto opt_key : applying_keys) {
config.set_key_value(opt_key, new_conf.option(opt_key)->clone());
}
applying_keys = config.get().diff(new_conf);
for (auto opt_key : applying_keys) {
config.set_key_value(opt_key, new_conf.option(opt_key)->clone());
}
}
//wxGetApp().obj_list()->update_selections();
}