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
base: master
Are you sure you want to change the base?
Conversation
Looks like I need to fix up a couple of the expected test results and I missed a bug or two. More to come. |
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. |
8dcb264
to
e063ed6
Compare
75cb584
to
9d31b76
Compare
0c2fce0
to
0469fe0
Compare
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.
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.