From 32eff40422b5d066c5e46f28cd08b6db665fb6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20R=C3=B6ssler?= Date: Fri, 6 Feb 2015 19:16:57 +0100 Subject: [PATCH] added retract and unretract command for Machinekit flavour --- xs/src/libslic3r/GCodeWriter.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xs/src/libslic3r/GCodeWriter.cpp b/xs/src/libslic3r/GCodeWriter.cpp index 9aa7616a6..f1176d617 100644 --- a/xs/src/libslic3r/GCodeWriter.cpp +++ b/xs/src/libslic3r/GCodeWriter.cpp @@ -434,7 +434,10 @@ GCodeWriter::_retract(double length, double restart_extra, const std::string &co double dE = this->_extruder->retract(length, restart_extra); if (dE != 0) { if (this->config.use_firmware_retraction) { - gcode << "G10 ; retract\n"; + if (FLAVOR_IS(gcfMachinekit)) + gcode << "G22 ; retract\n"; + else + gcode << "G10 ; retract\n"; } else { gcode << "G1 " << this->_extrusion_axis << E_NUM(this->_extruder->E) << " F" << this->_extruder->retract_speed_mm_min; @@ -460,7 +463,10 @@ GCodeWriter::unretract() double dE = this->_extruder->unretract(); if (dE != 0) { if (this->config.use_firmware_retraction) { - gcode << "G11 ; unretract\n"; + if (FLAVOR_IS(gcfMachinekit)) + gcode << "G23 ; unretract\n"; + else + gcode << "G11 ; unretract\n"; gcode << this->reset_e(); } else { // use G1 instead of G0 because G0 will blend the restart with the previous travel move @@ -509,4 +515,4 @@ GCodeWriter::get_position() const REGISTER_CLASS(GCodeWriter, "GCode::Writer"); #endif -} \ No newline at end of file +}