diff options
author | Christian Hammacher <bmasterc@gmail.com> | 2022-09-30 12:38:12 +0300 |
---|---|---|
committer | Christian Hammacher <bmasterc@gmail.com> | 2022-09-30 12:38:12 +0300 |
commit | a98453dc82397d8831371a4f636671c6c492824b (patch) | |
tree | 74272981c44f55e3dcf7d30886e5b71d259640b2 | |
parent | 46349c643bdf85bd55bca659f05bad4709bb7dd9 (diff) |
Possible fix for M292
Get possible expression before acknowledging msgboxes
-rw-r--r-- | src/GCodes/GCodes7.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/GCodes/GCodes7.cpp b/src/GCodes/GCodes7.cpp index 23abce06..171ef8bf 100644 --- a/src/GCodes/GCodes7.cpp +++ b/src/GCodes/GCodes7.cpp @@ -121,17 +121,18 @@ GCodeResult GCodes::AcknowledgeMessage(GCodeBuffer&gb, const StringRef& reply) T seq = gb.GetUIValue(); } + const bool cancelled = (gb.Seen('P') && gb.GetIValue() == 1); + ExpressionValue rslt; + if (!cancelled && gb.Seen('R')) + { + rslt = gb.GetExpression(); + } + bool wasBlocking; if (reprap.AcknowledgeMessageBox(seq, wasBlocking)) { if (wasBlocking) { - const bool cancelled = (gb.Seen('P') && gb.GetIValue() == 1); - ExpressionValue rslt; - if (!cancelled && gb.Seen('R')) - { - rslt = gb.GetExpression(); - } MessageBoxClosed(cancelled, true, rslt); } return GCodeResult::ok; |