From 977ae079c80c96e2f8c4316fe638e0062b021707 Mon Sep 17 00:00:00 2001 From: "xun.zhang" Date: Tue, 1 Aug 2023 10:14:22 +0800 Subject: [PATCH] ENH: add support for chamber_temp and exhaust_fan Support controlling chamebr temperature and exhaust fan for air filtration Signed-off-by: xun.zhang Change-Id: I31627ce4f8acce99e132b0436ab7dcd0bcebf81d (cherry picked from commit 215878864e1410085ddf9735595e1b1cb00c1e47) --- src/libslic3r/GCode.cpp | 42 ++++++++++++++++++++ src/libslic3r/GCode.hpp | 1 + src/libslic3r/GCode/GCodeProcessor.cpp | 50 +++++++++++++++++++++--- src/libslic3r/GCode/GCodeProcessor.hpp | 16 +++++++- src/libslic3r/GCodeWriter.cpp | 29 ++++++++++++++ src/libslic3r/GCodeWriter.hpp | 2 + src/libslic3r/Preset.cpp | 4 +- src/libslic3r/Print.cpp | 7 +++- src/libslic3r/PrintConfig.cpp | 54 ++++++++++++++++++++++++++ src/libslic3r/PrintConfig.hpp | 7 ++++ src/slic3r/GUI/Tab.cpp | 30 +++++++++++++- 11 files changed, 232 insertions(+), 10 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 0c316aae0..bae8259ec 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -571,6 +571,15 @@ static std::vector get_path_of_change_filament(const Print& print) check_add_eol(start_filament_gcode_str); } + // deal exhaust fan speed + { + const bool activate_air_filtration = gcodegen.config().activate_air_filtration.get_at(new_extruder_id); + if (activate_air_filtration&&gcodegen.config().support_air_filtration.getBool()) { + start_filament_gcode_str += GCodeWriter::set_exhaust_fan(gcodegen.config().during_print_exhaust_fan_speed.get_at(new_extruder_id),false); + ((start_filament_gcode_str +=';')+=GCodeProcessor::reserved_tag(GCodeProcessor::ETags::During_Print_Exhaust_Fan)) += '\n'; + } + } + // Insert the end filament, toolchange, and start filament gcode into the generated gcode. DynamicConfig config; config.set_key_value("filament_end_gcode", new ConfigOptionString(end_filament_gcode_str)); @@ -1799,6 +1808,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_placeholder_parser.set("first_layer_center_no_wipe_tower", new ConfigOptionFloats(center.x(),center.y())); } + auto chamber_temp_vec = m_config.option("chamber_temperatures")->values; + int max_chamber_temp = *std::max_element(chamber_temp_vec.begin(), chamber_temp_vec.end()); { int curr_bed_type = m_config.curr_bed_type.getInt(); @@ -1841,6 +1852,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato if (print.config().gcode_flavor != gcfKlipper) { // Set bed temperature if the start G-code does not contain any bed temp control G-codes. this->_print_first_layer_bed_temperature(file, print, machine_start_gcode, initial_extruder_id, true); + if (m_config.option("chamber_temp_control")->getBool()) { + this->_print_chamber_temperature(file, print, machine_start_gcode,max_chamber_temp, true); + } // Set extruder(s) temperature before and after start G-code. this->_print_first_layer_extruder_temperatures(file, print, machine_start_gcode, initial_extruder_id, false); } @@ -1853,6 +1867,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato m_writer.set_current_position_clear(false); m_start_gcode_filament = GCodeProcessor::get_gcode_last_filament(machine_start_gcode); + // Process filament-specific gcode. /* if (has_wipe_tower) { // Wipe tower will control the extruder switching, it will call the filament_start_gcode. @@ -1863,6 +1878,13 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato } */ this->_print_first_layer_extruder_temperatures(file, print, machine_start_gcode, initial_extruder_id, true); + + bool activate_air_filtration = *std::max_element(m_config.activate_air_filtration.values.begin(), m_config.activate_air_filtration.values.end()) && m_config.support_air_filtration.getBool(); + + if (activate_air_filtration && m_config.activate_air_filtration.get_at(initial_extruder_id)) { + file.write(m_writer.set_exhaust_fan(m_config.during_print_exhaust_fan_speed.get_at(initial_extruder_id), true)); + } + print.throw_if_canceled(); // Set other general things. @@ -2129,6 +2151,16 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100% file.write(m_writer.postamble()); + file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature + + + if (activate_air_filtration) { + int complete_print_exhaust_fan_speed = 0; + for (size_t i = 0; i < m_config.activate_air_filtration.size(); ++i) + if (m_config.activate_air_filtration.get_at(i)) + complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(i)); + file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed,true)); + } // adds tags for time estimators file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str()); file.write_format("; EXECUTABLE_BLOCK_END\n\n"); @@ -2393,6 +2425,16 @@ int GCode::get_bed_temperature(const int extruder_id, const bool is_first_layer, return bed_temp_opt->get_at(extruder_id); } +void GCode::_print_chamber_temperature(GCodeOutputStream &file, Print &print, const std::string &gcode,int chamber_temperature, bool wait) +{ + int temp_by_gcode = -1; + bool temp_set_by_gcode = custom_gcode_sets_temperature(gcode, 141, 191, false, temp_by_gcode); + + std::string set_chamber_temp_gcode = m_writer.set_chamber_temperature(chamber_temperature, wait); + if (!temp_set_by_gcode) + file.write(set_chamber_temp_gcode); +} + // Write 1st layer bed temperatures into the G-code. // Only do that if the start G-code does not already contain any M-code controlling an extruder temperature. // M140 - Set Extruder Temperature diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 5f7b00154..6451af850 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -507,6 +507,7 @@ private: std::string _extrude(const ExtrusionPath &path, std::string description = "", double speed = -1); void print_machine_envelope(GCodeOutputStream &file, Print &print); + void _print_chamber_temperature(GCodeOutputStream &file, Print &print, const std::string &gcode,int chamber_temperature, bool wait); void _print_first_layer_bed_temperature(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait); void _print_first_layer_extruder_temperatures(GCodeOutputStream &file, Print &print, const std::string &gcode, unsigned int first_printing_extruder_id, bool wait); // On the first printing layer. This flag triggers first layer speeds. diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 71e6c32af..cdb409617 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -57,7 +57,8 @@ const std::vector GCodeProcessor::Reserved_Tags = { "_GP_FIRST_LINE_M73_PLACEHOLDER", "_GP_LAST_LINE_M73_PLACEHOLDER", "_GP_ESTIMATED_PRINTING_TIME_PLACEHOLDER", - "_GP_TOTAL_LAYER_NUMBER_PLACEHOLDER" + "_GP_TOTAL_LAYER_NUMBER_PLACEHOLDER", + "_DURING_PRINT_EXHAUST_FAN" }; const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START"; @@ -362,6 +363,12 @@ void GCodeProcessor::TimeProcessor::reset() machine_limits = MachineEnvelopeConfig(); filament_load_times = 0.0f; filament_unload_times = 0.0f; + + exhaust_fan_info.activate = false; + exhaust_fan_info.print_end_exhaust_fan_speed = 0; + exhaust_fan_info.print_end_exhaust_fan_time = 0; + insert_fan_control_flag = false; + for (size_t i = 0; i < static_cast(PrintEstimatedStatistics::ETimeMode::Count); ++i) { machines[i].reset(); } @@ -406,6 +413,14 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st return std::string(line_M73); }; + auto format_line_exhaust_fan_control = [](const std::string& mask,int fan_index,int percent) { + char line_fan[64] = { 0 }; + sprintf(line_fan,mask.c_str(), + std::to_string(fan_index).c_str(), + std::to_string(int((percent/100.0)*255)).c_str()); + return std::string(line_fan); + }; + auto format_time_float = [](float time) { return Slic3r::float_to_string_decimal_point(time, 2); }; @@ -516,7 +531,7 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st // add lines M73 to exported gcode auto process_line_move = [ // Lambdas, mostly for string formatting, all with an empty capture block. - time_in_minutes, format_time_float, format_line_M73_main, format_line_M73_stop_int, format_line_M73_stop_float, time_in_last_minute, + time_in_minutes, format_time_float, format_line_M73_main, format_line_M73_stop_int, format_line_M73_stop_float, time_in_last_minute,format_line_exhaust_fan_control, &self = std::as_const(*this), // Caches, to be modified &g1_times_cache_it, &last_exported_main, &last_exported_stop, @@ -535,6 +550,14 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st if (it != machine.g1_times_cache.end() && it->id == g1_lines_counter) { std::pair to_export_main = { int(100.0f * it->elapsed_time / machine.time), time_in_minutes(machine.time - it->elapsed_time) }; + + if (self.exhaust_fan_info.activate && !self.insert_fan_control_flag && machine.time - it->elapsed_time < self.exhaust_fan_info.print_end_exhaust_fan_time ) { + //insert fan + self.insert_fan_control_flag = true; + export_line += format_line_exhaust_fan_control("M106 P%s S%s ;open exhaust fan before print end \n", 3, self.exhaust_fan_info.print_end_exhaust_fan_speed); + ++exported_lines_count; + } + if (last_exported_main[i] != to_export_main) { export_line += format_line_M73_main(machine.line_m73_main_mask.c_str(), to_export_main.first, to_export_main.second); @@ -629,6 +652,9 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st gcode_line.insert(gcode_line.end(), it, it_end); if (eol) { ++line_id; + // disable origin exhaust_fan_speed during print + if (insert_fan_control_flag&&gcode_line.find(reserved_tag(ETags::During_Print_Exhaust_Fan)) != std::string::npos) + gcode_line.clear(); gcode_line += "\n"; // replace placeholder lines @@ -962,6 +988,18 @@ void GCodeProcessor::apply_config(const PrintConfig& config) const ConfigOptionBool* spiral_vase = config.option("spiral_mode"); if (spiral_vase != nullptr) m_spiral_vase_active = spiral_vase->value; + + + for (size_t i = 0; i < config.activate_air_filtration.values.size(); ++i) { + if (config.activate_air_filtration.get_at(i)) { + m_exhaust_fan_info.print_end_exhaust_fan_speed = std::max(m_exhaust_fan_info.print_end_exhaust_fan_speed, config.end_print_exhaust_fan_speed.get_at(i)); + m_exhaust_fan_info.print_end_exhaust_fan_time = std::max(m_exhaust_fan_info.print_end_exhaust_fan_time, config.end_print_exhaust_fan_time.get_at(i)); + } + } + + const ConfigOptionBools* activate_air_filtration = config.option("activate_air_filtration"); + if (activate_air_filtration != nullptr) + m_exhaust_fan_info.activate = *std::max_element(activate_air_filtration->values.begin(), activate_air_filtration->values.end())&&config.support_air_filtration.getBool(); } void GCodeProcessor::apply_config(const DynamicPrintConfig& config) @@ -1459,9 +1497,11 @@ void GCodeProcessor::finalize(bool post_process) m_height_compare.output(); m_width_compare.output(); #endif // ENABLE_GCODE_VIEWER_DATA_CHECKING - - if (post_process) + if (post_process){ + //control chamber fan + m_time_processor.exhaust_fan_info = m_exhaust_fan_info; m_time_processor.post_process(m_result.filename, m_result.moves, m_result.lines_ends, m_layer_id); + } #if ENABLE_GCODE_VIEWER_STATISTICS m_result.time = std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - m_start_time).count(); #endif // ENABLE_GCODE_VIEWER_STATISTICS @@ -1897,7 +1937,7 @@ template // Legacy conversion, which is costly due to having to make a copy of the string before conversion. try { assert(sv.size() < 1024); - assert(sv.data() != nullptr); + assert(sv.data() != nullptr); std::string str { sv }; size_t read = 0; if constexpr (std::is_same_v) diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 09e6d1164..90e009de2 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -253,7 +253,8 @@ namespace Slic3r { First_Line_M73_Placeholder, Last_Line_M73_Placeholder, Estimated_Printing_Time_Placeholder, - Total_Layer_Number_Placeholder + Total_Layer_Number_Placeholder, + During_Print_Exhaust_Fan }; static const std::string& reserved_tag(ETags tag) { return Reserved_Tags[static_cast(tag)]; } @@ -353,6 +354,12 @@ namespace Slic3r { float time() const; }; + struct ExhaustFanInfo { + bool activate{ false }; + int print_end_exhaust_fan_speed{0}; + int print_end_exhaust_fan_time{0}; + }; + private: struct TimeMachine { @@ -448,6 +455,11 @@ namespace Slic3r { // Additional load / unload times for a filament exchange sequence. float filament_load_times; float filament_unload_times; + + // start fan x second before print complete + ExhaustFanInfo exhaust_fan_info; + mutable bool insert_fan_control_flag{false}; + std::array(PrintEstimatedStatistics::ETimeMode::Count)> machines; void reset(); @@ -613,7 +625,7 @@ namespace Slic3r { private: GCodeReader m_parser; - + ExhaustFanInfo m_exhaust_fan_info; EUnits m_units; EPositioningType m_global_positioning_type; EPositioningType m_e_local_positioning_type; diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 8a9f3488b..1e3923993 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -146,6 +146,25 @@ std::string GCodeWriter::set_bed_temperature(int temperature, bool wait) return gcode.str(); } +std::string GCodeWriter::set_chamber_temperature(int temperature, bool wait) +{ + std::string code, comment; + std::ostringstream gcode; + + if (wait) + { + gcode<<"M106 P2 S255 \n"; + gcode<<"M191 S"< s_Preset_filament_options { "temperature_vitrification", "reduce_fan_stop_start_freq", "slow_down_for_layer_cooling", "fan_min_speed", "fan_max_speed", "enable_overhang_bridge_fan", "overhang_fan_speed", "overhang_fan_threshold", "close_fan_the_first_x_layers", "full_fan_speed_layer", "fan_cooling_layer_time", "slow_down_layer_time", "slow_down_min_speed", "filament_start_gcode", "filament_end_gcode", + //exhaust fan control + "activate_air_filtration","during_print_exhaust_fan_speed","end_print_exhaust_fan_speed","end_print_exhaust_fan_time","complete_print_exhaust_fan_speed", // Retract overrides "filament_retraction_length", "filament_z_hop", "filament_z_hop_types", "filament_retraction_speed", "filament_deretraction_speed", "filament_retract_restart_extra", "filament_retraction_minimum_travel", "filament_retract_when_changing_layer", "filament_wipe", "filament_retract_before_wipe", @@ -850,7 +852,7 @@ static std::vector s_Preset_printer_options { "silent_mode", // BBS "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode", - "nozzle_type","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", + "nozzle_type","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types","chamber_temp_control","support_air_filtration", //OrcaSlicer "host_type", "print_host", "printhost_apikey", "print_host_webui", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index de2f02a32..448355753 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -161,7 +161,12 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "inner_wall_acceleration", "sparse_infill_acceleration", "exclude_object", - "use_relative_e_distances" + "use_relative_e_distances", + "activate_air_filtration", + "during_print_exhaust_fan_speed", + "end_print_exhaust_fan_speed", + "end_print_exhaust_fan_time", + "complete_print_exhaust_fan_speed" }; static std::unordered_set steps_ignore; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 77f46a481..d270f5854 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -953,6 +953,47 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionString()); def->cli = ConfigOptionDef::nocli; + def = this->add("activate_air_filtration",coBools); + def->label = L("Activate air filtration"); + def->tooltip = L("Acivate for better air filtration"); + def->mode = comSimple; + def->set_default_value(new ConfigOptionBools{false}); + + def = this->add("during_print_exhaust_fan_speed", coInts); + def->label = L("Fan speed"); + def->tooltip=L("Speed of exhuast fan during printing.This speed will overwrite the speed in filament custom gcode"); + def->sidetext = L("%"); + def->min=0; + def->max=100; + def->mode = comSimple; + def->set_default_value(new ConfigOptionInts{60}); + + def = this->add("end_print_exhaust_fan_speed", coInts); + def->label = L("Fan speed"); + def->tooltip=L("Speed of exhuast fan before printing completes"); + def->sidetext = L("%"); + def->min=0; + def->max=100; + def->mode = comSimple; + def->set_default_value(new ConfigOptionInts{60}); + + + def = this->add("end_print_exhaust_fan_time", coInts); + def->label = L("Time"); + def->tooltip=L("open exhuast fan x seconds before printing completes"); + def->sidetext = L("s"); + def->mode = comSimple; + def->set_default_value(new ConfigOptionInts{300}); + + def = this->add("complete_print_exhaust_fan_speed", coInts); + def->label = L("Fan speed"); + def->sidetext = L("%"); + def->tooltip=L("Speed of exhuast fan after printing completes"); + def->min=0; + def->max=100; + def->mode = comSimple; + def->set_default_value(new ConfigOptionInts{80}); + def = this->add("close_fan_the_first_x_layers", coInts); def->label = L("No cooling for the first"); def->tooltip = L("Close all cooling fan for the first certain layers. Cooling fan of the first layer used to be closed " @@ -1703,6 +1744,19 @@ void PrintConfigDef::init_fff_params() def->mode = comDevelop; def->set_default_value(new ConfigOptionBool(false)); + def =this->add("chamber_temp_control",coBool); + def->label=L("Support control chamber temperature"); + def->tooltip=L("Enable this option if machine support controlling chamber temperature"); + def->mode=comDevelop; + def->set_default_value(new ConfigOptionBool(false)); + def->readonly=false; + + def =this->add("support_air_filtration",coBool); + def->label=L("Support air filtration"); + def->tooltip=L("Decide whether support activating air filtration"); + def->mode=comDevelop; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("gcode_flavor", coEnum); def->label = L("G-code flavor"); def->tooltip = L("What kind of gcode the printer is compatible with"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index ea5330a54..19cf69a18 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -875,6 +875,8 @@ PRINT_CONFIG_CLASS_DEFINE( //BBS ((ConfigOptionEnum, nozzle_type)) ((ConfigOptionBool, auxiliary_fan)) + ((ConfigOptionBool, chamber_temp_control)) + ((ConfigOptionBool, support_air_filtration)) ((ConfigOptionBool, accel_to_decel_enable)) ((ConfigOptionPercent, accel_to_decel_factor)) ((ConfigOptionEnumsGeneric, extruder_type)) @@ -911,6 +913,11 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, default_acceleration)) ((ConfigOptionFloat, inner_wall_acceleration)) ((ConfigOptionFloatOrPercent, sparse_infill_acceleration)) + ((ConfigOptionBools, activate_air_filtration)) + ((ConfigOptionInts, during_print_exhaust_fan_speed)) + ((ConfigOptionInts, end_print_exhaust_fan_speed)) + ((ConfigOptionInts, end_print_exhaust_fan_time)) + ((ConfigOptionInts, complete_print_exhaust_fan_speed)) ((ConfigOptionInts, close_fan_the_first_x_layers)) ((ConfigOptionEnum, draft_shield)) ((ConfigOptionFloat, extruder_clearance_height_to_rod))//BBs diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 872b3291b..0c37f4720 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2746,6 +2746,22 @@ void TabFilament::build() optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan"); optgroup->append_single_option_line("additional_cooling_fan_speed"); + optgroup = page->new_optgroup(L("Exhaust fan")); + + optgroup->append_single_option_line("activate_air_filtration"); + + line = {L("During print"), L("")}; + line.append_option(optgroup->get_option("during_print_exhaust_fan_speed")); + optgroup->append_line(line); + + line = {L("End of print"), L("")}; + line.append_option(optgroup->get_option("end_print_exhaust_fan_speed")); + line.append_option(optgroup->get_option("end_print_exhaust_fan_time")); + optgroup->append_line(line); + + line = {L("Complete print"), L("")}; + line.append_option(optgroup->get_option("complete_print_exhaust_fan_speed")); + optgroup->append_line(line); //BBS add_filament_overrides_page(); #if 0 @@ -2853,6 +2869,14 @@ void TabFilament::toggle_options() bool has_enable_overhang_bridge_fan = m_config->opt_bool("enable_overhang_bridge_fan", 0); for (auto el : { "overhang_fan_speed", "overhang_fan_threshold" }) toggle_option(el, has_enable_overhang_bridge_fan); + bool support_air_filtration = this->m_preset_bundle->printers.get_selected_preset().config.opt_bool("support_air_filtration"); + //this->m_preset_bundle. + //toggle_line("activate_air_filtration",support_air_filtration); + //m_config; + for (auto elem : { "during_print_exhaust_fan_speed","end_print_exhaust_fan_speed","end_print_exhaust_fan_time","complete_print_exhaust_fan_speed" }) + //toggle_line(elem, m_config->opt_bool("activate_air_filtration",0)&&support_air_filtration); + toggle_line(elem, m_config->opt_bool("activate_air_filtration",0)); + } if (m_active_page->title() == "Filament") { @@ -2864,7 +2888,7 @@ void TabFilament::toggle_options() toggle_line("pressure_advance", true); toggle_option("pressure_advance", m_config->opt_bool("enable_pressure_advance", 0)); } - toggle_line("chamber_temperatures", !is_BBL_printer); + for (auto el : {"cool_plate_temp", "cool_plate_temp_initial_layer", "eng_plate_temp", "eng_plate_temp_initial_layer", "textured_plate_temp", "textured_plate_temp_initial_layer"}) toggle_line(el, is_BBL_printer); @@ -3083,6 +3107,8 @@ void TabPrinter::build_fff() optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/); optgroup->append_single_option_line("nozzle_type"); optgroup->append_single_option_line("auxiliary_fan"); + optgroup->append_single_option_line("chamber_temp_control"); + optgroup->append_single_option_line("support_air_filtration"); const int gcode_field_height = 15; // 150 page = add_options_page(L("Machine gcode"), "cog"); @@ -3637,6 +3663,8 @@ void TabPrinter::toggle_options() toggle_option("gcode_flavor", !is_BBL_printer); toggle_option("use_relative_e_distances", !is_BBL_printer); + toggle_option("chamber_temp_control",!is_BBL_printer); + toggle_option("support_air_filtration",!is_BBL_printer); auto flavor = m_config->option>("gcode_flavor")->value; bool is_marlin_flavor = flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware; // Disable silent mode for non-marlin firmwares.