From cde30643da7d15f43c5bea63485abc7f876336f9 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Wed, 3 Aug 2022 10:01:36 +0100 Subject: Don't report an event if it has a handler macro --- src/GCodes/GCodes3.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/GCodes/GCodes3.cpp b/src/GCodes/GCodes3.cpp index d971bfe5..a4d5d049 100644 --- a/src/GCodes/GCodes3.cpp +++ b/src/GCodes/GCodes3.cpp @@ -1914,7 +1914,6 @@ void GCodes::ProcessEvent(GCodeBuffer& gb) noexcept // Get the event message String eventText; const MessageType mt = Event::GetTextDescription(eventText.GetRef()); - platform.MessageF(mt, "%s\n", eventText.c_str()); // tell the user about the event and log it // Get the name of the macro file that we should look for String macroName; @@ -1938,6 +1937,11 @@ void GCodes::ProcessEvent(GCodeBuffer& gb) noexcept #endif // We didn't execute the macro, so do the default action + if ((mt & LogLevelMask) != 0) + { + platform.MessageF((MessageType)(mt & (LogLevelMask | ErrorMessageFlag | WarningMessageFlag)), "%s\n", eventText.c_str()); // log the event + } + if (Event::GetDefaultPauseReason() == PrintPausedReason::dontPause) { Event::FinishedProcessing(); // nothing more to do @@ -1945,8 +1949,6 @@ void GCodes::ProcessEvent(GCodeBuffer& gb) noexcept else { // It's a serious event that causes the print to pause by default, so send an alert - String eventText; - Event::GetTextDescription(eventText.GetRef()); const bool isPrinting = IsReallyPrinting(); platform.SendAlert(GenericMessage, eventText.c_str(), (isPrinting) ? "Printing paused" : "Event notification", 1, 0.0, AxesBitmap()); if (IsReallyPrinting()) -- cgit v1.2.3