Skip to content

Commit 453a2a3

Browse files
committed
Allow indexed access of scalar array elements for pva
1 parent 770f350 commit 453a2a3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/pv-pva/src/main/java/org/phoebus/pv/pva/PVAStructureHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,14 @@ else if (field instanceof PVAString)
110110
return decodeScalar(actual);
111111
if (type.equals("NTEnum:1.0"))
112112
return Decoders.decodeEnum(actual);
113-
if (type.equals("NTScalarArray:1.0"))
114-
return decodeNTArray(actual);
113+
if (type.equals("NTScalarArray:1.0")) {
114+
if(elementIndex.isPresent()){
115+
return decodeNTArray(actual, elementIndex.get());
116+
}
117+
else{
118+
return decodeNTArray(actual);
119+
}
120+
}
115121
if (type.equals("NTNDArray:1.0"))
116122
return ImageDecoder.decode(actual);
117123
if (type.equals("NTTable:1.0"))

0 commit comments

Comments
 (0)