IMPROVING ABSTRACTIONS (HARDWARE OBJECTS POINT OF VIEW)

Slides:



Advertisements
Similar presentations
G make_counter params: body: count = 0 def counter():... my_counter params: body: count += 1... E1 count0 counter E2E2.
Advertisements

Classes and Objects: Recap A typical Java program creates many objects which interact with one another by sending messages. Through the objects interactions,
Road Map Introduction to object oriented programming. Classes
Example 2.
Math class methods & User defined methods Introduction to Computers and Programming in JAVA: V
Creating Object Oriented Programs Object oriented (OO) terminology Class vs. object Instantiate an object in a project Understand Class_Initialize / Terminate.
Classes and Objects  A typical Java program creates many objects which interact with one another by sending messages. Through the objects interactions,
Modeling using VBA. Using Toolbox This is a label This is a button Using the Toolbox select a GUI element and by mouse-click place it on the frame This.
Squirrel Programming Language By Nandini Bhatta CS537 Summer 2008.
 To be able to write larger programs ◦ By breaking them down into smaller parts and passing data between the parts.  To understand the concepts of Methods.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
Data Abstraction UW CSE 140 Winter What is a program? – A sequence of instructions to achieve some particular purpose What is a library? – A collection.
COMPE 111 Introduction to Computer Engineering Programming in Python Atılım University
The switch StatementtMyn1 The switch Statement Sometimes there can be a multiple-choice situation, in which you need to execute a particular set of statements.
Chapter Function Basics CSC1310 Fall Function function (subroutine, procedure)a set of statements different inputs (parameters) outputs In.
Flexible hierarchy design proposal. Flexible hierarchy design  Goals  Allow debug plugins to define their own debug element hierarchy and behaviour.
Applications Development
Introduction to Computing Using Python for loop / def- ining a new function  Execution control structures ( if, for, function call)  def -ining a new.
Chap. 4 Modules and Ports. 2 Modules and Ports Modules Ports Hierarchical Names Summary.
Python – Part 3 Functions 1. Getting help Start the Python interpreter and type help() to start the online help utility. Or you can type help(print) to.
Exercise 2 Introduction to C# CIS Create a class called Employee that contains the following private instance variables: Social Securitystring.
TOPIC : Transition Count Compression UNIT 5 : BIST and BIST Architectures Module 5.4 Compression Techniques.
Function Basics. Function In this chapter, we will move on to explore a set of additional statements that create functions of our own function (subroutine,
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Inheritance Inheritance is the process of extending the functionality of a class by defining a new class that inherit,all the features of extending class.
CS 142 Lecture Notes: RubySlide 1 Basic Ruby Syntax sum = 0 i = 1 while i
Laboratoire de l’Accélérateur Linéaire, Orsay, France and CERN Olivier Callot 18 March 2003 Online Data Format and Condition Database Proposed data format.
Kappa Workgroup Meeting | Bessy | Nov 28-29, 2011Session 4: Beamline GUIs 1 Beamline GUIs at ALBA Guifre Cuni on behalf of the Controls Group.
Classes - Intermediate
LECTURE 2 Python Basics. MODULES So, we just put together our first real Python program. Let’s say we store this program in a file called fib.py. We have.
These materials where developed by Martin Schray
Fastest Data Processing in Image Reconstruction for Compton Camera Imaging
Programming Right from the Start with Visual Basic .NET 1/e
Control software and MxCube integration
Reminder About Functions
Status of MXCuBE Beamline Control at BESSY II
Lecture 2 Python Basics.
Module 5: Common Type System
University of Central Florida COP 3330 Object Oriented Programming
Abstract Classes and Inheritence Operator over-loading
Functions.
Functional Programming with Java
Lecture 11 B Methods and Data Passing
Interfaces.
Basic Ruby Syntax sum = 0 i = 1 while i <= 10 do sum += i*i
Basic Ruby Syntax sum = 0 i = 1 while i <= 10 do sum += i*i
Abstract Classes.
METHODS AND BEHAVIORS AKEEL AHMED.
CORBA Object-by-Value
Substitution in string value
Lecture 1.3 Hardware Description Languages (HDLs)
Subprograms and Programmer Defined Data Type
CORBA Object-by-Value

ESRF Status report.
  30 A 30 B 30 C 30 D 30 E 77 TOTALS ORIGINAL COUNT CURRENT COUNT
Python Tutorial for C Programmer Boontee Kruatrachue Kritawan Siriboon
Functional interface.
Object-Oriented Programming in PHP
Module 2 - Part 1 Variables, Assignment, and Data Types
Module 2 Variables, Assignment, and Data Types
Module 2 - Part 1 Variables, Assignment, and Data Types
Test Automation For Web-Based Applications
BZHelp Review 25-Oct-14.
HARDWARE OBJECTS - PERPETUUM MOBILE
Unit-1 Introduction to Java
Functions So far we've been using functions from the builtin module, which is automatically loaded in most cases. Occasionally we've accessed functions.
Basic Ruby Syntax sum = 0 i = 1 while i <= 10 do sum += i*i
CISC101 Reminders Assignment 3 due today.
From LHC to Accelerator class
Presentation transcript:

IMPROVING ABSTRACTIONS (HARDWARE OBJECTS POINT OF VIEW) Antonia BETEVA 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA

IMPROVING ABSTRACTIONS – Current status Current status 8 Hardware Objects – 5 procedures and 4 equipment GenericSampleChanger, GenericDiffractometer, Minidiff… Problems Different constraints from the control systems Imposing methods (using the abc module) depending on who is writing the HO. AbstractCollect, AbstractMultiCollect. Needs change when adding new hardware. 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA

IMPROVING ABSTRACTIONS - proposal Distinguish between sequences (procedures) and equipment Generic* – sequences only Abstract* - equipment only Define only minimum variables and methods For procedures methods like start/execute/stop/pause... use cleanup, error_cleanup (with statement). For equipment only methods shared for all the similar equipment. provide a Mockup class to simulate missing equipment. Use abc with parsimony (or not?) Methods needed by the GUI. Use “standard” log/error report. 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA

IMPROVING ABSTRACTIONS - proposal All specific methods in specific class(es) Site specific, Beamline specific, Hardware specific …but Share same equipment HO between different sites Create equipment specific HO (MD2Motor, SardanaMotor...) Improve MD2Motor rather than create ESRFMD2Motor. 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA

IMPROVING ABSTRACTIONS – procedure example AbstractEnergyScan Methods imposed by the GUI With a known signature – startEnergyScan (element,edge,directory,prefix,session_id=None,blsample_id=None) With free signature – scanCommandStarted (*args, **kwargs ) Legacy methods - isConnected Two compulsory (but empty methods) escan_cleanup, escan_error_cleanup def escan_cleanup(self): pass ESRF EnergyScan – inherits from Abstract Methods Shared by all the beamlines – doChooch ID29 EnergyScan – inherits from ESRF Beamline specific methods 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA

IMPROVING ABSTRACTIONS – Equipment example GenericMCA Imposed methods start_acq (cnt_time=None) Keyword Args: cnt_time (float, optional): count time [s]; 0 means to count indefinitely Returns: None read_data(chmin, chmax, calib=False) chmin (float): channel number or energy [keV] chmax (float): channel number or energy [keV] calib (bool): use calibration, defaults to Fals numpy.array. x - channels or energy (if calib=True), y - data. ESRFMCA – inherits from GerericMCA MCA specific methods - get/set roi, get/set calibration Detector specific methods - get/set presets RontecMCA – inherits forom GenericMCA 10th MxCUBE Workshop, 16-18/01/2017, ESRF, Grenoble Antonia BETEVA