Skip to content

Commit

Permalink
Add postprocessing settings and copyright info to output gcode file.
Browse files Browse the repository at this point in the history
  • Loading branch information
FormerLurker committed May 10, 2020
1 parent 9ae9a8f commit 6826584
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion octoprint_arc_welder/data/lib/c/arc_welder/arc_welder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ arc_welder_results arc_welder::process()
{
if (output_file_.is_open())
{
add_arcwelder_comment_to_target();
if (info_logging_enabled_)
{
stream.clear();
Expand Down Expand Up @@ -614,7 +615,6 @@ std::string arc_welder::create_g92_e(double absolute_e)
int arc_welder::write_gcode_to_file(std::string gcode)
{
output_file_ << utilities::trim(gcode) << "\n";
//std::cout << utilities::trim(gcode) << "\n";
return 1;
}

Expand Down Expand Up @@ -664,4 +664,16 @@ std::string arc_welder::get_arc_gcode_absolute(double e, double f, const std::st

}

void arc_welder::add_arcwelder_comment_to_target()
{
std::stringstream stream;
stream << std::fixed << std::setprecision(2);
stream << "; Postprocessed by [ArcWelder](https://github.com/FormerLurker/ArcWelderLib)\n";
stream << "; Copyright(C) 2020 - Brad Hochgesang\n";
stream << "; arc_welder_resolution_mm = " << resolution_mm_ << "\n";
stream << "; arc_welder_g90_influences_extruder = " << (gcode_position_args_.g90_influences_extruder ? "True" : "False") << "\n\n";

output_file_ << stream.str();
}


1 change: 1 addition & 0 deletions octoprint_arc_welder/data/lib/c/arc_welder/arc_welder.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class arc_welder
protected:
virtual bool on_progress_(arc_welder_progress progress);
private:
void add_arcwelder_comment_to_target();
void reset();
static gcode_position_args get_args_(bool g90_g91_influences_extruder, int buffer_size);
progress_callback progress_callback_;
Expand Down

0 comments on commit 6826584

Please sign in to comment.