Client Data Types
description
Transcript of Client Data Types
![Page 1: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/1.jpg)
Client Data TypesGabriele Carcassi
Oct 12 2010
![Page 2: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/2.jpg)
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
![Page 3: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/3.jpg)
References and documentation
Project available at http://pvmanager.sourceforge.net
JavaDocs (with actual documentation) at http://pvmanager.sourceforge.net/apidocs/index.html
Package org.epics.pvmanager.data
![Page 4: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/4.jpg)
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<T>, 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)
![Page 5: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/5.jpg)
VDouble
Let’s start with the most common one, VDouble• Scalar<Double>• Alarm• Time• Display<Double>
Let’s go through details of all interfaces
![Page 6: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/6.jpg)
Scalar<T>
Defines:• T getValue()
Returns the value of some type.
![Page 7: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/7.jpg)
Alarm
Defines:• AlarmSeverity getAlarmSeverity();• Set<AlarmStatusElement> getAlarmStatus();• List<AlarmStatusElement> 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.
![Page 8: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/8.jpg)
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)
![Page 9: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/9.jpg)
Display<T>
Defines:• T getLower/UppterDisplayLimit();• T getLower/UppterCtrlLimit();• T getLower/UppterAlarmLimit();• T getLower/UppterWarningLimit();• String getUnits();• NumberFormat getFormat();
![Page 10: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/10.jpg)
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
![Page 11: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/11.jpg)
All scalar types
VDouble – Scalar<Double>, Alarm, Time, Display<Double>
VInt - Scalar<Integer>, Alarm, Time, Display<Integer>
VString - Scalar<String>, Alarm, Time VEnum - Scalar<String>, Enum, Alarm, Time
![Page 12: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/12.jpg)
Enumeration
Enum defines:• List<String> getLabels();
Venum defines:• int getIndex();
![Page 13: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/13.jpg)
Multi dimensional arrays
VDoubleArray - Array<Double>, Alarm, Time, Display<Double>
VIntArray - Array<Integer>, Alarm, Time, Display<Integer>
VStringArray - Array<String>, Alarm, Time VEnumArray - Array<String>, Enum, Alarm, Time
![Page 14: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/14.jpg)
Array<T>
Defines:• List<Integer> 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();
![Page 15: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/15.jpg)
Multi Channel arrays
Multiple values coming from different channels (e.g. all X BPM readbacks)
VMultiDouble: MultiScalar<VDouble>, Alarm, Time, Display<Double>
VMultiInt: MultiScalar<VInt>, Alarm, Time, Display<Integer>
VMultiString: MultiScalar<VString>, Alarm, Time VMultiEnum: MultiScalar<VEnum>, Enum, Alarm,
Time
![Page 16: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/16.jpg)
MultiScalar<T>
Defines:• List<T> getValues();
![Page 17: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/17.jpg)
Statistics
VStatistics: Statistics, Alarm, Time, Display<Double> Statistics define:
• Double getAverage();• Double getStdDev();• Double getMin();• Double getMax();• Integer getNSamples();
Does not define how it’s calculated (different weights)
![Page 18: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/18.jpg)
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.
![Page 19: Client Data Types](https://reader036.fdocuments.in/reader036/viewer/2022062305/56816187550346895dd1217e/html5/thumbnails/19.jpg)
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