epics-base / epicsCoreJava

Parent repository for building, bundling, and deploying the EPICS Core Java libraries
Other
7 stars 10 forks source link

No way to access description of Enum? #132

Closed jembishop closed 2 months ago

jembishop commented 9 months ago

It looks like there is no way to access the display.description field of an Enum? This would be quite useful to have.

https://github.com/epics-base/epicsCoreJava/blob/5b5c8434d2d36ce3e8a4e02999809982e3ed94ca/epics-vtype/vtype/src/main/java/org/epics/vtype/EnumDisplay.java#L16C8-L16C8

kasemir commented 9 months ago

In Channel Access, there is no "description". In PV Access, the normative type for numeric data includes a "display" info with a "description", https://docs.epics-controls.org/en/latest/pv-access/Normative-Types-Specification.html#display-t

The enum type has no "display", and also nothing else that holds a description, https://docs.epics-controls.org/en/latest/pv-access/Normative-Types-Specification.html#ntenum

Personally, I think it was a bad idea to add the description in the first place. In those few cases where it's really useful, a separate channel for "record.DESC" could fetch it, instead of adding it to every numeric value. Now the question, I guess, is: Remove the display.description, or add a NTEnum.description? Either way requires update of normative type document, QSRV(2), and then the clients which care.

jembishop commented 9 months ago

I see, interesting, I hadn't realized there was no description field in the NTEnum, thanks for pointing that out. Looking at the normative type spec it looks like there should be a descriptor field though?
I can't seem to find a way to access it though docs perhaps I am missing something. I am a bit confused what the semantic difference is meant to be between the "descriptor" and "description".