MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / ProcessAbortCommand

Method ProcessAbortCommand

src/GCodes/GCodeBuffer/StringParser.cpp:829–858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void StringParser::ProcessAbortCommand(const StringRef& reply) noexcept
830{
831#if SUPPORT_ASYNC_MOVES
832 if (!gb.Executing()) return;
833#endif
834
835 SkipWhiteSpace();
836 if (gb.buffer[readPointer] != 0)
837 {
838 // If we fail to parse the expression, we want to abort anyway
839 try
840 {
841 ExpressionParser parser(&gb, gb.buffer + readPointer, gb.buffer + ARRAY_SIZE(gb.buffer), (int)commandIndent + readPointer);
842 const ExpressionValue val = parser.Parse();
843 readPointer = parser.GetEndptr() - gb.buffer;
844 val.AppendAsString(reply);
845 }
846 catch (const GCodeException& e)
847 {
848 e.GetMessage(reply, &gb);
849 reply.Insert(0, "invalid expression after 'abort': ");
850 }
851 }
852 else
853 {
854 reply.copy("'abort' command executed");
855 }
856
857 reprap.GetGCodes().AbortPrint(gb);
858}
859
860void StringParser::ProcessEchoCommand(const StringRef& reply) THROWS(GCodeException)
861{

Callers

nothing calls this directly

Calls 6

ExecutingMethod · 0.80
GetEndptrMethod · 0.80
AppendAsStringMethod · 0.80
GetMessageMethod · 0.80
copyMethod · 0.80
AbortPrintMethod · 0.80

Tested by

no test coverage detected