Fix issue that when swtiching to other printer from H2D/H2S, an empty preset dirty dialog will pop up

This commit is contained in:
Noisyfox
2025-10-06 20:25:34 +08:00
parent 551be1c18b
commit fb4bb83546
4 changed files with 30 additions and 1 deletions

View File

@@ -181,6 +181,10 @@
"0",
"0"
],
"retract_lift_enforce": [
"All Surfaces",
"All Surfaces"
],
"retraction_length": [
"0.8",
"0.8"
@@ -222,6 +226,10 @@
"0.4",
"0.4"
],
"travel_slope": [
"3",
"3"
],
"z_hop_types": [
"Auto Lift",
"Auto Lift"

View File

@@ -298,6 +298,12 @@
"324",
"324"
],
"retract_lift_enforce": [
"All Surfaces",
"All Surfaces",
"All Surfaces",
"All Surfaces"
],
"retract_restart_extra": [
"0",
"0",
@@ -358,6 +364,12 @@
"0.4",
"0.4"
],
"travel_slope": [
"3",
"3",
"3",
"3"
],
"z_hop_types": [
"Auto Lift",
"Auto Lift",

View File

@@ -7461,6 +7461,9 @@ void PrintConfigDef::handle_legacy_composite(DynamicPrintConfig &config)
const PrintConfigDef print_config_def;
// Orca: important! For EVERY options listed in EVERY sets below, you MUST specify the proper default value for H2D(fdm_bbl_3dp_002_common.json) and H2S(Bambu Lab H2S 0.4 nozzle.json) preset!
// Otherwise you will have modified presets dialog when you switch the profile.
//todo
std::set<std::string> print_options_with_variant = {
//"initial_layer_speed",

View File

@@ -8505,9 +8505,15 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
preset->is_visible = true; // force visible
preset_name = preset->name;
}
std::string old_preset_name = wxGetApp().preset_bundle->printers.get_edited_preset().name;
update_objects_position_when_select_preset([this, &preset_type, &preset_name]() {
wxWindowUpdateLocker noUpdates2(sidebar->filament_panel());
wxGetApp().get_tab(preset_type)->select_preset(preset_name);
// update plater with new config
q->on_config_change(wxGetApp().preset_bundle->full_config());
});
if (old_preset_name != preset_name && wxGetApp().app_config->get("auto_calculate_flush") == "all") {
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(-1);