Skip to content

Commit

Permalink
Handle new variant of Genmitsu version string (#2297)
Browse files Browse the repository at this point in the history
  • Loading branch information
breiler committed Aug 23, 2023
1 parent 4466f69 commit 4d64d98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -10,7 +10,7 @@
*/
public class GrblVersion {
public static final GrblVersion NO_VERSION = new GrblVersion("");
public static final String VERSION_REGEX = "^\\[VER:(GD32 )?[vV]?(?<version>(?<major>\\d+)\\.(?<minor>\\d+)(?<char>[a-zA-Z])?).*?]$";
public static final String VERSION_REGEX = "^\\[VER:([a-zA-Z0-9\\s]*)?[vV]?(?<version>(?<major>\\d+)\\.(?<minor>\\d+)(?<char>[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]'

Expand Down
Expand Up @@ -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);
}
}

0 comments on commit 4d64d98

Please sign in to comment.