-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
linuxcnc.stat 'mcodes' attribute is broken #3186
Comments
I guess that m_codes array (size 10) is zero-initialized, and nothing is writing to array index 9, so therefore that always contains 0 and will be displayed as M0. should go away with array initialized to -1. why it was designed that way... who knows. would be cleaner to replace that (and active g-codes) with an actual std::vector but that probably won't fly with NML. |
Thanks for your comment. Problem is I cannot seem to find the initialization of the array. My current 'solution' is to simply not copy the last element:
|
In C++ that happens implicitly (to 0) |
This looks like a contradiction to me: In interp_write.cc: 314
rs274ngc_pre.cc: 2214
If I combine the two sections this would be equivalent to:
Dropping the double negation:
But in rs274ngc_pre.cc: 163 (which looks correct)
|
This seems to indeed fix the spindle field:
As for the erroneous '0' in the last array element:
This seems to fix the issue (not sure if there is a more elegant solution though) :
|
Tested on RIP installs of current 2.9 and master and a package install of 2.9.3.
Here are the steps I follow to reproduce the issue:
This is what I expected to happen:
I would not expect 'M0' to be shown as active
I would expect 'M5' to change to 'M3' as the gcode executes
This is what happened instead:
'M0' is shown as active
'M5' quickly changes to 'M4' (!) and then back to 'M5' as the gcode executes
It worked properly before this:
Not sure if this worked before current version 2.9
The text was updated successfully, but these errors were encountered: