medley56 / space_packet_parser

A CCSDS telemetry packet decoding library based on the XTCE packet format description standard.
https://space-packet-parser.readthedocs.io
Other
18 stars 5 forks source link

Add shorDescription and LongDescription to Parameter in parser code #14

Closed tech3371 closed 5 months ago

tech3371 commented 11 months ago

Summary

get shortDescription or LongDescription from XTCE definition and reference in unpacked data.

In XTCE definition xml file, it will look like this

            <xtce:Parameter name="SPIN_PERIOD_SOURCE" parameterTypeRef="spin_period_source_enum">
                <xtce:LongDescription>
                Spin period source bit:
                '1' -- sun sensor (safing),
                '0' -- star tracker (nominal)
            </xtce:LongDescription>
            </xtce:Parameter>

In python code, it will reference it like this

Eg.
value = packet.data["SPIN_PERIOD_SOURCE"].raw_value and description = packet.data["IDX__TXHDREVTNUM"].LongDescription
tech3371 commented 11 months ago

Notes from @medley56

to add logic to the XTCE parsing code to actually look at those fields, follow these steps:

  1. While parsing each Parameter (in the XTCE document), search for short and long description elements (pass if not present or malformed).
  2. If short or long description is present, store that information in an internal instance attribute such that they can be looked up by Parameter name.
  3. Create getter methods for those internal instance attributes to look up descriptions by parameter name.
medley56 commented 9 months ago

@bryan-harter or @tech3371 I'm sorry I haven't gotten around to implementing this. I encourage you to take a stab though if you have time. It's only adding functionality to the XTCE parser and bookkeeping the description information as key value pairs.

tech3371 commented 9 months ago

It's been in my radar. I haven't had chance to start on it :)