-
Notifications
You must be signed in to change notification settings - Fork 113
Enable parameter substitution in MSG comments #587
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
Conversation
please move substitute_parameters() to the same #if #endif block where read_parameter () is located and mark it as static |
Hm, I would have thought that Will put my stuff in the NGC_EXPRESSIONS_ENABLE-block for now, since that is at least consistent |
FYI NGC_PARAMETERS_ENABLE was added to have basic support for G65 (with no parameter passing) for the 128K STM32F1xx MCUs, this since adding expressions would otherwise overflow flash. Perhaps a bad choice of name for the symbol... |
Aaah, that makes sense😅 I thought maybe parameters might have been a thing outside of using expressions/G65, so that you could have used them in "normal" g-code somehow. |
FYI you introduced a memory leak in MSG substitution... |
Oh no, I am so sorry! 😞 |
This line allocates memory for a copy of the MSG message, and your code in |
ah, I did not notice that this line did any memory allocation. I thought it only did the same thing as the debug-one 😅 |
In many cases it is necessary to communicate something to an operator which contains a dynamic value, and being able to use the MSG comments for this seems natural.
The reason for not using DEBUG comments is that those are used for debugging, and create a lot of noise for the operator. So the operator should be able to disable DEBUG output and still get the messages they need
Example output with debug output enabled:
Example output with debug output disabled:
P200 is a macro that finds an available slot in my tool rack, tells the operator to put it there, and assigns the tool to the slot so that it knows where to find it.