X-Git-Url: https://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/d82b3e847e0c88f45b8ab27950d614acefbc5aa2..HEAD:/src/modules/tools/toolmanager/ToolManager.cpp diff --git a/src/modules/tools/toolmanager/ToolManager.cpp b/src/modules/tools/toolmanager/ToolManager.cpp index 16680101..72e4985d 100644 --- a/src/modules/tools/toolmanager/ToolManager.cpp +++ b/src/modules/tools/toolmanager/ToolManager.cpp @@ -7,9 +7,6 @@ #include "libs/Module.h" #include "libs/Kernel.h" -#include -using namespace std; -#include #include "ToolManager.h" #include "Tool.h" #include "PublicDataRequest.h" @@ -26,6 +23,8 @@ using namespace std; #include "libs/StreamOutput.h" #include "FileStream.h" +#include + ToolManager::ToolManager() { active_tool = 0; @@ -44,8 +43,11 @@ void ToolManager::on_gcode_received(void *argument) { Gcode *gcode = static_cast(argument); - if( gcode->has_letter('T') ) { + if( gcode->has_letter('T') && !gcode->has_m) { int new_tool = gcode->get_value('T'); + char buff[32]; // should be big enough for any status + int n = snprintf(buff, sizeof(buff), "T%d,T%d switching ", this->active_tool, new_tool); + gcode->txt_after_ok.append(buff, n); if(new_tool >= (int)this->tools.size() || new_tool < 0) { // invalid tool char buf[32]; // should be big enough for any status