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

channel filters don't work with PVA #41

Closed mdavidsaver closed 3 years ago

mdavidsaver commented 3 years ago

When using pvget with filters, only the number of elements is adjusted but not the data. It works with Channel Access.

Example record:

record (aai, "TEST") {
field(FTVL, "SHORT")
field(NELM, "10")
field(INP, [9,8,7,6,5,4,3,2,1])
field(PINI, "YES")
info(test, "Hello World")
}
$ caget TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}} 'TEST.{info:{n:"test"}}'
TEST 10 9 8 7 6 5 4 3 2 1 0
TEST.{arr:{s:5}} 5 4 3 2 1 0
TEST.{arr:{i:2}} 5 9 7 5 3 1
TEST.{info:{n:"test"}} Hello World

$ pvget TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}} 'TEST.{info:{n:"test"}}'
TEST 2021-03-12 10:23:15.524 [9,8,7,6,5,4,3,2,1]
TEST.{arr:{s:5}} 2021-03-12 10:23:15.524 [9,8,7,6,5]
TEST.{arr:{i:2}} 2021-03-12 10:23:15.524 [9,8,7,6,5]
TEST.{info:{n:"test"}} 2021-03-12 10:23:15.524 9
mdavidsaver commented 3 years ago

aka. https://bugs.launchpad.net/epics-base/+bug/1918909

@dirk-zimoch

mdavidsaver commented 3 years ago

Should be fixed by 04fbaf5a2ed78f8c05c7ffd52cdc4cef2e6efb07. I shot myself in the foot with class vs local variable naming.

dirk-zimoch commented 3 years ago

Not fixed.

$ caget TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}}
TEST 10 9 8 7 6 5 4 3 2 1 0
TEST.{arr:{s:5}} 5 4 3 2 1 0
TEST.{arr:{i:2}} 5 9 7 5 3 1
$ pvget TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}}
TEST             2021-03-17 10:41:21.917  [9,8,7,6,5,4,3,2,1]
TEST.{arr:{s:5}} 2021-03-17 10:41:21.917  [9,8,7,6,5]
TEST.{arr:{i:2}} 2021-03-17 10:41:21.917  [9,8,7,6,5]
dirk-zimoch commented 3 years ago
$ git submodule  status
 3db08b5977efd7a3ac8eecfa068b5bfdfdf84dd0 .ci (v3.2.0-17-g3db08b5)
 7a2d264f2cb107bfd10adb23bc2b73d8323a79e4 modules/normativeTypes (6.0.1-3-g7a2d264)
 e1c1a4bc1bad6933e57b199d58f74468401218b3 modules/pvAccess (7.1.3-1-ge1c1a4b)
 d3b4976ea2b0d78075511f14d7f7bf9620dd4d14 modules/pvData (8.0.4-1-gd3b4976)
 93a259cbde56668c1bbe495b15cc3ede8b42ce30 modules/pvDatabase (4.5.3-1-g93a259c)
+40b327cfcb2151c3851f76001a14cee2858c0455 modules/pva2pva (1.3.0-7-g40b327c)
 efb2631905cd61cc06041f5aac5be9017383a004 modules/pvaClient (4.7.1-2-gefb2631)
mdavidsaver commented 3 years ago

Ok, I'll take another look.

mdavidsaver commented 3 years ago

Right, so I only tested with pvmonitor... As of ff225381291419034a14a92fc14e591d8c5d9212 it should work with both.

$ pvget TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}}
TEST             2021-03-17 13:50:54.348  [9,8,7,6,5,4,3,2,1]
TEST.{arr:{s:5}} 2021-03-17 13:50:54.348  [4,3,2,1]
TEST.{arr:{i:2}} 2021-03-17 13:50:54.348  [9,7,5,3,1]
$ pvmonitor TEST TEST.{arr:{s:5}} TEST.{arr:{i:2}}
TEST             2021-03-17 13:50:54.348  [9,8,7,6,5,4,3,2,1]
TEST.{arr:{s:5}} 2021-03-17 13:50:54.348  [4,3,2,1]
TEST.{arr:{i:2}} 2021-03-17 13:50:54.348  [9,7,5,3,1]
dirk-zimoch commented 3 years ago

Looks OK now. Thanks for the quick fix.

BTW: When comparing pvinfo with cainfo, I noticed that pvinfo does not report the array dimensions.

    epics:nt/NTScalarArray:1.0
        short[] value

It would be nice to see something like this:

    epics:nt/NTScalarArray:1.0
        short[5] value