Correctness fixes. Remove hard-coded appends for printer settings

This commit is contained in:
Lam Wei Lun
2026-09-03 14:12:51 +08:00
parent bcff39661c
commit 904796cf24
3 changed files with 111 additions and 45 deletions
+8 -23
View File
@@ -7,6 +7,7 @@
#include "libslic3r/FilamentMixer.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Model.hpp"
#include "libslic3r/PublishSettings.hpp"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include "Search.hpp"
@@ -5699,32 +5700,16 @@ if (is_marlin_flavor)
optgroup->append_single_option_line("extruder_offset", "printer_extruder_basic_information#extruder-offset-position", extruder_idx);
//BBS: don't show retract related config menu in machine page
// Keep this optgroup's options in sync with publishable_printer_retraction_options()
// in libslic3r/PublishSettings.hpp: the published-3MF printer allowlist is its union
// with the Z-Hop optgroup below.
// These optgroups are built from publishable_printer_retraction/z_hop_options() so the
// published-3MF printer allowlist (their union in libslic3r/PublishSettings.hpp) can
// never drift from what the machine page actually shows.
optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
optgroup->append_single_option_line("retraction_length", "printer_extruder_retraction#length", extruder_idx);
optgroup->append_single_option_line("retract_restart_extra", "printer_extruder_retraction#extra-length-on-restart", extruder_idx);
optgroup->append_single_option_line("retraction_speed", "printer_extruder_retraction#retraction-speed", extruder_idx);
optgroup->append_single_option_line("deretraction_speed", "printer_extruder_retraction#deretraction-speed", extruder_idx);
optgroup->append_single_option_line("retraction_minimum_travel", "printer_extruder_retraction#travel-distance-threshold", extruder_idx);
optgroup->append_single_option_line("retract_when_changing_layer", "printer_extruder_retraction#retract-on-layer-change", extruder_idx);
optgroup->append_single_option_line("wipe", "printer_extruder_retraction#wipe-while-retracting", extruder_idx);
optgroup->append_single_option_line("wipe_distance", "printer_extruder_retraction#wipe-distance", extruder_idx);
optgroup->append_single_option_line("retract_before_wipe", "printer_extruder_retraction#retract-amount-before-wipe", extruder_idx);
// Orca
optgroup->append_single_option_line("retract_after_wipe", "printer_extruder_retraction#retract-amount-after-wipe", extruder_idx);
for (const PublishablePrinterOption& opt : publishable_printer_retraction_options())
optgroup->append_single_option_line(opt.key, opt.icon, extruder_idx);
// Keep this optgroup's options in sync with publishable_printer_z_hop_options()
// in libslic3r/PublishSettings.hpp: the published-3MF printer allowlist is its union
// with the Retraction optgroup above.
optgroup = page->new_optgroup(L("Z-Hop"), L"param_extruder_lift_enforcement");
optgroup->append_single_option_line("retract_lift_enforce", "printer_extruder_z_hop#on-surfaces", extruder_idx);
optgroup->append_single_option_line("z_hop_types", "printer_extruder_z_hop#z-hop-type", extruder_idx);
optgroup->append_single_option_line("z_hop", "printer_extruder_z_hop#z-hop-height", extruder_idx);
optgroup->append_single_option_line("travel_slope", "printer_extruder_z_hop#traveling-angle", extruder_idx);
optgroup->append_single_option_line("retract_lift_above", "printer_extruder_z_hop#only-lift-z-above", extruder_idx);
optgroup->append_single_option_line("retract_lift_below", "printer_extruder_z_hop#only-lift-z-below", extruder_idx);
for (const PublishablePrinterOption& opt : publishable_printer_z_hop_options())
optgroup->append_single_option_line(opt.key, opt.icon, extruder_idx);
optgroup = page->new_optgroup(L("Retraction when switching material"), L"param_retraction_material_change");
optgroup->append_single_option_line("retract_length_toolchange", "printer_extruder_retraction#retraction-when-switching-materials", extruder_idx);