mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
ENH: enhance auto flush option
1.Support auto flush when change printer and nozzle volume type jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: I9dfc2fff095bbf1901afe99556d1e57aa225f482 (cherry picked from commit f12305832227940eb0eae05817ad046dd4eff02d)
This commit is contained in:
@@ -1725,19 +1725,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -1 means caculate all
|
||||
auto update_flush_volume = [](int idx = -1) {
|
||||
if (idx < 0) {
|
||||
size_t filament_size = wxGetApp().plater()->get_extruder_colors_from_plater_config().size();
|
||||
for (size_t i = 0; i < filament_size; ++i)
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(i);
|
||||
}
|
||||
else
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
|
||||
};
|
||||
|
||||
|
||||
string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
|
||||
|
||||
if (opt_key_without_idx == "long_retractions_when_cut") {
|
||||
@@ -1748,6 +1735,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
"Although it can notably reduce flush, it may also elevate the risk of nozzle clogs or other printing complications."), "", wxICON_WARNING | wxOK);
|
||||
dialog.ShowModal();
|
||||
}
|
||||
if (wxGetApp().app_config->get("auto_calculate_flush") == "all"){
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (opt_key == "filament_long_retractions_when_cut"){
|
||||
@@ -1759,6 +1749,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
"Please use with the latest printer firmware."), "", wxICON_WARNING | wxOK);
|
||||
dialog.ShowModal();
|
||||
}
|
||||
if (wxGetApp().app_config->get("auto_calculate_flush") == "all"){
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1799,6 +1792,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
tab->update_extruder_variants(extruder_idx);
|
||||
tab->reload_config();
|
||||
}
|
||||
if (wxGetApp().app_config->get("auto_calculate_flush") == "all") {
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(-1,extruder_idx);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_preset_bundle->get_printer_extruder_count() > 1){
|
||||
|
||||
Reference in New Issue
Block a user