hide/disable options accordingly

This commit is contained in:
SoftFever 2024-07-23 00:43:12 +08:00
parent c36d4ad7c9
commit b0bd16e908
3 changed files with 19 additions and 11 deletions

View file

@ -2233,7 +2233,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
this->placeholder_parser().set("current_object_idx", 0); this->placeholder_parser().set("current_object_idx", 0);
// For the start / end G-code to do the priming and final filament pull in case there is no wipe tower provided. // For the start / end G-code to do the priming and final filament pull in case there is no wipe tower provided.
this->placeholder_parser().set("has_wipe_tower", has_wipe_tower); this->placeholder_parser().set("has_wipe_tower", has_wipe_tower);
this->placeholder_parser().set("has_single_extruder_multi_material_priming", has_wipe_tower && print.config().single_extruder_multi_material_priming); this->placeholder_parser().set("has_single_extruder_multi_material_priming", !is_bbl_printers && has_wipe_tower && print.config().single_extruder_multi_material_priming);
this->placeholder_parser().set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change). this->placeholder_parser().set("total_toolchanges", std::max(0, print.wipe_tower_data().number_of_toolchanges)); // Check for negative toolchanges (single extruder mode) and set to 0 (no tool change).
this->placeholder_parser().set("num_extruders", int(print.config().nozzle_diameter.values.size())); this->placeholder_parser().set("num_extruders", int(print.config().nozzle_diameter.values.size()));
this->placeholder_parser().set("retract_length", new ConfigOptionFloats(print.config().retraction_length)); this->placeholder_parser().set("retract_length", new ConfigOptionFloats(print.config().retraction_length));
@ -2475,7 +2475,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
} }
// Orca: support extruder priming // Orca: support extruder priming
if (! (has_wipe_tower && print.config().single_extruder_multi_material_priming)) if (is_bbl_printers || ! (has_wipe_tower && print.config().single_extruder_multi_material_priming))
{ {
// Set initial extruder only after custom start G-code. // Set initial extruder only after custom start G-code.
// Ugly hack: Do not set the initial extruder if the extruder is primed using the MMU priming towers at the edge of the print bed. // Ugly hack: Do not set the initial extruder if the extruder is primed using the MMU priming towers at the edge of the print bed.
@ -2606,7 +2606,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
//BBS //BBS
file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height")); file.write(m_writer.travel_to_z(initial_layer_print_height + m_config.z_offset.value, "Move to the first layer height"));
if (print.config().single_extruder_multi_material_priming) { if (!is_bbl_printers && print.config().single_extruder_multi_material_priming) {
file.write(m_wipe_tower->prime(*this)); file.write(m_wipe_tower->prime(*this));
// Verify, whether the print overaps the priming extrusions. // Verify, whether the print overaps the priming extrusions.
BoundingBoxf bbox_print(get_print_extrusions_extents(print)); BoundingBoxf bbox_print(get_print_extrusions_extents(print));

View file

@ -666,6 +666,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
// toggle_field(el, have_sequential_printing); // toggle_field(el, have_sequential_printing);
toggle_field("print_order", !have_sequential_printing); toggle_field("print_order", !have_sequential_printing);
toggle_field("single_extruder_multi_material", !is_BBL_Printer);
auto bSEMM = preset_bundle->printers.get_edited_preset().config.opt_bool("single_extruder_multi_material");
toggle_field("ooze_prevention", !bSEMM);
bool have_ooze_prevention = config->opt_bool("ooze_prevention"); bool have_ooze_prevention = config->opt_bool("ooze_prevention");
toggle_line("standby_temperature_delta", have_ooze_prevention); toggle_line("standby_temperature_delta", have_ooze_prevention);
toggle_line("preheat_time", have_ooze_prevention); toggle_line("preheat_time", have_ooze_prevention);
@ -676,9 +681,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
for (auto el : { "prime_tower_width", "prime_tower_brim_width"}) for (auto el : { "prime_tower_width", "prime_tower_brim_width"})
toggle_line(el, have_prime_tower); toggle_line(el, have_prime_tower);
auto bSEMM = preset_bundle->printers.get_edited_preset().config.opt_bool("single_extruder_multi_material");
toggle_field("purge_in_prime_tower", bSEMM);
for (auto el : {"wall_filament", "sparse_infill_filament", "solid_infill_filament", "wipe_tower_filament"}) for (auto el : {"wall_filament", "sparse_infill_filament", "solid_infill_filament", "wipe_tower_filament"})
toggle_line(el, !bSEMM); toggle_line(el, !bSEMM);
@ -689,7 +691,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
"wipe_tower_bridging", "wipe_tower_extra_flow", "wipe_tower_bridging", "wipe_tower_extra_flow",
"wipe_tower_no_sparse_layers", "wipe_tower_no_sparse_layers",
"single_extruder_multi_material_priming"}) "single_extruder_multi_material_priming"})
toggle_line(el, have_prime_tower); toggle_line(el, have_prime_tower && !is_BBL_Printer);
toggle_line("prime_volume",have_prime_tower && (!purge_in_primetower || !bSEMM)); toggle_line("prime_volume",have_prime_tower && (!purge_in_primetower || !bSEMM));

View file

@ -4447,8 +4447,14 @@ void TabPrinter::toggle_options()
if (m_active_page->title() == L("Multimaterial")) { if (m_active_page->title() == L("Multimaterial")) {
// SoftFever: hide specific settings for BBL printer // SoftFever: hide specific settings for BBL printer
for (auto el : for (auto el : {
{"purge_in_prime_tower", "enable_filament_ramming", "cooling_tube_retraction", "cooling_tube_length", "parking_pos_retraction", "extra_loading_move", "high_current_on_filament_swap", }) "enable_filament_ramming",
"cooling_tube_retraction",
"cooling_tube_length",
"parking_pos_retraction",
"extra_loading_move",
"high_current_on_filament_swap",
})
toggle_option(el, !is_BBL_printer); toggle_option(el, !is_BBL_printer);
auto bSEMM = m_config->opt_bool("single_extruder_multi_material"); auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
@ -4459,7 +4465,7 @@ void TabPrinter::toggle_options()
} }
toggle_option("extruders_count", !bSEMM); toggle_option("extruders_count", !bSEMM);
toggle_option("manual_filament_change", bSEMM); toggle_option("manual_filament_change", bSEMM);
toggle_option("purge_in_prime_tower", bSEMM); toggle_option("purge_in_prime_tower", bSEMM && !is_BBL_printer);
} }
wxString extruder_number; wxString extruder_number;
long val = 1; long val = 1;