Client Data Types Gabriele Carcassi Oct
Scope and requirements Define client side data structures to represent data for control systems and high level applications Indicates what goes on the wire, but it’s not what goes on the wire Definition through Java interfaces Compatibility between Epics 3 and 4 Defined as part of PVManager for convenience, but they do not have dependencies on PVManager nor PVManager depends on them
References and documentation Project available at JavaDocs (with actual documentation) at l l Package org.epics.pvmanager.data
Design guidelines All data types defined through interfaces Two types of interfaces Full type (e.g. VDouble, VMultiInt, VStatistics): they represent types that are actually implemented and can be asked; they all look like VXxx (where V is value) Partial type (e.g. Scalar, Alarm, Time): they represent common parts of data across different full types; they are defined separately so that we have one definition and so that clients can code to that partial interface Full types are made up as collections of partial types (mostly don’t define new methods)
VDouble Let’s start with the most common one, VDouble Scalar Alarm Time Display Let’s go through details of all interfaces
Scalar Defines: T getValue() Returns the value of some type.
Alarm Defines: AlarmSeverity getAlarmSeverity(); Set getAlarmStatus(); List getPossibleAlarms(); AlarmSeverity: enumeration of NONE, MINOR, MAJOR, INVALID, UNDEFINED It can return more than one status, each status a String plus an AlarmSeverity Note: client side. Protocol might send a byte, with Strings only at connection or hardcoded client/server.
Time Defines: TimeStamp getTimeStamp(); Integer getTimeUserTag(); TimeStamp is a nanosecond accuracy instant Investigating use of JSR-310 Date and Time API javax.time.Instant (64 bit second + 32 bit nanosecond) TimeUserTag can be used to identify fill patterns (improved from Epics 3)
Display Defines: T getLower/UppterDisplayLimit(); T getLower/UppterCtrlLimit(); T getLower/UppterAlarmLimit(); T getLower/UppterWarningLimit(); String getUnits(); NumberFormat getFormat();
VDouble VDouble is one type, and defines all those elements. Does it mean that it provides all those elements? That every time I ask for a VDouble I get everything? NO! You can still have partial implementations, that throw UnsupportedOperationException on the pieces that they do not implement. You can fill in with default data. The point is to avoid 2^4 combinations
All scalar types VDouble – Scalar, Alarm, Time, Display VInt - Scalar, Alarm, Time, Display VString - Scalar, Alarm, Time VEnum - Scalar, Enum, Alarm, Time
Enumeration Enum defines: List getLabels(); Venum defines: int getIndex();
Multi dimensional arrays VDoubleArray - Array, Alarm, Time, Display VIntArray - Array, Alarm, Time, Display VStringArray - Array, Alarm, Time VEnumArray - Array, Enum, Alarm, Time
Array Defines: List getSizes(); The list of sizes for the multi dimensional array. One dimensional array can simply disregard this field. Difference between primitives and objects forces the array in the Full type. VDoubleArray: double[] getArray(); VIntArray: int[] getArray(); VEnumArray, VStringArray: String[] getArray();
Multi Channel arrays Multiple values coming from different channels (e.g. all X BPM readbacks) VMultiDouble: MultiScalar, Alarm, Time, Display VMultiInt: MultiScalar, Alarm, Time, Display VMultiString: MultiScalar, Alarm, Time VMultiEnum: MultiScalar, Enum, Alarm, Time
MultiScalar Defines: List getValues();
Statistics VStatistics: Statistics, Alarm, Time, Display Statistics define: Double getAverage(); Double getStdDev(); Double getMin(); Double getMax(); Integer getNSamples(); Does not define how it’s calculated (different weights)
VTable Defines: int getColumnCount(); Class getColumnType(int column); String getColumnName(int column); Object getColumnArray(int column); A table is a list of columns. A column is an array of elements of a particular type plus a name.
Status Interface definition 90% done PVManager tests and example re-implemented on these interfaces Scalar types integrated in PVManager Generated by simulation and epics 3 data sources MultiDouble used for synchronized array reconstruction