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

fix: allow omit 0 units in gcode number parsing #679

Merged
merged 1 commit into from
May 16, 2022

Conversation

pedrolamas
Copy link
Member

Ensures that the gcode parser can accept ".2" as a valid number (with omited "0" on unit)

This could be easily fixed just by this change:

- /([a-z])[ \t]*(-?\d+(?:\.\d+)?)/
+ /([a-z])[ \t]*(-?\d*(?:\.\d+)?)/

However, the above would allow for empty values (no number), so I opted for allowing the current or ".nnn".

Fixes #674

Signed-off-by: Pedro Lamas [email protected]

@pedrolamas pedrolamas added the GH - Bug Something isn't working label May 16, 2022
@pedrolamas pedrolamas added this to the 1.18.1 milestone May 16, 2022
@pedrolamas pedrolamas requested a review from matmen May 16, 2022 09:48
@pedrolamas pedrolamas merged commit ad8d4ff into fluidd-core:develop May 16, 2022
@pedrolamas pedrolamas deleted the pedrolamas/fix-674 branch May 16, 2022 10:50
matmen pushed a commit to matmen/fluidd that referenced this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GH - Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gcode preview completely broken (extrudes are moves, layers wrong)
2 participants