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:
xun.zhang
2025-02-17 21:21:10 +08:00
committed by Noisyfox
parent 27b16455b7
commit 0af34f4324
6 changed files with 158 additions and 130 deletions

View File

@@ -1049,10 +1049,8 @@ PreferencesDialog::PreferencesDialog(wxWindow *parent, wxWindowID id, const wxSt
if (agent) {
json j;
std::string value;
value = wxGetApp().app_config->get("auto_calculate");
value = wxGetApp().app_config->get("auto_calculate_flush");
j["auto_flushing"] = value;
value = wxGetApp().app_config->get("auto_calculate_when_filament_change");
j["auto_calculate_when_filament_change"] = value;
agent->track_event("preferences_changed", j.dump());
}
} catch(...) {}
@@ -1226,8 +1224,8 @@ wxWindow* PreferencesDialog::create_general_page()
auto item_show_splash_screen = create_item_checkbox(_L("Show splash screen"), page, _L("Show the splash screen during startup."), 50, "show_splash_screen");
auto item_hints = create_item_checkbox(_L("Show \"Tip of the day\" notification after start"), page, _L("If enabled, useful hints are displayed at startup."), 50, "show_hints");
auto item_calc_mode = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time the color changed."), page, _L("If enabled, auto-calculate every time the color changed."), 50, "auto_calculate");
auto item_calc_in_long_retract = create_item_checkbox(_L("Flushing volumes: Auto-calculate every time when the filament is changed."), page, _L("If enabled, auto-calculate every time when filament is changed"), 50, "auto_calculate_when_filament_change");
std::vector<wxString> FlushOptions = {_L("all"),_L("color change"),_L("disabled")};
auto item_auto_flush = create_item_combobox(_L("Auto Flush"), page ,_L("Auto calculate flush volumes"), "auto_calculate_flush",FlushOptions);
auto item_remember_printer_config = create_item_checkbox(_L("Remember printer configuration"), page, _L("If enabled, Orca will remember and switch filament/process configuration for each printer automatically."), 50, "remember_printer_config");
auto item_step_mesh_setting = create_item_checkbox(_L("Show the step mesh parameter setting dialog."), page, _L("If enabled,a parameter settings dialog will appear during STEP file import."), 50, "enable_step_mesh_setting");
auto item_multi_machine = create_item_checkbox(_L("Multi-device Management (Take effect after restarting Orca Slicer)."), page, _L("With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices."), 50, "enable_multi_machine");
@@ -1310,6 +1308,7 @@ wxWindow* PreferencesDialog::create_general_page()
sizer_page->Add(item_language, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_region, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_currency, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_auto_flush, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_default_page, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_camera_navigation_style, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_single_instance, 0, wxTOP, FromDIP(3));
@@ -1320,13 +1319,11 @@ wxWindow* PreferencesDialog::create_general_page()
sizer_page->Add(camera_orbit_mult, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_show_splash_screen, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_hints, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_calc_in_long_retract, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_multi_machine, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_step_mesh_setting, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_auto_arrange, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_mix_print_high_low_temperature, 0, wxTOP, FromDIP(3));
sizer_page->Add(title_presets, 0, wxTOP | wxEXPAND, FromDIP(20));
sizer_page->Add(item_calc_mode, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_user_sync, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_system_sync, 0, wxTOP, FromDIP(3));
sizer_page->Add(item_remember_printer_config, 0, wxTOP, FromDIP(3));