AtacamaLargeMillimeterArray ACS Training Developing Python Components.

Slides:



Advertisements
Similar presentations
CLASS INHERITANCE Class inheritance is about inheriting/deriving properties from another class. When inheriting a class you are inheriting the attributes.
Advertisements

ESO - Tokyo July, 2005 ALMA Common Software Training- Course Session 1b Distributed Systems G.Chiozzi.
Chapter 1 Object-Oriented Concepts. A class consists of variables called fields together with functions called methods that act on those fields.
Review of Inheritance. 2 Several Levels of Inheritance Base Class B Derived class D Derived class D1.
Java Programming 2 Dr. Priti Srinivas Sajja Introductory concepts of java programming as specified in PGDCA 203:Object Technology, S P University.
INHERITANCE BASICS Reusability is achieved by INHERITANCE
Inheritance Math 130 B Smith: Consider using the example in SAMS Teach Yourself C++ in 24 hours B Smith: Consider using the example in SAMS Teach Yourself.
Esempio Polimorfismo1 // Definition of abstract base class Shape #ifndef SHAPE_H #define SHAPE_H class Shape { public: virtual double area() const { return.
Advanced Programming in Java
Sadegh Aliakbary Sharif University of Technology Fall 2010.
ITEC200 – Week03 Inheritance and Class Hierarchies.
Designing Classes Chapter 3. 2 Chapter Contents Encapsulation Specifying Methods Java Interfaces Writing an Interface Implementing an Interface An Interface.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
7 th ACS Workshop 2010 Antofagasta, Chile ACS Project Lifecycle Matias Mora (based on presentation by G. Chiozzi and J. Ibsen)
II. Middleware for Distributed Systems
ACS Workshop UCN BACI properties Atacama Large Millimeter Array Alessandro Caproni European Southern Observatory BACI properties.
AtacamaLargeMillimeterArray ACS Training Time System.
Inheritance #1 First questions Similar to Python? What about visibility and encapsulation? – can an object of the child class access private members.
Computer Science 210 Computer Organization Modular Decomposition Making a Library Separate Compilation.
Python 3 Some material adapted from Upenn cis391 slides and other sources.
(c) University of Washington04-1 CSC 143 Java Inheritance Example (Review)
Inheritance using Java
Inheritance in C++ CS-1030 Dr. Mark L. Hornick.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
AtacamaLargeMillimeterArray ACS Training Developing Python Clients.
The ALMA Common Software: a developer friendly CORBA-based framework G.Chiozzi d, B.Jeram a, H.Sommer a, A.Caproni e, M.Pesko bc, M.Sekoranja b, K.Zagar.
Inheritance and Class Hierarchies Ellen Walker CPSC 201 Data Structures Hiram College.
ACS Error System Using it in JAVA Sohaila Lucero NRAO.
Integrating the CERN laser alarm system with the ALMA common Software SPIE, Orlando, May 2006 Integrating the CERN LASER Alarm System with the ALMA Common.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Tutorial 5 Superclasses, Subclasses and Inheritance.
ALMA Control SW & ACS Ralph Marson (NRAO). ALMA Project ACS Course, June 22 – July , Garching, Germany Physical Layout of the M&C network.
Tokyo July, 2005 ACS Characteristic Components B. Jeram, …..
ALMA Common Software Basic Track Component implementation guidelines.
ACS Logging System APIs: C++ Bogdan Jeram European Southern Observatory July 2004NRAO.
ICALEPCS Archamp 08 – 09 October, 2005 ACS Alarm system prototype Alessandro Caproni.
CSC 508 – Theory of Programming Languages, Spring, 2009 Week 3: Data Abstraction and Object Orientation.
ACS Error System APIs: C++ Bogdan Jeram European Southern Observatory July 2005ESO.
AtacamaLargeMillimeterArray ACS Training Notification Channels (last updated by Heiko Sommer, Nov. 2009)
ACS Component Simulator J. Ibsen European Southern Observatory Garching – January 2007ESO.
Running ACS Bogdan Jeram European Southern Observatory July 2005NAOJ.
AtacamaLargeMillimeterArray Abeans. Garching, February 2004ACS Training2 What are Abeans? Abeans are Java beans of the IDL interfaces (for the client.
Inheritance. Inheritance - Introduction Idea behind is to create new classes that are built on existing classes – you reuse the methods and fields and.
ICALEPCS 2005 Geneva, Oct. 12 The ALMA Telescope Control SystemA. Farris The ALMA Telescope Control System Allen Farris Ralph Marson Jeff Kern National.
Coming up: Inheritance
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Classes, Interfaces and Packages
AD Lecture #1 Object Oriented Programming Three Main Principles 1 Inheritance Encapsulation Polymorphism.
AtacamaLargeMillimeterArray ACS Training Using the Python Error System.
SourceAnatomy1 Java Source Anatomy Barb Ericson Georgia Institute of Technology July 2008.
ESO - Garching 08 – 09 March, st ALMA Common Software Workshop ACS Container/Component Model.
POLYMORPHISM Chapter 6. Chapter Polymorphism  Polymorphism concept  Abstract classes and methods  Method overriding  Concrete sub classes and.
Classes Classes are a major feature of C++. They support – – Abstraction – Data hiding – Encapsulation – Modularity – Re-use through inheritance.
ACS on VxWorks B.Gustafsson European Southern Observatory ESO Feb ESO.
SUBCLASSES - JAVA. The Purpose of Subclasses Class Farm String getOwner() void setOwner(String s) int getSize() void setSize(int s) Class DairyFarm String.
T. Meyer ROD Software Workshop July 2002 Scripting and Interpreted Languages Tom Meyer Iowa State University
Python 3 Some material adapted from Upenn cis391 slides and other sources.
Week 8 Classes and Objects
Notification Channel - Java API
Interface Definition Language
C++ Classes C++ Interlude 1.
BACI Properties Mount2 example
Introduction to Python
ACS ALMA Common software Demo Setup
Week 6 Object-Oriented Programming (2): Polymorphism
Interfaces.
Recitation 7 October 7, 2011.
Classes.
Chapter 14 Abstract Classes and Interfaces
Presentation transcript:

AtacamaLargeMillimeterArray ACS Training Developing Python Components

NRAO - Socorro, July, 2004ACS Training2 What’s Available in Python? Python implementation of the Component IDL interface May implement IDL interfaces derived from ACS::ACSComponent May not implement IDL interfaces derived from ACS::CharacteristicComponent

NRAO - Socorro, July, 2004ACS Training3 Example #ifndef _ACSCOURSE_MOUNT_IDL_ #define _ACSCOURSE_MOUNT_IDL_ #include /* */ #pragma prefix "alma" module ACSCOURSE_MOUNT { interface Mount1 : ACS::ACSComponent { /* (Pre)sets a new non-moving position for the antenna. az position azimuth (degree) elev position elevation (degree) */ void objfix (in double az, in double elev); }; #endif IDL Py CORBA Stubs ACSCOURSE_MOUNT__POA Developer ACSCOURSE_MOUNTImpl/Mount1.py

NRAO - Socorro, July, 2004ACS Training4 Example (continued) #--CORBA STUBS import ACSCOURSE_MOUNT__POA #--ACS Imports from Acspy.Servants.ContainerServices import ContainerServices from Acspy.Servants.ComponentLifecycle import ComponentLifecycle from Acspy.Servants.ACSComponent import ACSComponent class Mount1(ACSCOURSE_MOUNT__POA.Mount1, #CORBA stubs for IDL Int. ACSComponent, #Base IDL interface ContainerServices, #Developer niceties ComponentLifecycle): #HLA stuff def __init__(self): '''Just call superclass constructors here.''' ACSComponent.__init__(self) ContainerServices.__init__(self) return

NRAO - Socorro, July, 2004ACS Training5 Example (continued) # #--Override ComponentLifecycle methods # def initialize(self): ''' Override this method inherited from ComponentLifecycle ''' self.getLogger().logInfo("Not much to see here!")

NRAO - Socorro, July, 2004ACS Training6 Example (continued) # #--Implementation of IDL methods # def objfix(self, az, el): '''Python implementation of IDL method''' self.getLogger().logInfo("objfix called with az="+str(az)+ " and el="+str(el)) # #--Main defined only for generic testing # if __name__ == "__main__": print "Creating an object" g = Mount1() print "Done..."

NRAO - Socorro, July, 2004ACS Training7 What methods does ACSComponent have? In general, many methods are provided but only a couple should ever be invoked by yourcouple code.

NRAO - Socorro, July, 2004ACS Training8 What methods does ContainerServices have? Too manyToo many to cover in the short time given for this presentation!

NRAO - Socorro, July, 2004ACS Training9 What methods does ComponentLifecycle have? The same as Java although they’re nicer to work with in Python because we’re not limited to single inheritance. Descriptions of these methods can be found here.here

NRAO - Socorro, July, 2004ACS Training10 Python-related Makefile Targets PY_SCRIPTS - Specifies Python scripts without the.py extension that will be installed into $INTROOT/bin. PY_MODULES – Specifies Python modules with the.py extension that will be installed into $INTROOT/lib/python/site-packages. PY_PACKAGES – Specifies Python packages to be installed into $INTROOT/lib/python/site-packages. Really these are just directories containing Python scripts.

NRAO - Socorro, July, 2004ACS Training11 CDB entry <_ Name="MOUNT_PY_1“ Code="ACSCOURSE_MOUNTImpl.Mount1" Type="IDL:alma/ACSCOURSE_MOUNT/Mount1:1.0" Container="mountPython" /> Package.module

NRAO - Socorro, July, 2004ACS Training12 Questions about Python Servants???

NRAO - Socorro, July, 2004ACS Training13 Demo