g-code parsing fixes & logging enhancements #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do and why is it necessary?
This basically fixes two problems that I had with the plugin:
Temperatures got detected incorrectly as 0 because the plugin was parsing everything through to the end of the file, instead of stopping at the first extrusion. This occurs because Cura emits lines like
G1 X37.944 Y45.731 E0.18608
, and the parser would only recognize G1 commands with the E parameter listed first, e.g.G1 E0.18608 X37.944 Y45.731
.The plugin would erroneously recognize any command with a T parameter as a tool-select command, including commands there the T parameter is unrelated to toolhead selection. For example, it was setting the tool number to 500 upon reading this line:
M204 P500 R5000 T500 ;Setup Print/Retract/Travel acceleration
This also makes some small improvements to debug logging.
How was it tested? How can it be tested by the reviewer?
Any background context you want to provide?What are the relevant tickets if any?Screenshots (if appropriate)Further notes