ENH: arachne + overhang slow down

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Ic015c1c6d369edabaa1195416942881c0756f839
This commit is contained in:
qing.zhang 2023-03-22 19:09:27 +08:00 committed by Lane.Wei
parent ad80943c69
commit 97179d1378
4 changed files with 214 additions and 58 deletions

View file

@ -320,35 +320,35 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
}
//BBS
if (config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne &&
config->opt_bool("enable_overhang_speed"))
{
wxString msg_text = _(L("Arachne engine only works when overhang slowing down is disabled.\n"
"This may cause decline in the quality of overhang surface when print fastly")) + "\n";
if (is_global_config)
msg_text += "\n" + _(L("Disable overhang slowing down automatically? \n"
"Yes - Enable arachne and disable overhang slowing down\n"
"No - Give up using arachne this time"));
MessageDialog dialog(m_msg_dlg_parent, msg_text, "",
wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
DynamicPrintConfig new_conf = *config;
is_msg_dlg_already_exist = true;
auto answer = dialog.ShowModal();
bool enable_overhang_slow_down = true;
if (!is_global_config || answer == wxID_YES) {
new_conf.set_key_value("enable_overhang_speed", new ConfigOptionBool(false));
enable_overhang_slow_down = false;
}
else {
new_conf.set_key_value("wall_generator", new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Classic));
}
apply(config, &new_conf);
if (cb_value_change) {
if (!enable_overhang_slow_down)
cb_value_change("enable_overhang_speed", false);
}
is_msg_dlg_already_exist = false;
}
//if (config->opt_enum<PerimeterGeneratorType>("wall_generator") == PerimeterGeneratorType::Arachne &&
// config->opt_bool("enable_overhang_speed"))
//{
// wxString msg_text = _(L("Arachne engine only works when overhang slowing down is disabled.\n"
// "This may cause decline in the quality of overhang surface when print fastly")) + "\n";
// if (is_global_config)
// msg_text += "\n" + _(L("Disable overhang slowing down automatically? \n"
// "Yes - Enable arachne and disable overhang slowing down\n"
// "No - Give up using arachne this time"));
// MessageDialog dialog(m_msg_dlg_parent, msg_text, "",
// wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
// DynamicPrintConfig new_conf = *config;
// is_msg_dlg_already_exist = true;
// auto answer = dialog.ShowModal();
// bool enable_overhang_slow_down = true;
// if (!is_global_config || answer == wxID_YES) {
// new_conf.set_key_value("enable_overhang_speed", new ConfigOptionBool(false));
// enable_overhang_slow_down = false;
// }
// else {
// new_conf.set_key_value("wall_generator", new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Classic));
// }
// apply(config, &new_conf);
// if (cb_value_change) {
// if (!enable_overhang_slow_down)
// cb_value_change("enable_overhang_speed", false);
// }
// is_msg_dlg_already_exist = false;
//}
// BBS
int filament_cnt = wxGetApp().preset_bundle->filament_presets.size();
@ -669,7 +669,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"min_feature_size", "min_bead_width", "wall_distribution_count" })
toggle_line(el, have_arachne);
toggle_field("detect_thin_wall", !have_arachne);
toggle_field("enable_overhang_speed", !have_arachne);
//toggle_field("enable_overhang_speed", !have_arachne);
toggle_field("only_one_wall_top", !have_arachne);
}