nasa / SC

The Core Flight System (cFS) Stored Commands (SC) application.
Apache License 2.0
38 stars 20 forks source link

Use consistent representation of ATS and RTS identifiers in events #119

Closed jphickey closed 10 months ago

jphickey commented 12 months ago

Checklist (Please check before submitting)

Describe the bug When sending events and/or logging messages, the method used to "print" the identifier for an RTS or ATS is not consistent. Sometimes it is a number, sometimes it is a char (A/B), sometimes it uses 3 digits w/leading 0 (%03d format), and sometimes its just an int.

To Reproduce N/A (code review)

Expected behavior Should be represented consistently. If "lettering" (A/B) nomenclature is preferred for ATS's, then it should be used everywhere. Otherwise if "numbering" is preferred for RTS's, then use a consistent output format - leading zeros or no leading zeros, signed or unsigned, etc..

Code snips One way ATS's are printed, which will incorrectly report every ATS beyond 1 as ATS B: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_atsrq.c#L79

Another way ATS's are printed, which will more properly report ATS beyond 1 as ATS C/D/E etc. but will NOT handle ATS beyond 26: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_atsrq.c#L678

A third way ATS's are printed, based on the number: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_cmds.c#L755-L756

With RTS, sometimes it has leading zero: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_rtsrq.c#L113

But sometimes not: https://github.com/nasa/SC/blob/7587a8cccf3f1fc8d285c788cdc31bb60734c889/fsw/src/sc_rtsrq.c#L323

System observed on: Debian

Additional context Suggestion:

Reporter Info Joseph Hickey, Vantage Systems, Inc.