diff --git a/src/libslic3r/GCode/CoolingBuffer.cpp b/src/libslic3r/GCode/CoolingBuffer.cpp index 7e1dc33800..4568dd15ee 100644 --- a/src/libslic3r/GCode/CoolingBuffer.cpp +++ b/src/libslic3r/GCode/CoolingBuffer.cpp @@ -949,9 +949,10 @@ std::string CoolingBuffer::apply_layer_cooldown( int fan_speeds[ uint8_t(GCodeExtrusionRole::Count)]; int default_fan_speed[ uint8_t(GCodeExtrusionRole::Count)]; #define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder) +#define FAN_CONFIG(OPT) m_config.OPT.is_enabled(m_current_extruder) ? m_config.OPT.get_at(m_current_extruder) : -1 const int min_fan_speed = m_config.fan_printer_min_speed; assert(min_fan_speed >= 0); - int initial_default_fan_speed = EXTRUDER_CONFIG(default_fan_speed); + int initial_default_fan_speed = FAN_CONFIG(default_fan_speed); //if default_fan_speed activated, be sure it's at least the mins if (initial_default_fan_speed > 0 && initial_default_fan_speed < min_fan_speed) initial_default_fan_speed = min_fan_speed; @@ -967,19 +968,29 @@ std::string CoolingBuffer::apply_layer_cooldown( if (default_fan_speed[i] == 1) default_fan_speed[i] = 0; } //set the fan controls - default_fan_speed[ uint8_t(GCodeExtrusionRole::BridgeInfill)] = EXTRUDER_CONFIG(bridge_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::InternalBridgeInfill)] = EXTRUDER_CONFIG(internal_bridge_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::TopSolidInfill)] = EXTRUDER_CONFIG(top_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::BridgeInfill)] = FAN_CONFIG(bridge_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::InternalBridgeInfill)] = FAN_CONFIG(internal_bridge_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::TopSolidInfill)] = FAN_CONFIG(top_fan_speed); default_fan_speed[ uint8_t(GCodeExtrusionRole::Ironing)] = default_fan_speed[ uint8_t(GCodeExtrusionRole::TopSolidInfill)]; - default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterialInterface)] = EXTRUDER_CONFIG(support_material_interface_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterial)] = EXTRUDER_CONFIG(support_material_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::ExternalPerimeter)] = EXTRUDER_CONFIG(external_perimeter_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterialInterface)] = FAN_CONFIG(support_material_interface_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterial)] = FAN_CONFIG(support_material_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::ExternalPerimeter)] = FAN_CONFIG(external_perimeter_fan_speed); default_fan_speed[ uint8_t(GCodeExtrusionRole::ThinWall)] = default_fan_speed[ uint8_t(GCodeExtrusionRole::ExternalPerimeter)]; - default_fan_speed[ uint8_t(GCodeExtrusionRole::Perimeter)] = EXTRUDER_CONFIG(perimeter_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::SolidInfill)] = EXTRUDER_CONFIG(solid_infill_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::InternalInfill)] = EXTRUDER_CONFIG(infill_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::OverhangPerimeter)] = EXTRUDER_CONFIG(overhangs_fan_speed); - default_fan_speed[ uint8_t(GCodeExtrusionRole::GapFill)] = EXTRUDER_CONFIG(gap_fill_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::Perimeter)] = FAN_CONFIG(perimeter_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::SolidInfill)] = FAN_CONFIG(solid_infill_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::InternalInfill)] = FAN_CONFIG(infill_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::OverhangPerimeter)] = FAN_CONFIG(overhangs_fan_speed); + default_fan_speed[ uint8_t(GCodeExtrusionRole::GapFill)] = FAN_CONFIG(gap_fill_fan_speed); + // if disabled, and default is not default + if (default_fan_speed[uint8_t(GCodeExtrusionRole::TopSolidInfill)] < 0) { + default_fan_speed[ uint8_t(GCodeExtrusionRole::TopSolidInfill)] = default_fan_speed[ uint8_t(GCodeExtrusionRole::SolidInfill)]; + } + if (default_fan_speed[uint8_t(GCodeExtrusionRole::SupportMaterialInterface)] < 0) { + default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterialInterface)] = default_fan_speed[ uint8_t(GCodeExtrusionRole::SupportMaterial)]; + } + if (default_fan_speed[uint8_t(GCodeExtrusionRole::InternalBridgeInfill)] < 0) { + default_fan_speed[ uint8_t(GCodeExtrusionRole::InternalBridgeInfill)] = default_fan_speed[ uint8_t(GCodeExtrusionRole::BridgeInfill)]; + } // if default is enabled, it takes over the settings that are disabled. if (initial_default_fan_speed >= 0) { for (int i = 0; i < uint8_t(GCodeExtrusionRole::Count); i++) { @@ -1285,6 +1296,7 @@ std::string CoolingBuffer::apply_layer_cooldown( pos = line_end; } #undef EXTRUDER_CONFIG +#undef FAN_CONFIG const char *gcode_end = gcode.c_str() + gcode.size(); if (pos < gcode_end) new_gcode.append(pos, gcode_end - pos); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 675a4a4dc9..6388e5609a 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -797,13 +797,15 @@ void PrintConfigDef::init_fff_params() def->label = L("Bridges fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during bridges and overhangs. It won't slow down the fan if it's currently running at a higher speed." - "\nSet to -1 to disable this override (Bridges will use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comPrusa; def->is_vector_extruder = true; + def->can_be_disabled = true; def->set_default_value(new ConfigOptionInts{ 100 }); def = this->add("bridge_type", coEnum); @@ -1354,12 +1356,13 @@ void PrintConfigDef::init_fff_params() def->tooltip = L( "Default speed for the fan, to set the speed for features where there is no fan control. Useful for PLA and other low-temp filament." "\nSet 0 to disable the fan by default. Useful for ABS and other high-temp filaments." - "\nSet -1 to disable. if disabled, the beahavior isn't defined yet. The goal is to avoid adding fan speed commands."); + "\nIf disabled, no fan speed command will be emmited when possible (if a feature set a speed, it won't be reverted)."); def->mode = comSimpleAE | comSuSi; - def->min = -1; + def->min = 0; def->max = 100; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts({-1})); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def->aliases = { "min_fan_speed" }; // only if "fan_always_on" def = this->add("default_print_profile", coString); @@ -1646,17 +1649,18 @@ void PrintConfigDef::init_fff_params() def = this->add("external_perimeter_fan_speed", coInts); def->label = L("External perimeter fan speed"); def->tooltip = L("When set to a non-zero value this fan speed is used only for external perimeters (visible ones) and thin walls." - "\nSet to 1 to disable the fan." - "\nSet to -1 to use the normal fan speed on external perimeters." - "External perimeters can benefit from higher fan speed to improve surface finish, " + "\nSet to 0 to stop the fan." + "\nIf disabled, the default fan speed will be used." + "\nExternal perimeters can benefit from higher fan speed to improve surface finish, " "while internal perimeters, infill, etc. benefit from lower fan speed to improve layer adhesion." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts { -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("external_perimeter_overlap", coPercent); def->label = L("external perimeter overlap"); @@ -2891,15 +2895,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Gap fill fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all gap fill Perimeter moves" - "\nSet to 1 to disable fan." - "\nSet to -1 to disable this override (Gap Fill will use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comExpert | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("gap_fill_flow_match_perimeter", coPercent); def->label = L("Cap with perimeter flow"); @@ -3324,15 +3329,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Internal Infill fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all Internal Infill moves" - "\nSet to 1 to disable fan." - "\nSet to -1 to disable this override (Internal Infill will use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comExpert | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("infill_first", coBool); def->label = L("Infill before perimeters"); @@ -3421,14 +3427,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Infill bridges fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all infill bridges. It won't slow down the fan if it's currently running at a higher speed." - "\nSet to -1 to disable this override (Internal bridges will use Bridges fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, Bridge fan speed will be used." "\nCan be disabled by disable_fan_first_layers and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def->aliases = { "bridge_internal_fan_speed" }; def = this->add("internal_bridge_speed", coFloatOrPercent); @@ -4131,11 +4139,12 @@ void PrintConfigDef::init_fff_params() "\nSet to -1 to disable this override (Overhang Perimeter use default fan speed)." "\nCan be disabled by disable_fan_first_layers and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("overhangs_max_slope", coFloatOrPercent); def->label = L("Overhangs max slope"); @@ -4391,15 +4400,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Internal Perimeter fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all Perimeter moves" - "\nSet to 1 to disable fan." - "\nSet to -1 to disable this override (Internal Perimeter use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comExpert | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("perimeter_loop", coBool); def->label = L("Perimeters loop"); @@ -5380,15 +5390,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Solid Infill fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all Solid Infill moves" - "\nSet to 1 to disable fan." - "\nSet to -1 to disable this override (Solid Infill will use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer and increased by low layer time."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comExpert | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("solid_infill_speed", coFloatOrPercent); def->label = L("Solid"); @@ -5757,15 +5768,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Support Material fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all support moves" - "\nSet to 0 to disable fan." - "\nSet to -1 to disable this override (Support will use default fan speed)." + "\nSet to 0 to stop the fan." + "\nIf disabled, default fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comExpert | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("support_material_interface_angle", coFloat); def->label = L("Pattern angle"); @@ -5792,15 +5804,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Support interface fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all support interfaces, to be able to weaken their bonding with a high fan speed." - "\nSet to 0 to disable the fan." - "\nSet to -1 to disable this override (Support Interface will use Support)." + "\nSet to 0 to stop the fan." + "\nIf disabled, Support Material fan speed will be used." "\nCan only be overriden by disable_fan_first_layers."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("support_material_interface_contact_loops", coBool); @@ -6338,15 +6351,16 @@ void PrintConfigDef::init_fff_params() def->label = L("Top Solid fan speed"); def->category = OptionCategory::cooling; def->tooltip = L("This fan speed is enforced during all top fills (including ironing)." - "\nSet to 1 to disable the fan." - "\nSet to -1 to disable this override (Top Solid Infill will use Solid Infill)." + "\nSet to 0 to stop the fan." + "\nIf disabled, Solid Infill fan speed will be used." "\nCan be disabled by disable_fan_first_layers, slowed down by full_fan_speed_layer."); def->sidetext = L("%"); - def->min = -1; + def->min = 0; def->max = 100; def->mode = comAdvancedE | comSuSi; def->is_vector_extruder = true; - def->set_default_value(new ConfigOptionInts{ -1 }); + def->can_be_disabled = true; + def->set_default_value((ConfigOptionInts*)(new ConfigOptionInts({ 100 }))->set_can_be_disabled()->set_enabled(false)); def = this->add("top_infill_extrusion_width", coFloatOrPercent); def->label = L("Top solid infill"); @@ -8380,6 +8394,19 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va value = "disabled"; } + //fan speed: activate disable. + if (opt_key.find("_fan_speed") != std::string::npos) { + if ("max_fan_speed" != opt_key && "filament_toolchange_part_fan_speed" != opt_key) { + if (value == "-1") { + value = "!100"; + } else if (value == "1") { + // for now, still consider "1" as a "0", to be able to import old config where the 1 means 0 (and 0 + // was disable). + value = "0"; + } + } + } + if (!print_config_def.has(opt_key)) { //check the aliases for(const auto& entry : print_config_def.options) { @@ -9257,15 +9284,23 @@ std::map PrintConfigDef::to_prusa(t_config_option_key& value = Slic3r::find_full_path(value, value).generic_string(); } if ("default_fan_speed" == opt_key) { + if (!value.empty() && value.front() == '!') { + value = "1"; + } if (value == "0") { opt_key = "min_fan_speed"; - value = all_conf.option("fan_printer_min_speed")->get_float(); + value = std::to_string(all_conf.option("fan_printer_min_speed")->get_float()); new_entries["fan_always_on"] = "0"; } else { opt_key = "min_fan_speed"; new_entries["fan_always_on"] = "1"; } } + if ("bridge_fan_speed" == opt_key) { + if (!value.empty() && value.front() == '!') { + value = std::to_string(all_conf.option("fan_printer_min_speed")->get_float()); + } + } // compute max & min height from % to flat value if ("min_layer_height" == opt_key || "max_layer_height" == opt_key) { diff --git a/src/slic3r/GUI/PresetHints.cpp b/src/slic3r/GUI/PresetHints.cpp index 19b2fee4d9..ded1c25dde 100644 --- a/src/slic3r/GUI/PresetHints.cpp +++ b/src/slic3r/GUI/PresetHints.cpp @@ -97,25 +97,34 @@ void format_double_fan_min_speed(wxString& out, int min_speed, int default_speed } } +int get_fan_speed(const Preset &preset_fil, const std::string &opt_key) { + const ConfigOption* option = preset_fil.config.option(opt_key); + // only consider the first idx, as it's the current one. + if (option->is_enabled(0)) { + return option->get_int(0); + } + return -1; +} + #define MIN_BUF_LENGTH 4096 std::string PresetHints::cooling_description(const Preset &preset_fil, const Preset& preset_printer) { wxString out; // -1 is disable, 0 or 1 is "no fan". (and 1 will be "low fan" in the future) const int min_fan_speed = preset_printer.config.get_int("fan_printer_min_speed"); - const int default_fan_speed = preset_fil.config.get_int("default_fan_speed"); + const int default_fan_speed = get_fan_speed(preset_fil, "default_fan_speed"); const int max_fan_speed = preset_fil.config.opt_int("max_fan_speed", 0); - const int peri_fan_speed = preset_fil.config.opt_int("perimeter_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("perimeter_fan_speed"); - const int ext_peri_fan_speed = preset_fil.config.opt_int("external_perimeter_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("external_perimeter_fan_speed"); - const int infill_fan_speed = preset_fil.config.opt_int("infill_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("infill_fan_speed"); - const int solid_fan_speed = preset_fil.config.opt_int("solid_infill_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("solid_infill_fan_speed"); - const int top_fan_speed = preset_fil.config.opt_int("top_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("top_fan_speed"); - const int support_fan_speed = preset_fil.config.opt_int("support_material_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("support_material_fan_speed"); - const int supp_inter_fan_speed = preset_fil.config.opt_int("support_material_interface_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("support_material_interface_fan_speed"); - const int bridge_fan_speed = preset_fil.config.opt_int("bridge_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("bridge_fan_speed"); - const int internal_bridge_fan_speed = preset_fil.config.opt_int("internal_bridge_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("internal_bridge_fan_speed"); - const int overhangs_fan_speed = preset_fil.config.opt_int("overhangs_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("overhangs_fan_speed"); - const int gap_fill_fan_speed = preset_fil.config.opt_int("gap_fill_fan_speed", 0) == 1 ? 0 : preset_fil.config.get_int("gap_fill_fan_speed"); + const int peri_fan_speed = get_fan_speed(preset_fil, "perimeter_fan_speed"); + const int ext_peri_fan_speed = get_fan_speed(preset_fil, "external_perimeter_fan_speed"); + const int infill_fan_speed = get_fan_speed(preset_fil, "infill_fan_speed"); + const int solid_fan_speed = get_fan_speed(preset_fil, "solid_infill_fan_speed"); + const int top_fan_speed = get_fan_speed(preset_fil, "top_fan_speed"); + const int support_fan_speed = get_fan_speed(preset_fil, "support_material_fan_speed"); + const int supp_inter_fan_speed = get_fan_speed(preset_fil, "support_material_interface_fan_speed"); + const int bridge_fan_speed = get_fan_speed(preset_fil, "bridge_fan_speed"); + const int internal_bridge_fan_speed = get_fan_speed(preset_fil, "internal_bridge_fan_speed"); + const int overhangs_fan_speed = get_fan_speed(preset_fil, "overhangs_fan_speed"); + const int gap_fill_fan_speed = get_fan_speed(preset_fil, "gap_fill_fan_speed"); const int disable_fan_first_layers = preset_fil.config.opt_int("disable_fan_first_layers", 0); const int full_fan_speed_layer = preset_fil.config.opt_int("full_fan_speed_layer", 0); const float slowdown_below_layer_time = preset_fil.config.opt_float("slowdown_below_layer_time", 0);