make fan percentages a float (#3087)

makes fan percentages an int.

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Ev 2023-12-12 08:56:20 -05:00 committed by GitHub
parent 103d778e63
commit d75bac2f01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View file

@ -736,8 +736,8 @@ std::string CoolingBuffer::apply_layer_cooldown(
int supp_interface_fan_speed = 0;
auto change_extruder_set_fan = [ this, layer_id, layer_time, &new_gcode, &overhang_fan_control, &overhang_fan_speed, &supp_interface_fan_control, &supp_interface_fan_speed](bool immediately_apply) {
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder)
int fan_min_speed = EXTRUDER_CONFIG(fan_min_speed);
int fan_speed_new = EXTRUDER_CONFIG(reduce_fan_stop_start_freq) ? fan_min_speed : 0;
float fan_min_speed = EXTRUDER_CONFIG(fan_min_speed);
float fan_speed_new = EXTRUDER_CONFIG(reduce_fan_stop_start_freq) ? fan_min_speed : 0;
//BBS
int additional_fan_speed_new = EXTRUDER_CONFIG(additional_cooling_fan_speed);
int close_fan_the_first_x_layers = EXTRUDER_CONFIG(close_fan_the_first_x_layers);
@ -751,7 +751,7 @@ std::string CoolingBuffer::apply_layer_cooldown(
close_fan_the_first_x_layers = 1;
}
if (int(layer_id) >= close_fan_the_first_x_layers) {
int fan_max_speed = EXTRUDER_CONFIG(fan_max_speed);
float fan_max_speed = EXTRUDER_CONFIG(fan_max_speed);
float slow_down_layer_time = float(EXTRUDER_CONFIG(slow_down_layer_time));
float fan_cooling_layer_time = float(EXTRUDER_CONFIG(fan_cooling_layer_time));
//BBS: always enable the fan speed interpolation according to layer time

View file

@ -2702,7 +2702,7 @@ def = this->add("filament_loading_speed", coFloats);
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats{ 0., 0. });
def = this->add("fan_max_speed", coInts);
def = this->add("fan_max_speed", coFloats);
def->label = L("Fan speed");
def->tooltip = L("Part cooling fan speed may be increased when auto cooling is enabled. "
"This is the maximum speed limitation of part cooling fan");
@ -2710,7 +2710,7 @@ def = this->add("filament_loading_speed", coFloats);
def->min = 0;
def->max = 100;
def->mode = comSimple;
def->set_default_value(new ConfigOptionInts { 100 });
def->set_default_value(new ConfigOptionFloats { 100 });
def = this->add("max_layer_height", coFloats);
def->label = L("Max");
@ -2753,14 +2753,14 @@ def = this->add("filament_loading_speed", coFloats);
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInt(3));
def = this->add("fan_min_speed", coInts);
def = this->add("fan_min_speed", coFloats);
def->label = L("Fan speed");
def->tooltip = L("Minimum speed for part cooling fan");
def->sidetext = L("%");
def->min = 0;
def->max = 100;
def->mode = comSimple;
def->set_default_value(new ConfigOptionInts { 20 });
def->set_default_value(new ConfigOptionFloats { 20 });
def = this->add("additional_cooling_fan_speed", coInts);
def->label = L("Fan speed");

View file

@ -1098,9 +1098,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionFloat, initial_layer_infill_speed))
((ConfigOptionInts, nozzle_temperature_initial_layer))
((ConfigOptionInts, full_fan_speed_layer))
((ConfigOptionInts, fan_max_speed))
((ConfigOptionFloats, fan_max_speed))
((ConfigOptionFloats, max_layer_height))
((ConfigOptionInts, fan_min_speed))
((ConfigOptionFloats, fan_min_speed))
((ConfigOptionFloats, min_layer_height))
((ConfigOptionFloat, printable_height))
((ConfigOptionPoint, best_object_pos))