mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-18 22:31:13 -06:00
Added an option to enable multiple bed type support for printers
This commit is contained in:
parent
c4538ae0a4
commit
c02d2c4db3
6 changed files with 36 additions and 33 deletions
|
@ -1132,6 +1132,7 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
// Orca:: show device tab based on vendor type
|
||||
auto p_mainframe = wxGetApp().mainframe;
|
||||
p_mainframe->show_device(is_bbl_vendor);
|
||||
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||
|
||||
if (is_bbl_vendor) {
|
||||
//only show connection button for not-BBL printer
|
||||
|
@ -1140,32 +1141,9 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
ams_btn->Show();
|
||||
//update print button default value for bbl or third-party printer
|
||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
||||
AppConfig* config = wxGetApp().app_config;
|
||||
if (config && !config->get("curr_bed_type").empty()) {
|
||||
int bed_type_idx = 0;
|
||||
std::string str_bed_type = config->get("curr_bed_type");
|
||||
int bed_type_value = (int)btPC;
|
||||
try {
|
||||
bed_type_value = atoi(str_bed_type.c_str());
|
||||
} catch(...) {}
|
||||
bed_type_idx = bed_type_value - 1;
|
||||
m_bed_type_list->SelectAndNotify(bed_type_idx);
|
||||
} else {
|
||||
BedType bed_type = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle);
|
||||
m_bed_type_list->SelectAndNotify((int)bed_type - 1);
|
||||
}
|
||||
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();
|
||||
ams_btn->Hide();
|
||||
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||
auto print_btn_type = MainFrame::PrintSelectType::eExportGcode;
|
||||
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
|
||||
if(!url.empty())
|
||||
|
@ -1182,7 +1160,23 @@ void Sidebar::update_all_preset_comboboxes()
|
|||
}
|
||||
p_mainframe->set_print_button_to_default(print_btn_type);
|
||||
|
||||
m_bed_type_list->SelectAndNotify(btPEI-1);
|
||||
}
|
||||
|
||||
if (is_bbl_vendor || cfg.opt_bool("support_multi_bed_types")) {
|
||||
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 {
|
||||
BedType bed_type = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle);
|
||||
m_bed_type_list->SelectAndNotify((int) bed_type - 1);
|
||||
}
|
||||
} else {
|
||||
m_bed_type_list->SelectAndNotify(btPEI - 1);
|
||||
m_bed_type_list->Disable();
|
||||
}
|
||||
|
||||
|
|
|
@ -3029,6 +3029,7 @@ void TabFilament::build()
|
|||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||
optgroup->append_line(line);
|
||||
|
||||
optgroup = page->new_optgroup(L("Bed temperature"), L"param_temperature");
|
||||
line = { L("Cool plate"), L("Bed temperature when cool plate is installed. Value 0 means the filament does not support to print on the Cool Plate") };
|
||||
line.append_option(optgroup->get_option("cool_plate_temp_initial_layer"));
|
||||
line.append_option(optgroup->get_option("cool_plate_temp"));
|
||||
|
@ -3278,23 +3279,22 @@ void TabFilament::toggle_options()
|
|||
wxGetApp().preset_bundle->is_bbl_vendor();
|
||||
}
|
||||
|
||||
auto cfg = m_preset_bundle->printers.get_edited_preset().config;
|
||||
if (m_active_page->title() == L("Cooling")) {
|
||||
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
|
||||
for (auto el : {"overhang_fan_speed", "overhang_fan_threshold"})
|
||||
toggle_option(el, has_enable_overhang_bridge_fan);
|
||||
|
||||
toggle_option(
|
||||
"additional_cooling_fan_speed",
|
||||
m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionBool>("auxiliary_fan")->value);
|
||||
toggle_option("additional_cooling_fan_speed", cfg.opt_bool("auxiliary_fan"));
|
||||
}
|
||||
if (m_active_page->title() == L("Filament"))
|
||||
{
|
||||
bool pa = m_config->opt_bool("enable_pressure_advance", 0);
|
||||
toggle_option("pressure_advance", pa);
|
||||
|
||||
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
|
||||
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
|
||||
auto support_multi_bed_types = is_BBL_printer || cfg.opt_bool("support_multi_bed_types");
|
||||
toggle_line("cool_plate_temp_initial_layer", support_multi_bed_types );
|
||||
toggle_line("eng_plate_temp_initial_layer", support_multi_bed_types);
|
||||
toggle_line("textured_plate_temp_initial_layer", support_multi_bed_types);
|
||||
|
||||
}
|
||||
if (m_active_page->title() == L("Setting Overrides"))
|
||||
|
@ -3407,6 +3407,7 @@ void TabPrinter::build_fff()
|
|||
optgroup->append_single_option_line(option);
|
||||
// optgroup->append_single_option_line("printable_area");
|
||||
optgroup->append_single_option_line("printable_height");
|
||||
optgroup->append_single_option_line("support_multi_bed_types");
|
||||
optgroup->append_single_option_line("nozzle_volume");
|
||||
optgroup->append_single_option_line("best_object_pos");
|
||||
optgroup->append_single_option_line("z_offset");
|
||||
|
@ -4058,7 +4059,7 @@ void TabPrinter::toggle_options()
|
|||
toggle_line(el, is_BBL_printer);
|
||||
|
||||
// SoftFever: hide non-BBL settings
|
||||
for (auto el : {"use_firmware_retraction", "use_relative_e_distances"})
|
||||
for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types"})
|
||||
toggle_line(el, !is_BBL_printer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue