Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle new variant of Genmitsu version string #2297

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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);
}
}