mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
ENH: Add a button to control whether to enable volumetric-speed fitting
Jira: None Change-Id: I8d9fd3468dbfb8904d164b289f9d5223e476145c (cherry picked from commit 3acf97f1b3cf12d34a3679eef550cc26e03eb86c)
This commit is contained in:
@@ -5981,8 +5981,12 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
}
|
||||
}
|
||||
//BBS: if not set the speed, then use the filament_max_volumetric_speed directly
|
||||
double filament_max_volumetric_speed = calc_max_volumetric_speed(path.height, path.width, FILAMENT_CONFIG(volumetric_speed_coefficients));
|
||||
filament_max_volumetric_speed = std::min(filament_max_volumetric_speed, FILAMENT_CONFIG(filament_max_volumetric_speed));
|
||||
double filament_max_volumetric_speed = FILAMENT_CONFIG(filament_max_volumetric_speed);
|
||||
if (FILAMENT_CONFIG(filament_adaptive_volumetric_speed)){
|
||||
double fitted_value = calc_max_volumetric_speed(path.height, path.width, FILAMENT_CONFIG(volumetric_speed_coefficients));
|
||||
filament_max_volumetric_speed = std::min(filament_max_volumetric_speed, fitted_value);
|
||||
}
|
||||
|
||||
if (speed == 0)
|
||||
speed = filament_max_volumetric_speed / _mm3_per_mm;
|
||||
if (this->on_first_layer()) {
|
||||
|
||||
@@ -949,7 +949,7 @@ static std::vector<std::string> s_Preset_print_options {
|
||||
|
||||
static std::vector<std::string> s_Preset_filament_options {/*"filament_colour", */ "default_filament_colour", "required_nozzle_HRC", "filament_diameter", "pellet_flow_coefficient", "volumetric_speed_coefficients", "filament_type",
|
||||
"filament_soluble", "filament_is_support", "filament_printable",
|
||||
"filament_max_volumetric_speed",
|
||||
"filament_max_volumetric_speed", "filament_adaptive_volumetric_speed",
|
||||
"filament_flow_ratio", "filament_density", "filament_adhesiveness_category", "filament_cost", "filament_minimal_purge_on_wipe_tower",
|
||||
"nozzle_temperature", "nozzle_temperature_initial_layer",
|
||||
// BBS
|
||||
|
||||
@@ -276,6 +276,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
||||
|| opt_key == "nozzle_temperature_initial_layer"
|
||||
|| opt_key == "filament_minimal_purge_on_wipe_tower"
|
||||
|| opt_key == "filament_max_volumetric_speed"
|
||||
|| opt_key == "filament_adaptive_volumetric_speed"
|
||||
|| opt_key == "filament_loading_speed"
|
||||
|| opt_key == "filament_loading_speed_start"
|
||||
|| opt_key == "filament_unloading_speed"
|
||||
|
||||
@@ -2320,6 +2320,15 @@ void PrintConfigDef::init_fff_params()
|
||||
def->min = 0;
|
||||
def->set_default_value(new ConfigOptionFloats{ 0.4157 });
|
||||
|
||||
def = this->add("filament_adaptive_volumetric_speed", coBools);
|
||||
def->label = L("Adaptive volumetric speed");
|
||||
def->tooltip = L("When enabled, the extrusion flow is limited by the smaller of "
|
||||
"the fitted value (calculated from line width and layer height) and the user-defined maximum flow."
|
||||
" When disabled, only the user-defined maximum flow is applied.");
|
||||
def->mode = comAdvanced;
|
||||
def->nullable = true;
|
||||
def->set_default_value(new ConfigOptionBoolsNullable {false});
|
||||
|
||||
def = this->add("volumetric_speed_coefficients", coStrings);
|
||||
def->label = L("Max volumetric speed multinomial coefficients");
|
||||
def->set_default_value(new ConfigOptionStrings{""});
|
||||
@@ -7523,7 +7532,8 @@ std::set<std::string> filament_options_with_variant = {
|
||||
"nozzle_temperature",
|
||||
"filament_flush_volumetric_speed",
|
||||
"filament_flush_temp",
|
||||
"volumetric_speed_coefficients"
|
||||
"volumetric_speed_coefficients",
|
||||
"filament_adaptive_volumetric_speed"
|
||||
};
|
||||
|
||||
// Parameters that are the same as the number of extruders
|
||||
|
||||
@@ -1224,6 +1224,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionBool, fan_speedup_overhangs))
|
||||
((ConfigOptionFloat, fan_speedup_time))
|
||||
((ConfigOptionFloats, filament_diameter))
|
||||
((ConfigOptionBoolsNullable, filament_adaptive_volumetric_speed))
|
||||
((ConfigOptionStrings, volumetric_speed_coefficients))
|
||||
((ConfigOptionInts, filament_adhesiveness_category))
|
||||
((ConfigOptionFloats, filament_density))
|
||||
|
||||
@@ -3823,6 +3823,7 @@ void TabFilament::build()
|
||||
|
||||
//BBS
|
||||
optgroup = page->new_optgroup(L("Volumetric speed limitation"), L"param_volumetric_speed");
|
||||
optgroup->append_single_option_line("filament_adaptive_volumetric_speed");
|
||||
optgroup->append_single_option_line("filament_max_volumetric_speed");
|
||||
|
||||
//line = { "", "" };
|
||||
@@ -4087,6 +4088,10 @@ void TabFilament::toggle_options()
|
||||
|
||||
bool support_chamber_temp_control = this->m_preset_bundle->printers.get_edited_preset().config.opt_bool("support_chamber_temp_control");
|
||||
toggle_line("chamber_temperature", support_chamber_temp_control);
|
||||
|
||||
std::string volumetric_speed_cos = m_config->opt_string("volumetric_speed_coefficients", 0u);
|
||||
bool enable_fit = volumetric_speed_cos != "0;0;0;0;0;0";
|
||||
toggle_option("filament_adaptive_volumetric_speed", enable_fit);
|
||||
}
|
||||
|
||||
if (m_active_page->title() == L("Setting Overrides"))
|
||||
|
||||
Reference in New Issue
Block a user