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

Stat: fix mcodes attribute #3190

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

Sigma1912
Copy link
Contributor

  • Fixes erroneous zero in last element of the stat.mcodes attribute by initializing the array with -1.
  • Fixes broken spindle field in stat.mcodes attribute

For discussion see:
#3186

Active_m_codes array is initialized with zeros by default. The last element is never written to in the
code so it shows up as a zero and is falsely interpreted as an active M0.
@Sigma1912
Copy link
Contributor Author

Sigma1912 commented Nov 25, 2024

Seems it's now failing the startup-state test.
Failed:
/home/runner/work/linuxcnc/linuxcnc/tests/startup-state
Error: Process completed with exit code 1.

Apparently this fix is the culprit:

active_m_codes{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},

@Sigma1912
Copy link
Contributor Author

Looks like the test expects the trailing zero in mcodes attribute, which is of course not correct. I'll have to modify 'startup-state':

+ rm -f sim.var
+ cp sim.var.pre sim.var
+ linuxcnc -r test.ini
Note: Using POSIX non-realtime
emc/tooldata/tooldata_common.cc, 304: Failed to open tool table file 'simpockets.tbl': No such file or directory
emc/tooldata/tooldata_common.cc, 304: Failed to open tool table file 'simpockets.tbl': No such file or directory
Traceback (most recent call last):
  File "/home/user/git/linuxcnc-master-official/tests/startup-state/./test-ui.py", line 273, in <module>
    assert(s.mcodes == (0, -1, 5, -1, 9, -1, 48, -1, 53, 0))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Note: Using POSIX non-realtime

@Sigma1912
Copy link
Contributor Author

Ready, as far as I'm concerned.

@andypugh andypugh merged commit 50ef8c8 into LinuxCNC:master Nov 28, 2024
9 checks passed
@andypugh
Copy link
Collaborator

Thanks.

@Sigma1912 Sigma1912 deleted the stat_fix_mcodes_attribute branch November 29, 2024 08:03
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.

2 participants