epics-base / pva2pva

PV Access gateway/proxy and EPICS Process Database integration
https://epics-base.github.io/pva2pva/
Other
4 stars 13 forks source link

`+type:"structure"` does not work as documented. #49

Open mdavidsaver opened 1 year ago

mdavidsaver commented 1 year ago

cf. #48 The mapping is incorrectly applied to the parent structure.

record(longout, "$(P):ENUM:INDEX") {
    field(VAL, "1")
    field(PINI, "YES")
    info(Q:group, {
        "$(P):ENUM":{
            +id:"epics:nt/NTEnum:1.0",
            "value":{+type:"structure", +id:"enum_t"},        # BUG
            "value.index":{+type:"plain", +channel:"VAL"},
            "":{+type:"meta", +channel:"VAL"}
        }
    })
}

As a workaround, an invalid child field can be specified.

            "value.0workaround":{+type:"structure", +id:"enum_t"},
$ pvinfo TST:enum1:ENUM
TST:enum1:ENUM
Server: 192.168.1.197:5075
Type:
    epics:nt/NTEnum:1.0
        structure record
            structure _options
                uint queueSize
                boolean atomic
        alarm_t alarm
            int severity
            int status
            string message
        structure timeStamp
            long secondsPastEpoch
            int nanoseconds
            int userTag
        enum_t value
            string[] choices
            int index