mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 23:01:22 -06:00
QoL: remember each printer's filament/bed/process settings (#1592)
* init work TODO: 1. support multi filament 2. support project * Properly handle filament number change when switching printers
This commit is contained in:
parent
6aa3e400d1
commit
7f6f01c4c9
6 changed files with 159 additions and 27 deletions
|
@ -773,8 +773,8 @@ Sidebar::Sidebar(Plater *parent)
|
|||
ScalableButton* add_btn = new ScalableButton(p->m_panel_filament_title, wxID_ANY, "add_filament");
|
||||
add_btn->SetToolTip(_L("Add one filament"));
|
||||
add_btn->Bind(wxEVT_BUTTON, [this, scrolled_sizer](wxCommandEvent& e){
|
||||
// BBS: limit filament choices to 16
|
||||
if (p->combos_filament.size() >= 16)
|
||||
// Orca: limit filament choices to 64
|
||||
if (p->combos_filament.size() >= 64)
|
||||
return;
|
||||
|
||||
int filament_count = p->combos_filament.size() + 1;
|
||||
|
@ -1035,7 +1035,13 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
//update print button default value for bbl or third-party printer
|
||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
||||
m_bed_type_list->Enable();
|
||||
|
||||
auto str_bed_type = wxGetApp().app_config->get_printer_setting(wxGetApp().preset_bundle->printers.get_selected_preset_name(), "curr_bed_type");
|
||||
if(!str_bed_type.empty()){
|
||||
int bed_type_value = atoi(str_bed_type.c_str());
|
||||
if(bed_type_value == 0)
|
||||
bed_type_value = 1;
|
||||
m_bed_type_list->SelectAndNotify(bed_type_value - 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
connection_btn->Show();
|
||||
|
@ -5591,6 +5597,8 @@ void Plater::priv::on_select_bed_type(wxCommandEvent &evt)
|
|||
// update app_config
|
||||
AppConfig* app_config = wxGetApp().app_config;
|
||||
app_config->set("curr_bed_type", std::to_string(int(new_bed_type)));
|
||||
app_config->set_printer_setting(wxGetApp().preset_bundle->printers.get_selected_preset_name(),
|
||||
"curr_bed_type", std::to_string(int(new_bed_type)));
|
||||
|
||||
//update slice status
|
||||
auto plate_list = partplate_list.get_plate_list();
|
||||
|
|
|
@ -1641,6 +1641,12 @@ void Tab::on_presets_changed()
|
|||
if (wxGetApp().plater() == nullptr)
|
||||
return;
|
||||
|
||||
// Orca: update presets for the selected printer
|
||||
if(m_type == Preset::TYPE_PRINTER) {
|
||||
m_preset_bundle->update_selections(*wxGetApp().app_config);
|
||||
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
|
||||
}
|
||||
|
||||
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
|
||||
wxGetApp().plater()->sidebar().update_presets(m_type);
|
||||
|
||||
|
@ -1652,6 +1658,7 @@ void Tab::on_presets_changed()
|
|||
else
|
||||
wxGetApp().plater()->get_partplate_list().set_render_option(false, true);
|
||||
|
||||
|
||||
// Printer selected at the Printer tab, update "compatible" marks at the print and filament selectors.
|
||||
for (auto t: m_dependent_tabs)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue