mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-07 14:04:11 -06:00
ENH: add decel para
thanks SoftFever Signed-off-by: qing.zhang <qing.zhang@bambulab.com> Change-Id: I95a1240c8d6ce7365055e840e526f279a55939e4
This commit is contained in:
parent
4b23192d6f
commit
346321379a
7 changed files with 47 additions and 2 deletions
|
@ -175,6 +175,11 @@ std::string GCodeWriter::set_acceleration(unsigned int acceleration)
|
|||
// This is new MarlinFirmware with separated print/retraction/travel acceleration.
|
||||
// Use M204 P, we don't want to override travel acc by M204 S (which is deprecated anyway).
|
||||
gcode << "M204 P" << acceleration;
|
||||
} else if (FLAVOR_IS(gcfKlipper) && this->config.accel_to_decel_enable) {
|
||||
gcode << "SET_VELOCITY_LIMIT ACCEL_TO_DECEL=" << acceleration * this->config.accel_to_decel_factor / 100;
|
||||
if (GCodeWriter::full_gcode_comment) gcode << " ; adjust ACCEL_TO_DECEL";
|
||||
gcode << "\nM204 S" << acceleration;
|
||||
// Set max accel to decel to half of acceleration
|
||||
} else {
|
||||
// M204: Set default acceleration
|
||||
gcode << "M204 S" << acceleration;
|
||||
|
|
|
@ -728,8 +728,10 @@ static std::vector<std::string> s_Preset_print_options {
|
|||
#endif /* HAS_PRESSURE_EQUALIZER */
|
||||
"inner_wall_speed", "outer_wall_speed", "sparse_infill_speed", "internal_solid_infill_speed",
|
||||
"top_surface_speed", "support_speed", "support_object_xy_distance", "support_interface_speed",
|
||||
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed",
|
||||
"outer_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", "default_acceleration", "skirt_loops", "skirt_distance", "skirt_height", "draft_shield",
|
||||
"bridge_speed", "gap_infill_speed", "travel_speed", "travel_speed_z", "initial_layer_speed", "outer_wall_acceleration",
|
||||
"initial_layer_acceleration", "top_surface_acceleration", "default_acceleration",
|
||||
"accel_to_decel_enable", "accel_to_decel_factor", "skirt_loops", "skirt_distance",
|
||||
"skirt_height", "draft_shield",
|
||||
"brim_width", "brim_object_gap", "brim_type", "enable_support", "support_type", "support_threshold_angle", "enforce_support_layers",
|
||||
"raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion",
|
||||
"support_base_pattern", "support_base_pattern_spacing", "support_expansion", "support_style",
|
||||
|
|
|
@ -107,6 +107,8 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||
"initial_layer_acceleration",
|
||||
"outer_wall_acceleration",
|
||||
"top_surface_acceleration",
|
||||
"accel_to_decel_enable",
|
||||
"accel_to_decel_factor",
|
||||
// BBS
|
||||
"cool_plate_temp_initial_layer",
|
||||
"eng_plate_temp_initial_layer",
|
||||
|
|
|
@ -1411,6 +1411,21 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloat(300));
|
||||
|
||||
def = this->add("accel_to_decel_enable", coBool);
|
||||
def->label = L("Enable accel_to_decel");
|
||||
def->tooltip = L("Klipper's max_accel_to_decel will be adjusted automatically");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
def = this->add("accel_to_decel_factor", coPercent);
|
||||
def->label = L("accel_to_decel");
|
||||
def->tooltip = L("Klipper's max_accel_to_decel will be adjusted to this % of acceleration");
|
||||
def->sidetext = L("%");
|
||||
def->min = 1;
|
||||
def->max = 100;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPercent(50));
|
||||
|
||||
def = this->add("default_jerk", coFloat);
|
||||
def->label = L("Default");
|
||||
def->tooltip = L("Default jerk");
|
||||
|
|
|
@ -859,6 +859,8 @@ PRINT_CONFIG_CLASS_DEFINE(
|
|||
((ConfigOptionEnum<NozzleType>, nozzle_type))
|
||||
((ConfigOptionInt, nozzle_hrc))
|
||||
((ConfigOptionBool, auxiliary_fan))
|
||||
((ConfigOptionBool, accel_to_decel_enable))
|
||||
((ConfigOptionPercent, accel_to_decel_factor))
|
||||
)
|
||||
|
||||
// This object is mapped to Perl as Slic3r::Config::Print.
|
||||
|
|
|
@ -686,6 +686,23 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
|
|||
toggle_field("detect_thin_wall", !have_arachne);
|
||||
//toggle_field("enable_overhang_speed", !have_arachne);
|
||||
toggle_field("only_one_wall_top", !have_arachne);
|
||||
|
||||
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
|
||||
// SoftFever
|
||||
auto gcflavor = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||
|
||||
// SoftFever
|
||||
if( gcflavor != gcfKlipper )
|
||||
{
|
||||
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
|
||||
toggle_line(el, false);
|
||||
}
|
||||
else {
|
||||
for (auto el : {"accel_to_decel_enable", "accel_to_decel_factor"})
|
||||
toggle_line(el, true);
|
||||
|
||||
toggle_field("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*/)
|
||||
|
|
|
@ -1947,6 +1947,8 @@ void TabPrint::build()
|
|||
optgroup->append_single_option_line("outer_wall_acceleration");
|
||||
optgroup->append_single_option_line("top_surface_acceleration");
|
||||
optgroup->append_single_option_line("default_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)"), L"param_acceleration", 15);
|
||||
optgroup->append_single_option_line("default_jerk");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue