diff --git a/xs/src/libslic3r/GCodeWriter.cpp b/xs/src/libslic3r/GCodeWriter.cpp index f1176d617..624f11c57 100644 --- a/xs/src/libslic3r/GCodeWriter.cpp +++ b/xs/src/libslic3r/GCodeWriter.cpp @@ -511,6 +511,15 @@ GCodeWriter::get_position() const return this->_pos; } +std::string +GCodeWriter::end_program() +{ + std::ostringstream gcode; + if (FLAVOR_IS(gcfMachinekit)) + gcode << "M2 ; end of program\n"; + return gcode.str(); +} + #ifdef SLIC3RXS REGISTER_CLASS(GCodeWriter, "GCode::Writer"); #endif diff --git a/xs/src/libslic3r/GCodeWriter.hpp b/xs/src/libslic3r/GCodeWriter.hpp index 03de197d1..6854f02e0 100644 --- a/xs/src/libslic3r/GCodeWriter.hpp +++ b/xs/src/libslic3r/GCodeWriter.hpp @@ -46,6 +46,7 @@ class GCodeWriter { std::string lift(); std::string unlift(); Pointf3 get_position() const; + std::string end_program(); private: std::string _extrusion_axis; diff --git a/xs/xsp/GCodeWriter.xsp b/xs/xsp/GCodeWriter.xsp index a76c0e55f..d2f1e00d4 100644 --- a/xs/xsp/GCodeWriter.xsp +++ b/xs/xsp/GCodeWriter.xsp @@ -45,6 +45,7 @@ std::string lift(); std::string unlift(); Clone get_position() const; + std::string end_program(); %{ SV*