atacamalargemillimeterarray acs training using the python error system
DESCRIPTION
NRAO, July 2004ACS Training3 What’s Available in Python? Everything available in C++ including Completion helper class support, but it’s much simpler to use.TRANSCRIPT
![Page 1: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/1.jpg)
AtacamaAtacamaLargeLargeMillimeterMillimeterArrayArray
ACS Training
Using the Python Error System
![Page 2: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/2.jpg)
NRAO, July 2004 ACS Training 2
Getting Started
At the console, type: cvs co ACS/LGPL/CommonSoftware/acscourseThis gives you the source code from the slides.
![Page 3: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/3.jpg)
NRAO, July 2004 ACS Training 3
What’s Available in Python?
Everything available in C++ including Completion helper class support, but it’s much simpler to use.
![Page 4: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/4.jpg)
NRAO, July 2004 ACS Training 4
Example (XML)
<?xml version="1.0" encoding="UTF-8"?><Type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ACSError.xsd" name="ACSErrTypeACSCourse" type="9005" _prefix="alma"> <Code name="Pointing" shortDescription="Pointing" description="Pointing in progress"/> <ErrorCode name="TargetNotFound" shortDescription="Target Not Found" description="Target Couldn't be found"/></Type>
![Page 5: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/5.jpg)
NRAO, July 2004 ACS Training 5
Example (IDL)
#ifndef _ACSCOURSE_MOUNT_IDL_#define _ACSCOURSE_MOUNT_IDL_
#include <baci.idl> /* <acscomponent.idl> */#include <ACSErrTypeACSCourse.idl>#pragma prefix "alma"
module ACSCOURSE_MOUNT {interface Mount1 : ACS::ACSComponent {
/* (Pre)sets a new non-moving position for the antenna.* @param az position azimuth (degree)
* @param elev position elevation (degree) */ void objfix (in double az, in double elev) raises (ACSErrTypeACSCourse::TargetNotFoundEx); };};#endif
IDL
![Page 6: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/6.jpg)
NRAO, July 2004 ACS Training 6
Example (Python)
import ACSCOURSE_MOUNT__POA#--ACS Imports----------------------------------------------------------from Acspy.Servants.ContainerServices import ContainerServicesfrom Acspy.Servants.ComponentLifecycle import ComponentLifecyclefrom Acspy.Servants.ACSComponent import ACSComponentimport ACSErrTypeACSCourseImpl
class Mount1(ACSCOURSE_MOUNT__POA.Mount1, #CORBA stubs for IDL interface ACSComponent, #Base IDL interface ContainerServices, #Developer niceties ComponentLifecycle): #HLA stuff '''Simple component impl provided as a reference for developers.''' def __init__(self): ACSComponent.__init__(self) ContainerServices.__init__(self) return
Correspondsto Error Type
![Page 7: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/7.jpg)
NRAO, July 2004 ACS Training 7
Example (Python)
#--------------------------------------------------------------------------def objfix(self, az, el): '''Python implementation of IDL method.''' if el>90: self.getLogger().logInfo("objfix called with az="+str(az)+ " and el="+str(el)) else: self.getLogger().logCritical("Wrong value for el "+str(el)) raise ACSErrTypeACSCourseImpl.TargetNotFoundExImpl()
Correspondsto Error Type Corresponds
to ErrorCode
![Page 8: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/8.jpg)
NRAO, July 2004 ACS Training 8
What methods do exception/completion helper classes generated by the ACS Error System have?
As usual, look at the Pydoc!
![Page 9: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/9.jpg)
NRAO, July 2004 ACS Training 9
Questions about the Python Error System?
![Page 10: AtacamaLargeMillimeterArray ACS Training Using the Python Error System](https://reader036.vdocuments.net/reader036/viewer/2022082620/5a4d1b307f8b9ab05999adab/html5/thumbnails/10.jpg)
NRAO, July 2004 ACS Training 10
Demo