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

Support for message display from g-code comments #615

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

mmdoogie
Copy link
Contributor

This PR implements support for displaying messages embedded in g-code comments, along the lines of #316

For any lines beginning with '(MSG' (case-insensitive) the remainder of the line sans the last character is extracted as the message, trimmed of whitespace. If the first character of that is a comma, it is also removed, as it appears both (msg whatever) and (msg,whatever) forms are in use.

The message is placed in the Sender state variable which is already sent to the app and it is then used as an update source for the UI.

Implemented in both 3D and 2D views with a toggle in the 3D settings.

prog-msg-3d

prog-msg-conf

prog-msg-2d

Message can be cleared by the program at any time by sending a blank (msg), (msg,), or something of that nature. Final message remains displayed, but is automatically cleared on restart, or file load/unload.

I'm certainly open to any suggestions on things that could be different and I hope I didn't do anything too out of line with the existing code style.

@mmdoogie mmdoogie marked this pull request as draft June 21, 2020 06:35
@mmdoogie
Copy link
Contributor Author

Looks like I need to fix up a couple of the expected test results and I missed a bug or two. More to come.

@coveralls
Copy link

coveralls commented Jun 21, 2020

Coverage Status

Coverage increased (+0.1%) to 84.828% when pulling 1b39dd8 on mmdoogie:gcode-messages-display into 88cb363 on cncjs:master.

@mmdoogie
Copy link
Contributor Author

Question: should this work for comments that are anywhere in a line?

I can imagine someone having a "G0 X0 Y0 (MSG Return to zero)" use case (as a very simple example) but is there anything that would generate something like that? If they are manually inserted or done with a custom post, it would also be simple to just output as two separate lines.

@mmdoogie mmdoogie marked this pull request as ready for review June 23, 2020 22:21
@cheton cheton force-pushed the master branch 4 times, most recently from 8dcb264 to e063ed6 Compare April 24, 2021 11:08
@cheton cheton force-pushed the master branch 2 times, most recently from 75cb584 to 9d31b76 Compare October 26, 2021 11:09
@cheton cheton force-pushed the master branch 3 times, most recently from 0c2fce0 to 0469fe0 Compare January 22, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants