From 7abde9e4ab90b9731574d9d7790667793fd04daa Mon Sep 17 00:00:00 2001 From: Torsten Martinsen Date: Sun, 21 Jan 2024 11:25:01 +0100 Subject: [PATCH] Add compatibility with grblHAL using default compatibility level. --- src/frmmain.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frmmain.cpp b/src/frmmain.cpp index 59af2f5..584dbd0 100644 --- a/src/frmmain.cpp +++ b/src/frmmain.cpp @@ -1743,10 +1743,12 @@ bool frmMain::DataIsFloating(QString data) bool frmMain::DataIsReset(QString data) { - //return QRegExp("^GRBL\\s\\d\\.\\d").indexIn(data.toUpper()) != -1; - QString g("GRBL 1.1"); - - return data.toUpper().contains(g); + // "GRBL" in either case, optionally followed by a number of non-whitespace characters, + // followed by a version number in the format x.y. + // This matches e.g. + // Grbl 1.1h ['$' for help] + // GrblHAL 1.1f ['$' or '' for help] + return QRegExp("^GRBL[^ ]*\\s\\d\\.\\d").indexIn(data.toUpper()) != -1; } QString frmMain::FeedOverride(QString command)