Option for klipper only: Adjustment of "accel_to_decel" (#220)

* Klipper option: Adjustment of "accel_to_decel"

Add option to automatically adjust accel_to_decel to 50% of chosen acceleration.

* allow variable accel_to_decel percentage

allow variable accel_to_decel percentage for klipper firmware
This commit is contained in:
Patrice Côté 2023-01-24 08:33:34 -05:00 committed by GitHub
parent cdd9c51949
commit bf782028ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 42 additions and 9 deletions

View file

@ -508,6 +508,10 @@ void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std::
void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, const bool is_global_config)
{
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
//SoftFever
auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
bool have_perimeters = config->opt_int("wall_loops") > 0;
for (auto el : { "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
"seam_position", "wall_infill_order", "outer_wall_line_width",
@ -644,7 +648,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
toggle_line(el, has_fuzzy_skin);
// C11 printer is not support smooth timelapse
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
std::string str_preset_type = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
toggle_field("timelapse_type", str_preset_type != "C11");
@ -660,6 +663,11 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
auto is_role_based_wipe_speed = config->opt_bool("role_based_wipe_speed");
toggle_field("wipe_speed",!is_role_based_wipe_speed);
// SoftFever
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
toggle_line(el, gcflavor == gcfKlipper);
toggle_line("accel_to_decel_factor", config->opt_bool("accel_to_decel_enable"));
}
void ConfigManipulation::update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config/* = false*/)

View file

@ -1939,6 +1939,8 @@ void TabPrint::build()
optgroup->append_single_option_line("initial_layer_acceleration");
optgroup->append_single_option_line("top_surface_acceleration");
optgroup->append_single_option_line("travel_acceleration");
optgroup->append_single_option_line("accel_to_decel_enable");
optgroup->append_single_option_line("accel_to_decel_factor");
optgroup = page->new_optgroup(L("Jerk(XY)"));
optgroup->append_single_option_line("default_jerk");
@ -3643,7 +3645,7 @@ void TabPrinter::toggle_options()
}
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
if (m_active_page->title() == "Motion ability") {
if (m_active_page->title() == "Motion ability") {
assert(gcf == gcfMarlinLegacy || gcf == gcfMarlinFirmware || gcf == gcfKlipper);
bool silent_mode = m_config->opt_bool("silent_mode");
int max_field = silent_mode ? 2 : 1;