Keep downstream customization limited to printer profiles

Extract non-profile changes into a separate development line while preserving all profile content.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Eric McCann
2026-09-29 22:42:50 -04:00
co-authored by Codex
parent 9590d71fd9
commit d58c3b0d89
10 changed files with 64 additions and 188 deletions
@@ -314,13 +314,6 @@ DynamicPrintConfig slice_config(PresetBundle &bundle)
fmap[i] = int(i % nozzles) + 1;
}
// A fresh printer selection uses its declared nozzle volumes, just like the
// app. Otherwise a high-flow preset is silently sliced with Standard tuning.
bundle.reset_default_nozzle_volume_type();
auto &filament_map = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
bundle.project_config.option<ConfigOptionInts>("filament_volume_map", true)->values =
bundle.get_default_nozzle_volume_types_for_filaments(filament_map);
DynamicPrintConfig cfg = bundle.full_config();
cfg.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); // force a purge tower so the change is detectable
// The map above drives full_config()'s per-filament variant collapse; fmmManual on the sliced config
-13
View File
@@ -9463,19 +9463,6 @@ std::set<std::string> print_options_with_variant = {
std::set<std::string> filament_options_with_variant = {
"filament_flow_ratio",
"filament_max_volumetric_speed",
// Variant arrays use element zero when the selected column is absent.
// A singleton therefore retains the same tuning for every nozzle variant.
"enable_pressure_advance",
"pressure_advance",
"fan_min_speed",
"fan_max_speed",
"additional_cooling_fan_speed",
"filament_minimal_purge_on_wipe_tower",
"filament_multitool_ramming",
"filament_multitool_ramming_volume",
"filament_multitool_ramming_flow",
"nozzle_temperature_range_low",
"nozzle_temperature_range_high",
// Per-variant ramming / pre-cooling / nozzle-change filament overrides
"filament_ramming_volumetric_speed",
"filament_pre_cooling_temperature",
+12 -12
View File
@@ -78,12 +78,12 @@ void ConfigManipulation::set_option_label(const std::string& opt_key, const wxSt
cb_set_option_label(opt_key, label, opt_index);
}
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index) {
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config) {
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
// Get the selected filament type
std::string filament_type = "";
@@ -123,16 +123,16 @@ void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrint
}
}
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config, unsigned int variant_index)
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config)
{
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
if (config->has("nozzle_temperature")) {
if (config->opt_int("nozzle_temperature", variant_index) < temperature_range_low || config->opt_int("nozzle_temperature", variant_index) > temperature_range_high) {
if (config->opt_int("nozzle_temperature", 0) < temperature_range_low || config->opt_int("nozzle_temperature", 0) > temperature_range_high) {
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
@@ -143,17 +143,17 @@ void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *conf
}
}
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index)
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config)
{
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
if (config->has("nozzle_temperature_initial_layer")) {
if (config->opt_int("nozzle_temperature_initial_layer", variant_index) < temperature_range_low ||
config->opt_int("nozzle_temperature_initial_layer", variant_index) > temperature_range_high)
if (config->opt_int("nozzle_temperature_initial_layer", 0) < temperature_range_low ||
config->opt_int("nozzle_temperature_initial_layer", 0) > temperature_range_high)
{
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
@@ -1295,15 +1295,15 @@ int ConfigManipulation::show_spiral_mode_settings_dialog(bool is_object_config)
return answer;
}
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index)
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high)
{
bool range_low_exist = false, range_high_exist = false;
if (config->has("nozzle_temperature_range_low")) {
range_low = config->opt_int("nozzle_temperature_range_low", variant_index);
range_low = config->opt_int("nozzle_temperature_range_low", (unsigned int) 0);
range_low_exist = true;
}
if (config->has("nozzle_temperature_range_high")) {
range_high = config->opt_int("nozzle_temperature_range_high", variant_index);
range_high = config->opt_int("nozzle_temperature_range_high", (unsigned int) 0);
range_high_exist = true;
}
return range_low_exist && range_high_exist;
+4 -4
View File
@@ -79,9 +79,9 @@ public:
void apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase*, ModelConfig*> const & configs);
//BBS: FFF filament nozzle temperature range
void check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index = 0);
void check_nozzle_temperature_range(DynamicPrintConfig* config, unsigned int variant_index = 0);
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index = 0);
void check_nozzle_recommended_temperature_range(DynamicPrintConfig *config);
void check_nozzle_temperature_range(DynamicPrintConfig* config);
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config);
void check_adaptive_pressure_advance_model(DynamicPrintConfig* config);
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
void check_chamber_temperature(DynamicPrintConfig* config);
@@ -104,7 +104,7 @@ public:
int show_spiral_mode_settings_dialog(bool is_object_config = false);
private:
bool get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index);
bool get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high);
};
} // GUI
-5
View File
@@ -8895,11 +8895,6 @@ void GUI_App::load_current_presets(bool active_preset_combox/*= false*/, bool ch
if (active_preset_combox)
tab->reactive_preset_combo_box();
}
// Preset loading can resize the filament list without an extruder-count change event.
// Refresh the controls even when the list already matches the printer's nozzle count.
if (printer_technology == ptFFF)
this->plater()->on_filament_count_change(preset_bundle->filament_presets.size());
// BBS: model config
for (Tab *tab : model_tabs_list)
if (tab->supports_printer_technology(printer_technology)) {
+4 -11
View File
@@ -1803,10 +1803,8 @@ bool Sidebar::priv::switch_diameter_to(const wxString &diameter)
auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(printer_preset.config.option("nozzle_diameter"));
if (nozzle_diameter && nozzle_diameter->size() > 0) {
auto current_nozzle_dia = get_diameter_string(nozzle_diameter->values[0]);
// A named variant can share this diameter; selecting the plain diameter
// must still switch back to the standard profile.
if (current_nozzle_dia == diameter.ToStdString() &&
printer_preset.config.opt_string("printer_variant") == diameter.ToStdString()) {
// If the selected diameter is the same as current nozzle, don't switch profiles
if (current_nozzle_dia == diameter.ToStdString()) {
return true;
}
}
@@ -3928,18 +3926,13 @@ void Sidebar::update_presets(Preset::Type preset_type)
combo_flow->Show(combo_flow->GetCount() > 0);
};
auto update_extruder_diameter = [&diameters, &nozzle_diameter, &diameter](int extruder_index,ExtruderGroup & extruder) {
auto update_extruder_diameter = [&diameters, &nozzle_diameter](int extruder_index,ExtruderGroup & extruder) {
extruder.combo_diameter->Clear();
if (extruder_index >= int(nozzle_diameter->values.size()))
return;
int select = -1;
// ORCA get the actual nozzle diameter from printer config
auto nozzle_dia = get_diameter_string(nozzle_diameter->values[extruder_index]);
// Named variants such as "0.4HS" and "0.4 High Flow" share a physical diameter.
// Retain the variant selection unless the diameter was customized.
const auto selected_variant =
diameter.substr(0, diameter.find_first_not_of("0123456789.")) == nozzle_dia &&
std::find(diameters.begin(), diameters.end(), diameter) != diameters.end() ? diameter : nozzle_dia;
// ORCA try to add nozzle diameter from config if list is empty. fixes blank nozzle combo box when preset has no alias
if(!diameters.empty() && diameters[0].empty() && !nozzle_dia.empty()){
diameters[0] = nozzle_dia;
@@ -3949,7 +3942,7 @@ void Sidebar::update_presets(Preset::Type preset_type)
diameters.push_back(nozzle_dia);
}
for (size_t i = 0; i < diameters.size(); ++i) {
if (diameters[i] == selected_variant)
if (diameters[i] == nozzle_dia)
select = extruder.combo_diameter->GetCount();
extruder.combo_diameter->Append(diameters[i], {});
}
+25 -23
View File
@@ -4396,16 +4396,16 @@ void TabFilament::build()
optgroup->append_single_option_line("temperature_vitrification", "material_basic_information#softening-temperature");
optgroup->append_single_option_line("idle_temperature", "material_basic_information#idle-temperature");
Line line = { L("Recommended nozzle temperature"), L("Recommended nozzle temperature range of this filament. 0 means not set") };
line.append_option(optgroup->get_option("nozzle_temperature_range_low", 0));
line.append_option(optgroup->get_option("nozzle_temperature_range_high", 0));
line.append_option(optgroup->get_option("nozzle_temperature_range_low"));
line.append_option(optgroup->get_option("nozzle_temperature_range_high"));
optgroup->append_line(line);
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) {
DynamicPrintConfig &filament_config = m_preset_bundle->filaments.get_edited_preset().config;
update_dirty();
if (!m_postpone_update_ui && (opt_key.substr(0, opt_key.find('#')) == "nozzle_temperature_range_low" || opt_key.substr(0, opt_key.find('#')) == "nozzle_temperature_range_high")) {
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config, m_variant_combo ? std::max(0, m_variant_combo->GetSelection()) : 0);
if (!m_postpone_update_ui && (opt_key == "nozzle_temperature_range_low" || opt_key == "nozzle_temperature_range_high")) {
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config);
}
on_value_change(opt_key, value);
};
@@ -4532,11 +4532,11 @@ void TabFilament::build()
else if (opt_key == "textured_plate_temp" || opt_key == "textured_plate_temp_initial_layer") {
m_config_manipulation.check_bed_temperature_difference(BedType::btPTE, &filament_config);
}
else */if (opt_key.substr(0, opt_key.find('#')) == "nozzle_temperature") {
m_config_manipulation.check_nozzle_temperature_range(&filament_config, m_variant_combo ? std::max(0, m_variant_combo->GetSelection()) : 0);
else */if (opt_key == "nozzle_temperature") {
m_config_manipulation.check_nozzle_temperature_range(&filament_config);
}
else if (opt_key.substr(0, opt_key.find('#')) == "nozzle_temperature_initial_layer") {
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config, m_variant_combo ? std::max(0, m_variant_combo->GetSelection()) : 0);
else if (opt_key == "nozzle_temperature_initial_layer") {
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config);
}
on_value_change(opt_key, value);
@@ -4571,12 +4571,12 @@ void TabFilament::build()
optgroup = page->new_optgroup(L("Part cooling fan"), L"param_cooling_part_fan");
line = { L("Min fan speed threshold"), L("The part cooling fan will run at the minimum fan speed when the estimated layer time is longer than the threshold value. When the layer time is shorter than the threshold, the fan speed will be interpolated between the minimum and maximum fan speed according to layer printing time.") };
line.label_path = "material_cooling#material-part-cooling-fan";
line.append_option(optgroup->get_option("fan_min_speed", 0));
line.append_option(optgroup->get_option("fan_min_speed"));
line.append_option(optgroup->get_option("fan_cooling_layer_time"));
optgroup->append_line(line);
line = { L("Max fan speed threshold"), L("The part cooling fan will run at maximum speed when the estimated layer time is shorter than the threshold value.") };
line.label_path = "material_cooling#material-part-cooling-fan";
line.append_option(optgroup->get_option("fan_max_speed", 0));
line.append_option(optgroup->get_option("fan_max_speed"));
line.append_option(optgroup->get_option("slow_down_layer_time"));
optgroup->append_line(line);
optgroup->append_single_option_line("reduce_fan_stop_start_freq", "material_cooling#keep-fan-always-on");
@@ -4592,7 +4592,7 @@ void TabFilament::build()
optgroup->append_single_option_line("ironing_fan_speed", "material_cooling#ironing-fan-speed"); // ORCA: Add support for ironing fan speed control
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_aux_fan");
optgroup->append_single_option_line("additional_cooling_fan_speed", "material_cooling#auxiliary-part-cooling-fan", 0);
optgroup->append_single_option_line("additional_cooling_fan_speed", "material_cooling#auxiliary-part-cooling-fan");
optgroup = page->new_optgroup(L("Exhaust fan"),L"param_cooling_exhaust");
@@ -4656,7 +4656,7 @@ void TabFilament::build()
page = add_options_page(L("Multimaterial"), "custom-gcode_multi_material"); // ORCA: icon only visible on placeholders
optgroup = page->new_optgroup(L("Wipe tower parameters"), "param_tower");
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower", "material_multimaterial#multimaterial-wipe-tower-parameters", 0);
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_tower_interface_pre_extrusion_dist", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_tower_interface_pre_extrusion_length", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_tower_ironing_area", "material_multimaterial#multimaterial-wipe-tower-parameters");
@@ -4700,9 +4700,9 @@ void TabFilament::build()
});
optgroup = page->new_optgroup(L("Tool change parameters with multi extruder MM printers"), "param_toolchange_multi_extruder");
optgroup->append_single_option_line("filament_multitool_ramming", "material_multimaterial#tool-change-parameters-with-multi-extruder", 0);
optgroup->append_single_option_line("filament_multitool_ramming_volume", "material_multimaterial#multi-tool-ramming-volume", 0);
optgroup->append_single_option_line("filament_multitool_ramming_flow", "material_multimaterial#multi-tool-ramming-flow", 0);
optgroup->append_single_option_line("filament_multitool_ramming", "material_multimaterial#tool-change-parameters-with-multi-extruder");
optgroup->append_single_option_line("filament_multitool_ramming_volume", "material_multimaterial#multi-tool-ramming-volume");
optgroup->append_single_option_line("filament_multitool_ramming_flow", "material_multimaterial#multi-tool-ramming-flow");
page = add_options_page(L("Dependencies"), "advanced");
optgroup = page->new_optgroup(L("Compatible printers"), "param_dependencies_printers");
@@ -4772,7 +4772,6 @@ void TabFilament::update_description_lines()
void TabFilament::toggle_options()
{
const int variant_index = m_variant_combo ? std::max(0, m_variant_combo->GetSelection()) : 0;
if (!m_active_page)
return;
bool is_BBL_printer = false;
@@ -4814,7 +4813,7 @@ void TabFilament::toggle_options()
}
}
toggle_line("additional_cooling_fan_speed", printer_cfg.opt_bool("auxiliary_fan"), 256 + variant_index);
toggle_line("additional_cooling_fan_speed", printer_cfg.opt_bool("auxiliary_fan"));
bool support_air_filtration = printer_cfg.opt_bool("support_air_filtration");
for (auto el : {"activate_air_filtration", "during_print_exhaust_fan_speed", "complete_print_exhaust_fan_speed"})
@@ -4830,8 +4829,11 @@ void TabFilament::toggle_options()
}
if (m_active_page->title() == L("Filament"))
{
bool pa = m_config->opt_bool("enable_pressure_advance", variant_index);
toggle_option("pressure_advance", pa, 256 + variant_index);
const int selection = m_variant_combo ? m_variant_combo->GetSelection() : 0;
const unsigned int variant_idx = (unsigned int) std::max(selection, 0);
bool pa = m_config->opt_bool("enable_pressure_advance", variant_idx);
toggle_option("pressure_advance", pa, 0);
//Orca: Enable the plates that should be visible when multi bed support is enabled or a BBL printer is selected; otherwise, enable only the plate visible for the selected bed type.
DynamicConfig& proj_cfg = m_preset_bundle->project_config;
@@ -4885,11 +4887,11 @@ void TabFilament::toggle_options()
for (auto el : {"filament_minimal_purge_on_wipe_tower", "filament_loading_speed_start", "filament_loading_speed",
"filament_unloading_speed_start", "filament_unloading_speed", "filament_toolchange_delay", "filament_cooling_moves",
"filament_cooling_initial_speed", "filament_cooling_final_speed"})
toggle_option(el, !is_BBL_printer, filament_options_with_variant.count(el) ? 256 + variant_index : -1);
toggle_option(el, !is_BBL_printer);
bool multitool_ramming = m_config->opt_bool("filament_multitool_ramming", variant_index);
toggle_option("filament_multitool_ramming_volume", multitool_ramming, 256 + variant_index);
toggle_option("filament_multitool_ramming_flow", multitool_ramming, 256 + variant_index);
bool multitool_ramming = m_config->opt_bool("filament_multitool_ramming", 0);
toggle_option("filament_multitool_ramming_volume", multitool_ramming);
toggle_option("filament_multitool_ramming_flow", multitool_ramming);
bool is_BBL_multi_extruder = is_BBL_printer && printer_cfg.option<ConfigOptionFloats>("nozzle_diameter")->size() > 1;
const int selection = m_variant_combo ? m_variant_combo->GetSelection() : 0;