From 4d64d9845555ec1ae5122d98bd9c3aafcac79218 Mon Sep 17 00:00:00 2001 From: Joacim Breiler Date: Wed, 23 Aug 2023 06:57:57 +0200 Subject: [PATCH] Handle new variant of Genmitsu version string (#2297) --- .../universalgcodesender/firmware/grbl/GrblVersion.java | 2 +- .../universalgcodesender/firmware/grbl/GrblVersionTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ugs-core/src/com/willwinder/universalgcodesender/firmware/grbl/GrblVersion.java b/ugs-core/src/com/willwinder/universalgcodesender/firmware/grbl/GrblVersion.java index 907b221b9..9ddd8a5cf 100644 --- a/ugs-core/src/com/willwinder/universalgcodesender/firmware/grbl/GrblVersion.java +++ b/ugs-core/src/com/willwinder/universalgcodesender/firmware/grbl/GrblVersion.java @@ -10,7 +10,7 @@ */ public class GrblVersion { public static final GrblVersion NO_VERSION = new GrblVersion(""); - public static final String VERSION_REGEX = "^\\[VER:(GD32 )?[vV]?(?(?\\d+)\\.(?\\d+)(?[a-zA-Z])?).*?]$"; + public static final String VERSION_REGEX = "^\\[VER:([a-zA-Z0-9\\s]*)?[vV]?(?(?\\d+)\\.(?\\d+)(?[a-zA-Z])?).*?]$"; private final double versionNumber; // The 0.8 in '[VER:0.8c.20220620:Machine1]' private final Character versionLetter; // The c in '[VER:0.8c.20220620:Machine1]' diff --git a/ugs-core/test/com/willwinder/universalgcodesender/firmware/grbl/GrblVersionTest.java b/ugs-core/test/com/willwinder/universalgcodesender/firmware/grbl/GrblVersionTest.java index b40604096..6232663b5 100644 --- a/ugs-core/test/com/willwinder/universalgcodesender/firmware/grbl/GrblVersionTest.java +++ b/ugs-core/test/com/willwinder/universalgcodesender/firmware/grbl/GrblVersionTest.java @@ -88,4 +88,10 @@ public void parseGenmitsu32VersionString() { GrblVersion version = new GrblVersion("[VER:GD32 V2.1.20220827:]"); assertEquals(2.1d, version.getVersionNumber(), 0.001); } + + @Test + public void parseGenmitsuArm32VersionString() { + GrblVersion version = new GrblVersion("[VER:ARM32 V2.1.20220827:]"); + assertEquals(2.1d, version.getVersionNumber(), 0.001); + } }