mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -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
|
@ -878,7 +878,7 @@ static std::vector<std::string> s_Preset_printer_options {
|
||||||
"cooling_tube_retraction",
|
"cooling_tube_retraction",
|
||||||
"cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "purge_in_prime_tower", "enable_filament_ramming",
|
"cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "purge_in_prime_tower", "enable_filament_ramming",
|
||||||
"z_offset",
|
"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<std::string> s_Preset_sla_print_options {
|
static std::vector<std::string> s_Preset_sla_print_options {
|
||||||
|
|
|
@ -294,6 +294,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
||||||
|| opt_key == "enable_filament_ramming"
|
|| opt_key == "enable_filament_ramming"
|
||||||
|| opt_key == "purge_in_prime_tower"
|
|| opt_key == "purge_in_prime_tower"
|
||||||
|| opt_key == "z_offset"
|
|| opt_key == "z_offset"
|
||||||
|
|| opt_key == "support_multi_bed_types"
|
||||||
) {
|
) {
|
||||||
steps.emplace_back(psWipeTower);
|
steps.emplace_back(psWipeTower);
|
||||||
steps.emplace_back(psSkirtBrim);
|
steps.emplace_back(psSkirtBrim);
|
||||||
|
|
|
@ -2355,6 +2355,12 @@ def = this->add("filament_loading_speed", coFloats);
|
||||||
def->readonly = false;
|
def->readonly = false;
|
||||||
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfMarlinLegacy));
|
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(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 = this->add("gcode_label_objects", coBool);
|
||||||
def->label = L("Label objects");
|
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,"
|
def->tooltip = L("Enable this to add comments into the G-Code labeling print moves with what object they belong to,"
|
||||||
|
|
|
@ -1051,6 +1051,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||||
((ConfigOptionFloats, filament_multitool_ramming_flow))
|
((ConfigOptionFloats, filament_multitool_ramming_flow))
|
||||||
((ConfigOptionBool, purge_in_prime_tower))
|
((ConfigOptionBool, purge_in_prime_tower))
|
||||||
((ConfigOptionBool, enable_filament_ramming))
|
((ConfigOptionBool, enable_filament_ramming))
|
||||||
|
((ConfigOptionBool, support_multi_bed_types))
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1132,6 +1132,7 @@ void Sidebar::update_all_preset_comboboxes()
|
||||||
// Orca:: show device tab based on vendor type
|
// Orca:: show device tab based on vendor type
|
||||||
auto p_mainframe = wxGetApp().mainframe;
|
auto p_mainframe = wxGetApp().mainframe;
|
||||||
p_mainframe->show_device(is_bbl_vendor);
|
p_mainframe->show_device(is_bbl_vendor);
|
||||||
|
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
||||||
|
|
||||||
if (is_bbl_vendor) {
|
if (is_bbl_vendor) {
|
||||||
//only show connection button for not-BBL printer
|
//only show connection button for not-BBL printer
|
||||||
|
@ -1140,32 +1141,9 @@ void Sidebar::update_all_preset_comboboxes()
|
||||||
ams_btn->Show();
|
ams_btn->Show();
|
||||||
//update print button default value for bbl or third-party printer
|
//update print button default value for bbl or third-party printer
|
||||||
p_mainframe->set_print_button_to_default(MainFrame::PrintSelectType::ePrintPlate);
|
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 {
|
} else {
|
||||||
connection_btn->Show();
|
connection_btn->Show();
|
||||||
ams_btn->Hide();
|
ams_btn->Hide();
|
||||||
auto cfg = preset_bundle.printers.get_edited_preset().config;
|
|
||||||
auto print_btn_type = MainFrame::PrintSelectType::eExportGcode;
|
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");
|
wxString url = cfg.opt_string("print_host_webui").empty() ? cfg.opt_string("print_host") : cfg.opt_string("print_host_webui");
|
||||||
if(!url.empty())
|
if(!url.empty())
|
||||||
|
@ -1182,6 +1160,22 @@ void Sidebar::update_all_preset_comboboxes()
|
||||||
}
|
}
|
||||||
p_mainframe->set_print_button_to_default(print_btn_type);
|
p_mainframe->set_print_button_to_default(print_btn_type);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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->SelectAndNotify(btPEI - 1);
|
||||||
m_bed_type_list->Disable();
|
m_bed_type_list->Disable();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3029,6 +3029,7 @@ void TabFilament::build()
|
||||||
line.append_option(optgroup->get_option("nozzle_temperature"));
|
line.append_option(optgroup->get_option("nozzle_temperature"));
|
||||||
optgroup->append_line(line);
|
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 = { 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_initial_layer"));
|
||||||
line.append_option(optgroup->get_option("cool_plate_temp"));
|
line.append_option(optgroup->get_option("cool_plate_temp"));
|
||||||
|
@ -3278,23 +3279,22 @@ void TabFilament::toggle_options()
|
||||||
wxGetApp().preset_bundle->is_bbl_vendor();
|
wxGetApp().preset_bundle->is_bbl_vendor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto cfg = m_preset_bundle->printers.get_edited_preset().config;
|
||||||
if (m_active_page->title() == L("Cooling")) {
|
if (m_active_page->title() == L("Cooling")) {
|
||||||
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
|
bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0);
|
||||||
for (auto el : {"overhang_fan_speed", "overhang_fan_threshold"})
|
for (auto el : {"overhang_fan_speed", "overhang_fan_threshold"})
|
||||||
toggle_option(el, has_enable_overhang_bridge_fan);
|
toggle_option(el, has_enable_overhang_bridge_fan);
|
||||||
|
|
||||||
toggle_option(
|
toggle_option("additional_cooling_fan_speed", cfg.opt_bool("auxiliary_fan"));
|
||||||
"additional_cooling_fan_speed",
|
|
||||||
m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionBool>("auxiliary_fan")->value);
|
|
||||||
}
|
}
|
||||||
if (m_active_page->title() == L("Filament"))
|
if (m_active_page->title() == L("Filament"))
|
||||||
{
|
{
|
||||||
bool pa = m_config->opt_bool("enable_pressure_advance", 0);
|
bool pa = m_config->opt_bool("enable_pressure_advance", 0);
|
||||||
toggle_option("pressure_advance", pa);
|
toggle_option("pressure_advance", pa);
|
||||||
|
auto support_multi_bed_types = is_BBL_printer || cfg.opt_bool("support_multi_bed_types");
|
||||||
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
|
toggle_line("cool_plate_temp_initial_layer", support_multi_bed_types );
|
||||||
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
|
toggle_line("eng_plate_temp_initial_layer", support_multi_bed_types);
|
||||||
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
|
toggle_line("textured_plate_temp_initial_layer", support_multi_bed_types);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (m_active_page->title() == L("Setting Overrides"))
|
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(option);
|
||||||
// optgroup->append_single_option_line("printable_area");
|
// optgroup->append_single_option_line("printable_area");
|
||||||
optgroup->append_single_option_line("printable_height");
|
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("nozzle_volume");
|
||||||
optgroup->append_single_option_line("best_object_pos");
|
optgroup->append_single_option_line("best_object_pos");
|
||||||
optgroup->append_single_option_line("z_offset");
|
optgroup->append_single_option_line("z_offset");
|
||||||
|
@ -4058,7 +4059,7 @@ void TabPrinter::toggle_options()
|
||||||
toggle_line(el, is_BBL_printer);
|
toggle_line(el, is_BBL_printer);
|
||||||
|
|
||||||
// SoftFever: hide non-BBL settings
|
// 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);
|
toggle_line(el, !is_BBL_printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue