Skip to content

Commit

Permalink
change min layer times from int to float
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Mar 26, 2022
1 parent fa19bf6 commit 9904258
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ void PrintConfigDef::init_fff_params()
def->is_vector_extruder = true;
def->set_default_value(new ConfigOptionBools{ true });

def = this->add("fan_below_layer_time", coInts);
def = this->add("fan_below_layer_time", coFloats);
def->label = L("Enable fan if layer print time is below");
def->category = OptionCategory::cooling;
def->tooltip = L("If layer print time is estimated below this number of seconds, fan will be enabled "
Expand All @@ -1725,7 +1725,7 @@ void PrintConfigDef::init_fff_params()
def->max = 1000;
def->mode = comExpert | comPrusa;
def->is_vector_extruder = true;
def->set_default_value(new ConfigOptionInts { 60 });
def->set_default_value(new ConfigOptionFloats { 60 });

def = this->add("filament_colour", coStrings);
def->label = L("Color");
Expand Down Expand Up @@ -4370,7 +4370,7 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvancedE | comPrusa;
def->set_default_value(new ConfigOptionEnum<SlicingMode>(SlicingMode::Regular));

def = this->add("slowdown_below_layer_time", coInts);
def = this->add("slowdown_below_layer_time", coFloats);
def->label = L("Slow down if layer print time is below");
def->category = OptionCategory::cooling;
def->tooltip = L("If layer print time is estimated below this number of seconds, print moves "
Expand All @@ -4381,7 +4381,7 @@ void PrintConfigDef::init_fff_params()
def->max = 1000;
def->mode = comExpert | comPrusa;
def->is_vector_extruder = true;
def->set_default_value(new ConfigOptionInts{ 5 });
def->set_default_value(new ConfigOptionFloats{ 5 });

def = this->add("small_perimeter_speed", coFloatOrPercent);
def->label = L("Speed");
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionStrings, extruder_colour))
((ConfigOptionPoints, extruder_offset))
((ConfigOptionBools, fan_always_on))
((ConfigOptionInts, fan_below_layer_time))
((ConfigOptionFloats, fan_below_layer_time))
((ConfigOptionStrings, filament_colour))
((ConfigOptionStrings, filament_custom_variables))
((ConfigOptionStrings, filament_notes))
Expand Down Expand Up @@ -1156,7 +1156,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionFloatOrPercent, skirt_extrusion_width))
((ConfigOptionFloatsOrPercents, seam_gap))
((ConfigOptionInt, skirts))
((ConfigOptionInts, slowdown_below_layer_time))
((ConfigOptionFloats, slowdown_below_layer_time))
((ConfigOptionBool, spiral_vase))
((ConfigOptionFloatOrPercent, solid_infill_acceleration))
((ConfigOptionInt, standby_temperature_delta))
Expand Down
4 changes: 2 additions & 2 deletions src/slic3r/GUI/CalibrationRetractionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ void CalibrationRetractionDialog::remove_slowdown(wxCommandEvent& event_args) {
const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FFF_FILAMENT)->get_config();
DynamicPrintConfig new_filament_config = *filament_config; //make a copy

const ConfigOptionInts *fil_conf = filament_config->option<ConfigOptionInts>("slowdown_below_layer_time");
const ConfigOptionFloats *fil_conf = filament_config->option<ConfigOptionFloats>("slowdown_below_layer_time");
ConfigOptionInts *new_fil_conf = new ConfigOptionInts();
new_fil_conf->default_value = 5;
new_fil_conf->values = fil_conf->values;
new_fil_conf->values[0] = 0;
new_filament_config.set_key_value("slowdown_below_layer_time", new_fil_conf);

fil_conf = filament_config->option<ConfigOptionInts>("fan_below_layer_time"); new_fil_conf = new ConfigOptionInts();
fil_conf = filament_config->option<ConfigOptionFloats>("fan_below_layer_time"); new_fil_conf = new ConfigOptionFloats();
new_fil_conf->default_value = 60;
new_fil_conf->values = fil_conf->values;
new_fil_conf->values[0] = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/slic3r/GUI/PresetHints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ std::string PresetHints::cooling_description(const Preset &preset)
int ext_peri_fan_speed = preset.config.opt_int("external_perimeter_fan_speed", 0);
int disable_fan_first_layers = preset.config.opt_int("disable_fan_first_layers", 0);
int full_fan_speed_layer = preset.config.opt_int("full_fan_speed_layer", 0);
int slowdown_below_layer_time = preset.config.opt_int("slowdown_below_layer_time", 0);
float slowdown_below_layer_time = preset.config.opt_float("slowdown_below_layer_time", 0);
int min_print_speed = int(preset.config.opt_float("min_print_speed", 0) + 0.5);
int max_speed_reduc = int(preset.config.opt_float("max_speed_reduction", 0));
int fan_below_layer_time = preset.config.opt_int("fan_below_layer_time", 0);
float fan_below_layer_time = preset.config.opt_float("fan_below_layer_time", 0);

//for the time being, -1 shoudl eb for disabel, but it's 0 from legacy.
if (top_fan_speed == 0) top_fan_speed = -1;
Expand Down
6 changes: 3 additions & 3 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2807,10 +2807,10 @@ void TabFilament::toggle_options()
{
bool fan_always_on = m_config->opt_bool("fan_always_on", 0);

//get_field("max_fan_speed")->toggle(m_config->opt_int("fan_below_layer_time", 0) > 0);
//get_field("max_fan_speed")->toggle(m_config->opt_float("fan_below_layer_time", 0) > 0);
Field* min_print_speed_field = get_field("min_print_speed");
if (min_print_speed_field)
min_print_speed_field->toggle(m_config->opt_int("slowdown_below_layer_time", 0) > 0);
min_print_speed_field->toggle(m_config->opt_float("slowdown_below_layer_time", 0) > 0);

// hidden 'cooling', it's now deactivated.
//for (auto el : { "min_fan_speed", "disable_fan_first_layers" })
Expand All @@ -2823,7 +2823,7 @@ void TabFilament::toggle_options()

Field* max_fan_speed_field = get_field("max_fan_speed");
if (max_fan_speed_field)
max_fan_speed_field->toggle(m_config->opt_int("fan_below_layer_time", 0) > 0 || m_config->opt_int("slowdown_below_layer_time", 0) > 0);
max_fan_speed_field->toggle(m_config->opt_float("fan_below_layer_time", 0) > 0 || m_config->opt_float("slowdown_below_layer_time", 0) > 0);
}

update_filament_overrides_page();
Expand Down

0 comments on commit 9904258

Please sign in to comment.