Skip to content

Commit 37cf3da

Browse files
committed
Allow array index in PV name
1 parent 3ba99e5 commit 37cf3da

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.epics.vtype.Display;
5050
import org.epics.vtype.Time;
5151
import org.epics.vtype.VBoolean;
52+
import org.epics.vtype.VInt;
5253
import org.epics.vtype.VNumber;
5354
import org.epics.vtype.VNumberArray;
5455
import org.epics.vtype.VString;
@@ -110,8 +111,14 @@ else if (field instanceof PVAString)
110111
return decodeScalar(actual);
111112
if (type.equals("NTEnum:1.0"))
112113
return Decoders.decodeEnum(actual);
113-
if (type.equals("NTScalarArray:1.0"))
114-
return decodeNTArray(actual);
114+
if (type.equals("NTScalarArray:1.0")) {
115+
if(elementIndex.isPresent()){
116+
return decodeNTArray(actual, elementIndex.get());
117+
}
118+
else{
119+
return decodeNTArray(actual);
120+
}
121+
}
115122
if (type.equals("NTNDArray:1.0"))
116123
return ImageDecoder.decode(actual);
117124
if (type.equals("NTTable:1.0"))

0 commit comments

Comments
 (0)