ECDC-3390 write enums as integers
Created by: danesss
Issue
In NeXus files we are storing the following fields inside NXlog as strings instead of integers:
- connection_status
- alarm_severity
https://jira.esss.lu.se/browse/ECDC-3390
Description of work
NeXus
These changes assume that NeXus will eventually standardise a way to encode epics alarms and connection status. I've used the conventions below.
- connection_status as per ep01
- alarm_severity as per al00
- alarm_message: this is stored as string, not integer
Changes
-
ep00
- connection_status: Fixed to write integers. Note that the flatbuffer enum is a subset of the enum used by ep01, therefore if NeXus standardises the ones from ep01 it should be backwards compatible with ep00.
-
ep01
- connection_status: Fixed to write integers.
-
al00
- message: Not changed, still using strings.
- severity: Fixed to write integers.
-
f142
- status: Not changed. This is the equivalent of al00.message so it has been left as a string.
- severity: Changed to write integers instead of strings. NOTE that the f142.severity enum is not compatible with al00.severity, therefore an additional mapping was used. That is, we assumed that the NeXus standard will adopt al00.severity, so f142 is translated into al00 severity format.
Checklist
-
Changes have been documented in changes.md
-
Documentation has been updated in documentation
directory