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

QSRV map arrays of strings and enums #4

Closed mdavidsaver closed 6 years ago

mdavidsaver commented 6 years ago

Mapping of DBR_STRING and DBR_ENUM and max elements!=1 is currently not implemented.

mdavidsaver commented 6 years ago

fyi @anjohnson @ralphlange @mrkraimer

mdavidsaver commented 6 years ago

Ha, at some point I did add the special case code to handle string array, but never removed the dbr type check.

mdavidsaver commented 6 years ago

f9c1489fcc24c97d36e1edd85e94c1261383282a turns on string array mapping.

In [1]: from p4p.client.thread import Context

In [2]: C=Context('pva')

In [3]: C.get('arrs')
Out[3]: []

In [4]: C.put('arrs', ['hello', 'world'])

In [5]: C.get('arrs')
Out[5]: [u'hello', u'world']

Using an IOC w/ QSRV and

record(waveform, "arrs") {
  field(FTVL, "STRING")
  field(NELM, "10")
}

@mrkraimer Can you update and repeat your test to confirm?

mrkraimer commented 6 years ago

I did and now stringArray works mrk> pvput DBRstringArray01 5 a b c d e Old : DBRstringArray01 0 New : DBRstringArray01 5 a b c d e mrk> pvget DBRstringArray01 DBRstringArray01 5 a b c d e

I will close issue