diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 519b7ee090..e638a96570 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -878,7 +878,7 @@ static std::vector s_Preset_printer_options { "cooling_tube_retraction", "cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "purge_in_prime_tower", "enable_filament_ramming", "z_offset", - "disable_m73", "preferred_orientation", "emit_machine_limits_to_gcode" + "disable_m73", "preferred_orientation", "emit_machine_limits_to_gcode", "support_multi_bed_types" }; static std::vector s_Preset_sla_print_options { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 25c4619480..c896b112ca 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -294,6 +294,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "enable_filament_ramming" || opt_key == "purge_in_prime_tower" || opt_key == "z_offset" + || opt_key == "support_multi_bed_types" ) { steps.emplace_back(psWipeTower); steps.emplace_back(psSkirtBrim); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a8ed821aea..5efec684ef 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2355,6 +2355,12 @@ def = this->add("filament_loading_speed", coFloats); def->readonly = false; def->set_default_value(new ConfigOptionEnum(gcfMarlinLegacy)); + def = this->add("support_multi_bed_types", coBool); + def->label = L("Support multi bed types"); + def->tooltip = L("Enable this option if you want to use multiple bed types"); + def->mode = comSimple; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("gcode_label_objects", coBool); def->label = L("Label objects"); def->tooltip = L("Enable this to add comments into the G-Code labeling print moves with what object they belong to," diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 3fd07bf93b..aa1c21ce4c 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1051,6 +1051,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloats, filament_multitool_ramming_flow)) ((ConfigOptionBool, purge_in_prime_tower)) ((ConfigOptionBool, enable_filament_ramming)) + ((ConfigOptionBool, support_multi_bed_types)) ) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 9a929a1dd2..a67d09976e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -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(); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 2e86ec4494..1eb72b26c6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -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("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); }