NEW: add align_to_y_axis option for auto-arrange

1. Add align_to_y_axis option for auto-arrange.
   This is useful for auto-arranging of i3 type printers.
2. Change default value of align_to_origin to true when switching
   from non-i3 printers to i3 printers.

JIRA: STUDIO-2583

Change-Id: I7dabab846022a0da030a9fec060a60a4207537a0
(cherry picked from commit 9c549c18ecc1f513644e1bc4a60d6936721a13ac)
This commit is contained in:
manch1n 2023-08-18 19:47:35 +08:00 committed by Lane.Wei
parent 971d219d75
commit 2a79af5729
8 changed files with 143 additions and 7 deletions

View file

@ -1194,8 +1194,17 @@ void Sidebar::update_presets(Preset::Type preset_type)
printer_tab->update();
}
bool isBBL = wxGetApp().preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(wxGetApp().preset_bundle);
Preset& printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
bool isBBL = printer_preset.is_bbl_vendor_preset(wxGetApp().preset_bundle);
wxGetApp().mainframe->show_calibration_button(!isBBL);
if (auto printer_structure_opt = printer_preset.config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure")) {
wxGetApp().plater()->get_current_canvas3D()->get_arrange_settings().align_to_y_axis = (printer_structure_opt->value == PrinterStructure::psI3);
}
else
wxGetApp().plater()->get_current_canvas3D()->get_arrange_settings().align_to_y_axis = false;
break;
}
@ -5803,7 +5812,7 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
//! combo->GetString(combo->GetSelection())
//! instead of
//! combo->GetStringSelection().ToUTF8().data());
std::string preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type,
Preset::remove_suffix_modified(combo->GetString(selection).ToUTF8().data()));