nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
49 stars 31 forks source link

Add color codes for enum telemetry #133

Open timcanham opened 2 years ago

timcanham commented 2 years ago

For FPP, an enumeration looks like this:

enum Decision { YES, NO, MAYBE }

Telemetry already has a notion of color codes for scalars:

@ Telemetry channel 1
  telemetry Channel1: U32 \
    low { red 0, orange 1, yellow 2 }

There are cases where it would be very useful to color-highlight enumeration values in telemetry in the ground system.

For example:

enum AlarmLevel {NOMINAL, WARNING, CRITICAL}

An update to the telemetry channel definition to accommodate this could look like:

@ Alarm telemetry
  telemetry HeaterAlarm:  AlarmLevel \
    color { orange WARNING, red CRITICAL }

enumeration values not specified would have the default color.

There is currently no support in the XML for this.