From f2fa8cb63fa9ef6f8e307ccda36fa3e53e74eeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20R=C3=B6ssler?= Date: Sat, 7 Feb 2015 12:36:29 +0100 Subject: [PATCH] added end_program() function to GCodeWriter --- xs/src/libslic3r/GCodeWriter.cpp | 9 +++++++++ xs/src/libslic3r/GCodeWriter.hpp | 1 + xs/xsp/GCodeWriter.xsp | 1 + 3 files changed, 11 insertions(+) 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*