added end_program() function to GCodeWriter

This commit is contained in:
Alexander Rössler 2015-02-07 12:36:29 +01:00
parent d6feec808c
commit f2fa8cb63f
3 changed files with 11 additions and 0 deletions

View file

@ -511,6 +511,15 @@ GCodeWriter::get_position() const
return this->_pos; 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 #ifdef SLIC3RXS
REGISTER_CLASS(GCodeWriter, "GCode::Writer"); REGISTER_CLASS(GCodeWriter, "GCode::Writer");
#endif #endif

View file

@ -46,6 +46,7 @@ class GCodeWriter {
std::string lift(); std::string lift();
std::string unlift(); std::string unlift();
Pointf3 get_position() const; Pointf3 get_position() const;
std::string end_program();
private: private:
std::string _extrusion_axis; std::string _extrusion_axis;

View file

@ -45,6 +45,7 @@
std::string lift(); std::string lift();
std::string unlift(); std::string unlift();
Clone<Pointf3> get_position() const; Clone<Pointf3> get_position() const;
std::string end_program();
%{ %{
SV* SV*