From 826e36fb1e109f0e56adb41aeb776c6dd7eaa81b Mon Sep 17 00:00:00 2001 From: SoftFever Date: Fri, 10 Jul 2026 16:38:46 +0800 Subject: [PATCH] feat(printer): add cooling filter support flag and expose its toggle cooling_filter_enabled existed as a config option but was shown nowhere, and there was no capability flag to gate it. The cooling filter and air filtration are alternative accessories sharing the same duct, so a printer declares one or the other. - new hidden printer capability flag support_cooling_filter - "Use cooling filter" toggle in the Accessory group, shown only when the printer supports it; the air-filtration toggle hides in that case (no vendor restriction: third-party printers keep air filtration) - explicit defaults (0) in the common machine base - H2C declares support_cooling_filter=1 instead of support_air_filtration; its start-gcode already carries the cooling-filter conditional, so the toggle is functional. On H2C this drops the two exhaust-fan lines that air filtration emitted for ABS-class filaments, matching the printer's actual duct accessory; H2C is new on this branch so no existing user output changes. Printers without the flag keep exactly the previous accessory UI and g-code. --- resources/profiles/BBL/machine/Bambu Lab H2C 0.4 nozzle.json | 2 +- resources/profiles/BBL/machine/fdm_machine_common.json | 2 ++ src/libslic3r/Preset.cpp | 2 +- src/libslic3r/PrintConfig.cpp | 5 +++++ src/libslic3r/PrintConfig.hpp | 1 + src/slic3r/GUI/Tab.cpp | 5 +++++ 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/profiles/BBL/machine/Bambu Lab H2C 0.4 nozzle.json b/resources/profiles/BBL/machine/Bambu Lab H2C 0.4 nozzle.json index 270bc67fe6..867e419c60 100644 --- a/resources/profiles/BBL/machine/Bambu Lab H2C 0.4 nozzle.json +++ b/resources/profiles/BBL/machine/Bambu Lab H2C 0.4 nozzle.json @@ -118,7 +118,7 @@ "14" ], "support_chamber_temp_control": "1", - "support_air_filtration": "1", + "support_cooling_filter": "1", "wrapping_exclude_area": [ "145x310", "251x310", diff --git a/resources/profiles/BBL/machine/fdm_machine_common.json b/resources/profiles/BBL/machine/fdm_machine_common.json index 88d8cbd96c..f793f3bc1d 100644 --- a/resources/profiles/BBL/machine/fdm_machine_common.json +++ b/resources/profiles/BBL/machine/fdm_machine_common.json @@ -140,6 +140,8 @@ "silent_mode": "0", "single_extruder_multi_material": "1", "support_air_filtration": "0", + "support_cooling_filter": "0", + "cooling_filter_enabled": "0", "support_chamber_temp_control": "0", "support_fast_purge_mode": "0", "support_object_skip_flush": "0", diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b25d7d5a7f..a0b6c60c7b 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1390,7 +1390,7 @@ static std::vector s_Preset_printer_options { "default_print_profile", "inherits", "silent_mode", "scan_first_layer", "enable_power_loss_recovery", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", - "nozzle_type", "nozzle_hrc","auxiliary_fan", "fan_direction", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","cooling_filter_enabled","printer_structure","farthest_point_timelapse", + "nozzle_type", "nozzle_hrc","auxiliary_fan", "fan_direction", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","support_cooling_filter","cooling_filter_enabled","printer_structure","farthest_point_timelapse", "best_object_pos", "head_wrap_detect_zone", "host_type", "print_host", "printhost_apikey", "flashforge_serial_number", "bbl_use_printhost", "printer_agent", "print_host_webui", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5940aa003e..ec0185d3fe 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -4095,6 +4095,11 @@ void PrintConfigDef::init_fff_params() def->mode=comDevelop; def->set_default_value(new ConfigOptionBool(true)); + // Printer capability flag: switches the accessory UI between air filtration and the cooling filter. + def = this->add("support_cooling_filter", coBool); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("cooling_filter_enabled", coBool); def->label = L("Use cooling filter"); def->tooltip = L("Enable this if printer support cooling filter"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 1e1dae74a7..9d091a7e01 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1503,6 +1503,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, auxiliary_fan)) ((ConfigOptionEnum, fan_direction)) ((ConfigOptionBool, support_air_filtration)) + ((ConfigOptionBool, support_cooling_filter)) ((ConfigOptionBool, cooling_filter_enabled)) ((ConfigOptionEnum,printer_structure)) ((ConfigOptionBool, support_chamber_temp_control)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 929b90da06..595fc3182e 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -4959,6 +4959,7 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("fan_direction"); optgroup->append_single_option_line("support_chamber_temp_control", "printer_basic_information_accessory#support-controlling-chamber-temperature"); optgroup->append_single_option_line("support_air_filtration", "printer_basic_information_accessory#support-air-filtration"); + optgroup->append_single_option_line("cooling_filter_enabled"); auto edit_custom_gcode_fn = [this](const t_config_option_key& opt_key) { edit_custom_gcode(opt_key); }; @@ -5895,6 +5896,10 @@ void TabPrinter::toggle_options() toggle_line("parallel_printheads_count", support_parallel_printheads); toggle_line("fan_direction", m_config->opt_bool("auxiliary_fan")); + + // The cooling filter and air filtration are alternative accessories: show only the one the printer supports. + toggle_line("support_air_filtration", !m_config->opt_bool("support_cooling_filter")); + toggle_line("cooling_filter_enabled", m_config->opt_bool("support_cooling_filter")); }