mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-16 15:32:09 +00:00
Add nozzle flow variant & make some options multi-variant (#13712)
# Description Port BBS per-extruder config variants toggle, thanks Bambu! Also fix invalid num error when resetting multi-variant filament overrides. TODOs: - [x] Make more configs multi-variant (such as speeds) - [x] Add flow variant (normal/high flow) combo box - [x] Add botton to sync config to other variant # Screenshots/Recordings/Graphs <img width="846" height="1494" alt="image" src="https://github.com/user-attachments/assets/47abf053-f5b8-4c86-ac0b-c0323ed8b242" /> <img width="1478" height="1189" alt="707420e5be01c30af3e6ede1f3dc9b67" src="https://github.com/user-attachments/assets/11268712-da65-42ab-9cb8-3cede7790a5c" /> <img width="1478" height="1189" alt="81d5d3877f4d5bf9dccd44d7f0b30aa7" src="https://github.com/user-attachments/assets/cda5ea51-07c3-48fc-bfbb-1428dca14e26" /> ## Tests <!-- > Please describe the tests that you have conducted to verify the changes made in this PR. --> <!-- > A guide for users on how to download the artifacts from this PR. --> [How to Download Pull Requests Artifacts for Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts) Fix #10336
This commit is contained in:
@@ -619,7 +619,7 @@ void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, const bool is_global_config)
|
||||
void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, int variant_index, const bool is_global_config)
|
||||
{
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
|
||||
@@ -643,9 +643,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
||||
|
||||
bool have_perimeters = config->opt_int("wall_loops") > 0;
|
||||
for (auto el : { "extra_perimeters_on_overhangs", "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
|
||||
"seam_position", "staggered_inner_seams", "wall_sequence", "outer_wall_line_width",
|
||||
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
|
||||
"seam_position", "staggered_inner_seams", "wall_sequence", "outer_wall_line_width" })
|
||||
toggle_field(el, have_perimeters);
|
||||
for (auto el : { "inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
|
||||
toggle_field(el, have_perimeters, variant_index);
|
||||
|
||||
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
|
||||
// sparse_infill_filament_id uses the same logic as in Print::extruders()
|
||||
@@ -711,50 +712,47 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
||||
toggle_field("bottom_surface_density", has_bottom_shell);
|
||||
|
||||
for (auto el : { "infill_direction", "sparse_infill_line_width", "gap_fill_target","filter_out_gap_fill","infill_wall_overlap",
|
||||
"sparse_infill_speed", "bridge_speed", "internal_bridge_speed", "bridge_angle", "internal_bridge_angle", "relative_bridge_angle",
|
||||
"bridge_angle", "internal_bridge_angle", "relative_bridge_angle",
|
||||
"solid_infill_direction", "solid_infill_rotate_template", "internal_solid_infill_pattern", "internal_solid_filament_id", "top_surface_filament_id", "bottom_surface_filament_id",
|
||||
})
|
||||
toggle_field(el, have_infill || has_solid_infill);
|
||||
for (auto el : { "sparse_infill_speed", "bridge_speed", "internal_bridge_speed"})
|
||||
toggle_field(el, have_infill || has_solid_infill, variant_index);
|
||||
|
||||
toggle_field("top_shell_thickness", ! has_spiral_vase && has_top_shell);
|
||||
toggle_field("bottom_shell_thickness", ! has_spiral_vase && has_bottom_shell);
|
||||
|
||||
// Gap fill is newly allowed in between perimeter lines even for empty infill (see GH #1476).
|
||||
toggle_field("gap_infill_speed", have_perimeters);
|
||||
toggle_field("gap_infill_speed", have_perimeters, variant_index);
|
||||
|
||||
toggle_field("top_surface_line_width", has_top_shell);
|
||||
toggle_field("top_surface_speed", has_top_shell, variant_index);
|
||||
|
||||
for (auto el : { "top_surface_line_width", "top_surface_speed" })
|
||||
toggle_field(el, has_top_shell);
|
||||
|
||||
bool have_default_acceleration = config->opt_float("default_acceleration") > 0;
|
||||
bool have_default_acceleration = config->opt_float_nullable("default_acceleration", variant_index) > 0;
|
||||
|
||||
for (auto el : {"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "initial_layer_travel_acceleration",
|
||||
"top_surface_acceleration", "travel_acceleration", "bridge_acceleration", "sparse_infill_acceleration", "internal_solid_infill_acceleration"})
|
||||
toggle_field(el, have_default_acceleration);
|
||||
toggle_field(el, have_default_acceleration, variant_index);
|
||||
|
||||
const bool junction_deviation_enabled =
|
||||
gcf_is_marlin_firmware &&
|
||||
[&]() {
|
||||
const auto *machine_jd = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionFloats>("machine_max_junction_deviation");
|
||||
return machine_jd && !machine_jd->values.empty() && machine_jd->values.front() > 0.0;
|
||||
}();
|
||||
|
||||
toggle_line("default_junction_deviation", gcf_is_marlin_firmware);
|
||||
toggle_field("default_junction_deviation", junction_deviation_enabled);
|
||||
toggle_field("default_jerk", !junction_deviation_enabled);
|
||||
|
||||
const std::initializer_list<const char*> jerk_options = {
|
||||
"outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk",
|
||||
"initial_layer_travel_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"
|
||||
};
|
||||
|
||||
if (junction_deviation_enabled) {
|
||||
for (auto el : jerk_options)
|
||||
toggle_line(el, false);
|
||||
bool machine_supports_junction_deviation = false;
|
||||
if (gcf_is_marlin_firmware) {
|
||||
if (const auto *machine_jd = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionFloats>("machine_max_junction_deviation")) {
|
||||
machine_supports_junction_deviation = !machine_jd->values.empty() && machine_jd->values.front() > 0.0;
|
||||
}
|
||||
}
|
||||
toggle_line("default_junction_deviation", gcf_is_marlin_firmware, variant_index);
|
||||
if (machine_supports_junction_deviation) {
|
||||
toggle_field("default_junction_deviation", true, variant_index);
|
||||
toggle_field("default_jerk", false, variant_index);
|
||||
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "initial_layer_travel_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"})
|
||||
toggle_line(el, false, variant_index);
|
||||
} else {
|
||||
const bool have_default_jerk = config->has("default_jerk") && config->opt_float("default_jerk") > 0;
|
||||
for (auto el : jerk_options) {
|
||||
toggle_line(el, true);
|
||||
toggle_field(el, have_default_jerk);
|
||||
toggle_field("default_junction_deviation", false, variant_index);
|
||||
toggle_field("default_jerk", true, variant_index);
|
||||
bool have_default_jerk = config->has("default_jerk") && config->opt_float_nullable("default_jerk", variant_index) > 0;
|
||||
for (auto el : { "outer_wall_jerk", "inner_wall_jerk", "initial_layer_jerk", "initial_layer_travel_jerk", "top_surface_jerk", "travel_jerk", "infill_jerk"}) {
|
||||
toggle_line(el, true, variant_index);
|
||||
toggle_field(el, have_default_jerk, variant_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -928,11 +926,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
||||
for (auto el : {"first_layer_flow_ratio", "outer_wall_flow_ratio", "inner_wall_flow_ratio", "overhang_flow_ratio", "sparse_infill_flow_ratio", "internal_solid_infill_flow_ratio", "gap_fill_flow_ratio", "support_flow_ratio", "support_interface_flow_ratio"})
|
||||
toggle_line(el, has_set_other_flow_ratios);
|
||||
|
||||
bool has_overhang_speed = config->opt_bool("enable_overhang_speed");
|
||||
bool has_overhang_speed = config->opt_bool_nullable("enable_overhang_speed", variant_index);
|
||||
for (auto el : {"overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
|
||||
toggle_line(el, has_overhang_speed);
|
||||
toggle_line(el, has_overhang_speed, variant_index);
|
||||
|
||||
toggle_line("slowdown_for_curled_perimeters", has_overhang_speed);
|
||||
toggle_line("slowdown_for_curled_perimeters", has_overhang_speed, variant_index);
|
||||
|
||||
toggle_line("flush_into_objects", !is_global_config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user