Suggest firmware retraction time (#5926)

* Suggest  firmware retraction time
This commit is contained in:
Vovodroid 2024-07-29 15:32:07 +03:00 committed by GitHub
parent 2ee3800a47
commit 4a81fe6134
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 14 deletions

View file

@ -695,7 +695,9 @@ void GCodeProcessor::TimeProcessor::post_process(const std::string& filename, st
if (!disable_m73 && !processed &&!is_temporary_decoration(gcode_line) &&
(GCodeReader::GCodeLine::cmd_is(gcode_line, "G1") ||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G2") ||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G3"))) {
GCodeReader::GCodeLine::cmd_is(gcode_line, "G3") ||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G10")||
GCodeReader::GCodeLine::cmd_is(gcode_line, "G11"))) {
// remove temporary lines, add lines M73 where needed
unsigned int extra_lines_count = process_line_move(g1_lines_counter ++);
if (extra_lines_count > 0)
@ -3813,14 +3815,18 @@ void GCodeProcessor::process_G29(const GCodeReader::GCodeLine& line)
void GCodeProcessor::process_G10(const GCodeReader::GCodeLine& line)
{
// stores retract move
store_move_vertex(EMoveType::Retract);
GCodeReader::GCodeLine g10;
g10.set(Axis::E, -this->m_parser.config().retraction_length.get_at(m_extruder_id));
g10.set(Axis::F, this->m_parser.config().retraction_speed.get_at(m_extruder_id) * 60);
process_G1(g10);
}
void GCodeProcessor::process_G11(const GCodeReader::GCodeLine& line)
{
// stores unretract move
store_move_vertex(EMoveType::Unretract);
GCodeReader::GCodeLine g11;
g11.set(Axis::E, this->m_parser.config().retraction_length.get_at(m_extruder_id) + this->m_parser.config().retract_restart_extra.get_at(m_extruder_id));
g11.set(Axis::F, this->m_parser.config().deretraction_speed.get_at(m_extruder_id) * 60);
process_G1(g11);
}
void GCodeProcessor::process_G20(const GCodeReader::GCodeLine& line)