#ifndef _ACSCOURSE_ASM_IDL_
#define _ACSCOURSE_ASM_IDL_

/*******************************************************************************
*    ALMA - Atacama Large Millimiter Array
*
*    (c) European Southern Observatory, 2002
*    Copyright by ESO (in the framework of the ALMA collaboration)
*    and Cosylab 2002, All rights reserved
*
*    This library is free software; you can redistribute it and/or
*    modify it under the terms of the GNU Lesser General Public
*    License as published by the Free Software Foundation; either
*    version 2.1 of the License, or (at your option) any later version.
*
*    This library is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*    Lesser General Public License for more details.
*
*    You should have received a copy of the GNU Lesser General Public
*    License along with this library; if not, write to the Free Software
*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
*
*
* "@(#) $Id: acscourseAsm.idl,v 1.3 2004/01/30 16:17:20 dfugate Exp $"
*
* who       when      what
* --------  --------  ----------------------------------------------
*/

#include <baci.idl>
//#include <ACSErrTypeCommon.idl>
//#include <ACSErrTypeACSCourse.idl>

/*
 * This comes AFTER all includes
 */
#pragma prefix "alma"


/** @file acsexmplAsm.idl
 *  IDL specification of Asm object for ACS Course
 *
 *  There are 4 different interfaces that show
 */

module ACSCOURSE_ASM 
{
    /** @interface Asm1
     *  This is a simple Asm, with a very basic interface
     *  Just one command to set measurement average value (nbOfValues)
     */
    interface Asm1 : ACS::ACSComponent
	{
	
	/**
	 * Current temperature (c degrees ).
	 */
	//readonly attribute ACS::RWdouble temperature;

 	/**
	 * (Pre)sets a number of recorded values to be averaged.
	 *
	 * @param nbOfValues        number of data to be averaged
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void setAverageValue (in double nbOfValues);
	};    
    /********************************************************************/
    /** @interface Asm2
     *  This adds properties to the Asm1 example.
     *  With properties we can now have monitors, alarms
     *  and many additional features.
     *  We need now to inherit from the more complex 
     *  ACS::CharacteristicComponent interface
     *  For this example we have  1 read only and 1 read/write properties.
     */
    interface Asm2 : ACS::CharacteristicComponent
    {
        /**
         * Current temperature (c degrees ).
         */
        //readonly attribute ACS::RWdouble temperature;

        /**
         * (Pre)sets a number of recorded values to be averaged.
         *
         * @param nbOfValues        number of data to be averaged
         * @htmlonly
         * <br><hr>
         * @endhtmlonly
         */
        void setAverageValue (in double nbOfValues);
        void setAverageValueAsync (in double nbOfValues,
                                   in ACS::CBdouble callBack,
                                   in ACS::CBDescIn desc);

        /**
         * Current actual temperature (C degree).
         */
        readonly attribute ACS::ROdouble actTemp;

        /**
         * Current commanded average.
         */
        readonly attribute ACS::RWdouble cmdNbOfAveragedValues;
    };    

#if 0


    /********************************************************************/
    /** @interface Asm3
     *  Here we have a "complete" interface, including exceptions
     *  This time all properties are read only, because we set the values
     *  of azimuth and elevation via commands.
     */
    interface Asm3: ACS::CharacteristicComponent
	{
	enum coordType { Mean, Apparent };
	/**
	 * (Pre)sets a new equatorial source for the antenna to track.
	 * The source position is given in geocentric equatorial J2000 
	 * coordinates.  
	 *
	 * @param ra        source right ascension (hour)
	 * @param dec       source declination (hour)
	 * @param pmRa      source sky proper motion in right ascension (arc-sec/year)
	 * @param pmDec     source sky proper motion in declination (arc-sec/year)
	 * @param radVel    source radial velocity (kilometer/sec)
	 * @param par       source parallax correction (arc-sec)
	 * @param type      Apparent or Mean
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void obstar (in double ra,
		     in double dec,
		     in double pmRa,
		     in double pmDec,
		     in double radVel,
		     in double par,
		     in coordType type);
	
	/**
	 * (Pre)sets a new non-moving position for the antenna.
	 * The position coordinates are given in azimuth and elevation.  A 
	 * callback is used to inform the caller when the antenna reaches the 
	 * new position.  If a new position is given before the previous one is 
	 * reached then the previous callback immediately receives "aborted".
	 *
	 * @param az        position azimuth (degree)
	 * @param elev      position elevation (degree)
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void objfix (in double az,
		     in double elev);
	
	/**
	 * Current commanded azimuth (degree).
	 */
	readonly attribute ACS::ROdouble cmdAz;
	
	/**
	 * Current commanded elevation (degree).
	 */
	readonly attribute ACS::ROdouble cmdEl;
	
	/**
	 * Current actual azimuth (degree).
	 */
	readonly attribute ACS::ROdouble actAz;
	
	/**
	 * Current actual elevation (degree).
	 */
	readonly attribute ACS::ROdouble actEl;	
	};    


    /********************************************************************/
    /** @interface Asm4
     *  Defines the interface for controlling and monitoring the antenna position.
     *  This interface also includes aynchronous methods.
     */
    interface Asm4 : ACS::CharacteristicComponent
	{
	enum coordType { Mean, Apparent };
	/**
	 * (Pre)sets a new equatorial source for the antenna to track.
	 * The source position is given in geocentric equatorial J2000 
	 * coordinates.  
	 * Synchronous interface
	 *
	 * @param ra        source right ascension (hour)
	 * @param dec       source declination (hour)
	 * @param pmRa      source sky proper motion in right ascension (arc-sec/year)
	 * @param pmDec     source sky proper motion in declination (arc-sec/year)
	 * @param radVel    source radial velocity (kilometer/sec)
	 * @param par       source parallax correction (arc-sec)
	 * @param type      Apparent or Mean
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void obstar (in double ra,
		     in double dec,
		     in double pmRa,
		     in double pmDec,
		     in double radVel,
		     in double par,
		     in coordType type);
	
	/**
	 * (Pre)sets a new equatorial source for the antenna to track.
	 * The source position is given in geocentric equatorial J2000 
	 * coordinates.  
	 * Asynchronous interface
	 * A callback is used to inform the caller when the 
	 * antenna reaches the new position.  If a new position is given 
	 * before the previous one is reached then the previous callback 
	 * immediately receives "aborted".
	 *
	 * @param ra        source right ascension (hour)
	 * @param dec       source declination (hour)
	 * @param pmRa      source sky proper motion in right ascension (arc-sec/year)
	 * @param pmDec     source sky proper motion in declination (arc-sec/year)
	 * @param radVel    source radial velocity (kilometer/sec)
	 * @param par       source parallax correction (arc-sec)
	 * @param type      Apparent or Mean
	 * @param callBack  callback when position is reached
	 * @param desc      is used to negotiate timeouts between client and sever
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void obstar_async (in double ra,
			   in double dec,
			   in double pmRa,
			   in double pmDec,
			   in double radVel,
			   in double par,
			   in coordType type,
			   in ACS::CBvoid callBack,
			   in ACS::CBDescIn desc);
	
	/**
	 * (Pre)sets a new non-moving position for the antenna.
	 * The position coordinates are given in azimuth and elevation.
	 * Synchronous interface
	 *
	 * @param az        position azimuth (degree)
	 * @param elev      position elevation (degree)
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void objfix (in double az,
		     in double elev);
	
	
	/**
	 * (Pre)sets a new non-moving position for the antenna.
	 * The position coordinates are given in azimuth and elevation.  
         * Asynchonous interface. 
	 * A callback is used to inform the caller when the antenna reaches the 
	 * new position.  If a new position is given before the previous one is 
	 * reached then the previous callback immediately receives "aborted".
	 *
	 * @param az        position azimuth (degree)
	 * @param elev      position elevation (degree)
	 * @param callBack  callback when position is reached
	 * @param desc      is used to negotiate timeouts between client and sever
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void objfix_async (in double az,
			   in double elev,
			   in ACS::CBvoid callBack,
			   in ACS::CBDescIn desc);
	
	
	/**
	 * Current commanded azimuth (degree).
	 */
	readonly attribute ACS::ROdouble cmdAz;
	
	/**
	 * Current commanded elevation (degree).
	 */
	readonly attribute ACS::ROdouble cmdEl;
	
	/**
	 * Current actual azimuth (degree).
	 */
	readonly attribute ACS::ROdouble actAz;
	
	/**
	 * Current actual elevation (degree).
	 */
	readonly attribute ACS::ROdouble actEl;	
	};    

    /********************************************************************/
    /** @interface Asm5
     *  Nearly identical to Asm1 except for the fact that this example
     *  publishes/consumes events from an event channel and that exception
     *  handling has been ommitted.
     */
    interface Asm5 : ACS::ACSComponent
	{
	/**
	 * (Pre)sets a new non-moving position for the antenna.
	 * The position coordinates are given in azimuth and elevation.
	 *
	 * @param az        position azimuth (degree)
	 * @param elev      position elevation (degree)
	 * @htmlonly
	 * <br><hr>
	 * @endhtmlonly
	 */
	void objfix (in double az, in double elev);
	};

    /**
     * The name of the event channel our interface implementation will 
     * send events to.  It is specified in the IDL instead of the implementation
     * language to make it harder for the developers of Consumer applications
     * to confuse names (i.e., using "AsmChannel" instead of "mountchannel".
     */
    const string ASM_CHANNEL = "mountchannel";

    /**
     * This IDL structure defines an "event" type that will sent across the 
     * network to any consumers subscribed to it.
     */
    struct AsmEventData
    {
	double Azimuth;
	double Elevation;
    };
    /********************************************************************/
#endif

};

#endif