mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
support klipper gcode flavor
This commit is contained in:
parent
ff760815ca
commit
cd71a86d3f
6 changed files with 24 additions and 13 deletions
|
@ -22,7 +22,7 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config)
|
|||
{
|
||||
this->config.apply(print_config, true);
|
||||
m_single_extruder_multi_material = print_config.single_extruder_multi_material.value;
|
||||
bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware;
|
||||
bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || print_config.gcode_flavor.value == gcfKlipper;
|
||||
m_max_acceleration = std::lrint(is_marlin ? print_config.machine_max_acceleration_extruding.values.front() : 0);
|
||||
m_max_jerk = std::lrint(is_marlin ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
|
||||
}
|
||||
|
@ -55,7 +55,8 @@ std::string GCodeWriter::preamble()
|
|||
FLAVOR_IS(gcfMarlinFirmware) ||
|
||||
FLAVOR_IS(gcfTeacup) ||
|
||||
FLAVOR_IS(gcfRepetier) ||
|
||||
FLAVOR_IS(gcfSmoothie))
|
||||
FLAVOR_IS(gcfSmoothie) ||
|
||||
FLAVOR_IS(gcfKlipper))
|
||||
{
|
||||
if (RELATIVE_E_AXIS) {
|
||||
gcode << "M83 ; only support relative e\n";
|
||||
|
@ -196,7 +197,11 @@ std::string GCodeWriter::set_jerk_xy(unsigned int jerk)
|
|||
m_last_jerk = jerk;
|
||||
|
||||
std::ostringstream gcode;
|
||||
gcode << "M205 X" << jerk << " Y" << jerk;
|
||||
if(FLAVOR_IS(gcfKlipper))
|
||||
gcode << "SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=" << jerk;
|
||||
else
|
||||
gcode << "M205 X" << jerk << " Y" << jerk;
|
||||
|
||||
if (GCodeWriter::full_gcode_comment) gcode << " ; adjust jerk";
|
||||
gcode << "\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue