/* **************************************************************************************************************** */
/* IRA Istituto di Radioastronomia                                                                      	        */
/* $Id: SRTMount.idl,v 1.7 2011-06-01 18:25:22 a.orlati Exp $										                    */
/*                                                                                                      	        */
/* This code is under GNU General Public Licence (GPL).                                                 	        */
/*                                                                                                      	        */
/* Who                                 when            What                                              	        */
/* Andrea Orlati(aorlati@ira.inaf.it)  28/09/2009      Creation                                          	        */



#ifndef _SRTMOUNT_IDL_

#define _SRTMOUNT_IDL_

#include <baci.idl>
//#include <enumpropMACRO.idl>
#include "Mount.idl"

#pragma prefix "alma"

module Antenna {

	
	/**
	 * This IDL interface describes the CORBA interface of a the mount of the SRT. This specilaized interface includes all
	 * the peculiar feature that are present in the Atenna Control Unit (ACU) installed at the telescope that are not included in  the parent interface. 
	 * @author <a href=mailto:a.orlati@ira.inaf.it>Andrea Orlati</a>,
	 * Istituto di Radioastronomia, Italia
	 * <br> 
	*/
	interface SRTMount: Mount {
		
		/** This property reports the current status of component with respect to the ACU control socket */
		readonly attribute Antenna::ROTStatus controlLineStatus;

		/** This property reports the current status of component with respect to the ACU status socket */
		readonly attribute Antenna::ROTStatus statusLineStatus;
		
		/** this is the azimuth error between the current position and the position generated by the trajectory generator of the ACU */
		readonly attribute ACS::ROdouble azimuthTrackingError;
		
		/** this is the elevation error between the current position and the position generated by the trajectory generator of the ACU */
		readonly attribute ACS::ROdouble elevationTrackingError;
		
		/** This property reports the requested speed of the azimuth (deg/sec)*/
		readonly attribute ACS::ROdouble commandedAzimuthRate;
		
		/** This property reports the requested speed of the elevation (deg/sec) */
		readonly attribute ACS::ROdouble commandedElevationRate;
		
		/** This property reports the requested offset of the azimuth (deg) */
		readonly attribute ACS::ROdouble commandedAzimuthOffset;
		
		/** This property reports the requested speed of the elevation (deg) */
		readonly attribute ACS::ROdouble commandedElevationOffset;
		
		/** This property reports the position of the azimuth cable wrap (deg) */
		readonly attribute ACS::ROdouble cableWrapPosition;
		
		/** This is the error of the azimuth cable wrap (deg) */
		readonly attribute ACS::ROdouble cableWrapTrackingError;
		
		/** This property reports the speed of the cable wrap (deg/sec) */
		readonly attribute ACS::ROdouble cableWrapRate;
		
		/**
		 * This property reports the current status word. The returned pattern is a 32 bits field with the following meaning:
		 * @arg \c 0 set if the status message could not be synchronized: Error
		 * @arg \c 1 set if there was an error in the status socket: Error  
		 * @arg \c 2 set if an error on the control line was detected: Error
		 * @arg \c 3 set if the control software is not allowd to control the telescope: Error
		 * @arg \c 4 set if an emergency stop has been toggled: Error 
		 * @arg \c 5 set in casa of failure of to the power supply: Error 
		 * @arg \c 6 set if the the ACU is not synchornized: Error 
		 * @arg \c 7 set if the ACU reports an error in program track data: Warning 
		 * @arg \c 8set id the ACU did not accept a command, for any reason: Warning 
		 */		
		readonly attribute ACS::ROpattern generalStatus;
		
		/**
		 * This property reports the current status of the azimuth axis. The returned pattern is a 32 bits field with the following meaning:
		 * @arg \c 0 set if the axis is ready to be activated: Status
		 * @arg \c 1 set if the axis is active: Status
		 * @arg \c 2 set if the axis is working in low power mode: Warning
		 * @arg \c 3 set if the axis is stowed: Status
		 * @arg \c 4 set if the parking pin is extracted: Status
		 * @arg \c 5 set if the axis went over the upper prelimit switch : Warning
		 * @arg \c 6 set if the axis went over the lower prelimit switch : Warning
		 * @arg \c 7 set if the axis went over the upper final limit switch : Error
		 * @arg \c 8 set if the axis went over the lower final limit switch : Error
		 * @arg \c 9 set if the axis overspeeds : Warning
		 * @arg \c 10 set if the axis encoder failed : Error
		 * @arg \c 11 set if one or more barkes failed: Error
		 * @arg \c 12  set if the servo system failed: Error
		*/
		readonly attribute ACS::ROpattern azimuthStatus;
		
		/**
		 * This property reports the current status of the elevation axis. The returned pattern is a 32 bits field with the following meaning:
		 * @arg \c 0 set if the axis is ready to be activated: Status
		 * @arg \c 1 set if the axis is active: Status
		 * @arg \c 2 set if the axis is working in low power mode: Warning
		 * @arg \c 3 set if the axis is stowed: Status
		 * @arg \c 4 set if the parking pin is extracted: Status
		 * @arg \c 5 set if the axis went over the upper prelimit switch : Warning
		 * @arg \c 6 set if the axis went over the lower prelimit switch : Warning
		 * @arg \c 7 set if the axis went over the upper final limit switch : Error
		 * @arg \c 8 set if the axis went over the lower final limit switch : Error
		 * @arg \c 9 set if the axis overspeeds : Warning
		 * @arg \c 10 set if the axis encoder failed : Error
		 * @arg \c 11 set if one or more barkes failed: Error
		 * @arg \c 12  set if the servo system failed: Error
		*/
		readonly attribute ACS::ROpattern elevationStatus;
		
		/**
		 * Reports the position of the motor
		 */
		readonly attribute ACS::ROdoubleSeq motorsPosition;

		/**
		 * Reports the velocity of the motor
		 */
		readonly attribute ACS::ROdoubleSeq motorsSpeed;
		
		/**
		 * Reports the torque of the motor
		 */
		readonly attribute ACS::ROdoubleSeq motorsTorque;
		
		/**
		 * Reports the utilization of the motor
		 */
		readonly attribute ACS::ROdoubleSeq motorsUtilization;
		
		/**
		 * This long is a bitfield that resumes the status of the motor. the meanining of the bits is the following:
		 * @arg \c 0 set if the motor is selected: Status 
		 * @arg \c 1 set if motor brake is open: Status
		 * @arg \c 2 set if the motor power module failed: Error
		 * @arg \c 3 set if the motor is ready and active: Status
		 * @arg \c 4 set if the servo failed: Error
		 * @arg \c 5 set if the motor sensors failed: Error
		 * @arg \c 6 set if the bus failed: Error
		 */
		readonly attribute ACS::ROlongSeq motorsStatus;
		
		/**
		 * This reports the number of program track position loaded into the ACU.
		 */
		readonly attribute ACS::ROlong programTrackPositions;
			
		/**
		 * This causes the axis of the mount to be activated. The control loop is closed, the brakes are open and the servo amplifier are enabled.
		 */
		void activate() raises (ComponentErrors::ComponentErrorsEx,AntennaErrors::AntennaErrorsEx);

		/**
		 * This causes the axis of the mount to be deactivated. The control loop is open, the brakes are closed and the servo amplifier are not enabled.
		 */
		void deactivate() raises (ComponentErrors::ComponentErrorsEx,AntennaErrors::AntennaErrorsEx);

	};
	
};

#endif
