Data Types written by Gabriele Carcassi performed by Bob Dalesio based on ideas/requirements from Bob Dalesio, Kay Kasemir, Ralph Lange, James Roland,

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Lists Chapter 4 Carrano, Data Structures and Abstractions with Java, Second Edition, (c) 2007 Pearson Education, Inc. All rights reserved X.
JavaIOC Overview and Update EPICS Seminar/Workshop Raja Ramanna Centre For Advanced Technology Indore India January Presented by: Marty Kraimer.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Arrays.
Control System Studio (CSS) Data Access Layer (DAL) Kay Kasemir, Xihui Chen July 2009.
EPICS V4/areaDetector Integration
Computer Science 209 Software Development Equality and Comparisons.
Lecture 9: More on objects, classes, strings discuss hw3 assign hw4 default values for variables scope of variables and shadowing null reference and NullPointerException.
CSS Developments at BNL / NSLS-II Gabriele Carcassi Feb
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
PvData,pvAccess,javaIOC,pvService Status EPICS Meeting Aix-en-Provence, France Marty Kraimer, Guobao Shen, and Matej Sekoranja.
Representing Data Elements Gayatri Gopalakrishnan.
CS 106 Introduction to Computer Science I 02 / 20 / 2008 Instructor: Michael Eckmann.
ECE122 L3: Expression Evaluation February 6, 2007 ECE 122 Engineering Problem Solving with Java Lecture 3 Expression Evaluation and Program Interaction.
CS 225 Java Review. Java Applications A java application consists of one or more classes –Each class is in a separate file –Use the main class to start.
Arrays. A problem with simple variables One variable holds one value –The value may change over time, but at any given time, a variable holds a single.
Arrays. A problem with simple variables One variable holds one value –The value may change over time, but at any given time, a variable holds a single.
Java Unit 9: Arrays Declaring and Processing Arrays.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
JavaIOC Marty Kraimer EPICS Collaboration Meeting ICALEPCS October
Data Formats CMSC 491 Hadoop-Based Distributed Computing Spring 2015 Adam Shook.
Avro Apache Course: Distributed class Student ID: AM Name: Azzaya Galbazar
Java: Chapter 1 Computer Systems Computer Programming II.
A First Book of ANSI C Fourth Edition
Announcements  I will discuss the labtest and the written test #2 common mistakes, solution, etc. in the next class  not today as I am still waiting.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
The Java Programming Language
Basic Java Syntax CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © 2002, Systems and Computer Engineering, Carleton University a-JavaReview.ppt * Object-Oriented Software Development Unit.
Chapter 8: Arrays.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Java™ How to Program, 9/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Arrays An array is a data structure that consists of an ordered collection of similar items (where “similar items” means items of the same type.) An array.
PVManager Gabriele Carcassi Feb PVManager goals  Simplify data collection and aggregation  Simplify (UI) development  Re-use code as much.
Data Structure & File Systems Hun Myoung Park, Ph.D., Public Management and Policy Analysis Program Graduate School of International Relations International.
Data Design and Implementation. Definitions of Java TYPES Atomic or primitive type A data type whose elements are single, non-decomposable data items.
New Features in EPICS V4 Release 4.4 EPICS Meeting 2014, CEA, October 2014 Marty Kraimer, Matej Sekoranja.
Archive Service Nikolay Malitsky October 2, 2013.
MASAR Server & Application Guobao Shen Photon Sciences Department Brookhaven National Laboratory Collaboration Working Group Oct 02, 2013.
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
M180: Data Structures & Algorithms in Java Arrays in Java Arab Open University 1.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
DT228/3 Web Development Databases. Querying a database: Partial info Search engines, on-line catalogues often need to allow user to search a database.
CompSci 100E 40.1 Java 5 New Features  Generics  Enhanced for loop  Autoboxing/unboxing  Typesafe enums  Other  Varargs  Static Import  Metadata.
CS 376b Introduction to Computer Vision 01 / 23 / 2008 Instructor: Michael Eckmann.
Hashing as a Dictionary Implementation Chapter 19.
1 BROOKHAVEN SCIENCE ASSOCIATES Control System Overview Bob Dalesio, Control Group HLA Review for NSLS-II Project April
A (VERY) SHORT INTRODUCTION TO MATLAB J.A. MARR George Mason University School of Physics, Astronomy and Computational Sciences.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
Client Data Types Gabriele Carcassi Oct Scope and requirements  Define client side data structures to represent data for control systems and.
© 2007 Pearson Addison-Wesley. All rights reserved2-1 Character Strings A string of characters can be represented as a string literal by putting double.
int [] scores = new int [10];
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
Arrays. What is an array? An array is a collection of data types. For example, what if I wanted to 10 different integers? int num1; int num2; int num3;
CS0007: Introduction to Computer Programming Primitive Data Types and Arithmetic Operations.
1 BROOKHAVEN SCIENCE ASSOCIATES EPICS Version 4 – Normative V4 Team – presented by Bob Dalesio EPICS Meeting October 7, 2011.
Version 4 Charter – Discussion Bob Dalesio Greg White.
Switch, Rounding Errors, Libraries
EPICS Version 4 Abstract:
Properties 7: Properties Programming C# © 2003 DevelopMentor, Inc.
5. 3 Coding with Denotations
Chap 2. Identifiers, Keywords, and Types
EPICS 7 Matej Sekoranyja, Marty Karimer, Michael Davidsaver, Ralph Lange, Andrew Johnson, Timo Korhonen, Heinz Junkes, Patrick Marschalik, Murali Shankar,
Java Coding 6 David Davenport Computer Eng. Dept.,
Presentation transcript:

Data Types written by Gabriele Carcassi performed by Bob Dalesio based on ideas/requirements from Bob Dalesio, Kay Kasemir, Ralph Lange, James Roland, Guobao Shen, Greg White Oct

Scope and requirements  Java interfaces define client side data structures to represent data for control systems and high level applications pvData structure define data structure that represent information passed on the wire  Compatibility between Epics 3 and 4  Java interfates as part of PVManager for convenience; no 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(); AlarmStatus getAlarmStatus();  AlarmSeverity: NONE, MINOR, MAJOR, INVALID, UNDEFINED (3 bits)  AlarmStatus: DEVICE, DRIVER, RECORD, DB, CONF, UNDEFINED, CLIENT, NONE (4 bits)  Gives the highest alarm and where it originates; first pass, generic information VExtendedAlarm is for more detailed information

Time  Defines: TimeStamp getTimeStamp(); Integer getTimeUserTag(); boolean isValid();  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 or anything your heart desires  isValid() used to flag when the time source is “bad” (time was not set, returns always EPICS time 0, …)

Display  Defines: Double getLower/UppterDisplayLimit(); Double getLower/UppterCtrlLimit(); Double getLower/UppterAlarmLimit(); Double getLower/UppterWarningLimit(); String getUnits(); NumberFormat getFormat();  Limits are always in double, regardless of the numeric type

VDouble  VDouble is one type, and defines all those elements.  One can still have partial implementations, that throw UnsupportedOperationException on the pieces that they do not implement or return null.  We want to avoid 2^4 combinations

All scalar types  VDouble – Scalar, Alarm, Time, Display  VInt - Scalar, Alarm, Time, Display  Explicitly no VFloat, VShort, VByte… Is VBoolean needed?  VString - Scalar, Alarm, Time  VEnum - Scalar, Enum, Alarm, Time

Enumeration  Enum defines: List getLabels();  VEnum defines: int getIndex();  Should the index be byte, short or int?

Scalar types

Multi dimensional arrays  VDoubleArray - Array, Alarm, Time, Display  VFloatArray - Array, Alarm, Time, Display  VIntArray - Array, Alarm, Time, Display  VShortArray - Array, Alarm, Time, Display  VByteArray - Array, Alarm, Time, Display  (VBooleanArray ?)  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(); - VEnumArray also defines int[] getIndexes(); …

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  (May need others VMultiDoubleArray,... ?)

MultiScalar  Defines: List getValues(); List getNames();  Should labels for enums be the same across all values, or can they be different? (Note: VEnumArray already may cover the case for same metadata)  Should metadata for numeric data be forced to the same? Or should each carry their own? (Note: numeric arrays may cover the case for same metadata)

Multi Channel Array

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(); int getRowCount(); 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.  Different column may have different size: rowCount is the maximum across all columns

VTable

VImage  Defines: int getHeight(); int getWidth(); byte[] getData(); VTable getMetadata();  How do we describe encoding?  Is VTable good enough for metadata? Is it too much? Do we need to divide metadata for each image from the metadata that does not change for each image?  Should this have Time and Alarm?

VImage

VExtendedAlarm  Defines: List getConditions(); String getMessage();  Condition defines: String getName(); AlarmSeverity getSeverity(); boolean isActive();  VExtendedAlarm gives you the full list of alarms for a device. It says which ones are active. It provides an error message  Should each condition also have the AlarmStatus?

Status  Many types are already operational in PVManager with Epics 3, simulated generation and aggregation  Scalar and Array types can be directly generated by JCADataSource and simulated sources  VTable used in client-side aggregation  VImage used in clieant-side computation  VMultiDouble used for synchronized array reconstruction