#ifndef ___SRTSBANDMF_IDL__
#define ___SRTSBANDMF_IDL__


#include <baci.idl>
#include <ComponentErrors.idl>
#include "GenericReceiver.idl"

#pragma prefix "alma"

module Receivers {

	/**
	* This module defines the interface of the 22GHz Multifeed receiver installed in the SRT.
	* @author <a href=mailto:a.orlati@ira.inaf.it>Andrea Orlati</a>
	* @author <a href=mailto:mbuttu@oa-cagliari.inaf.it>Marco Buttu</a>
    * <br>
	* @copybrief Receivers::Receiver::status
	* the single bits of the status word assumed the following meaning:
	* @arg \c 0 LOCAL, set if the receiver is in remote and can be controlled remotely, error
	* @arg \c 1 VACUUMSENSOR, set if the vacuum sensor is turned on, status
	* @arg \c 2 VACUUMPUMPSTATUS, set if the vacuum pump is on, status
	* @arg \c 3 VACUUMPUMPFAULT, set if the vacuum pump is in fault state, warning
	* @arg \c 4 VACUUMVALVEOPEN, set if the vacuum valve i sopen, status
	* @arg \c 5 COOLHEADON, set if the cool head is turned on, status
	* @arg \c 6 COMPRESSORFAULT, set if the compressor is in fault state is turned on, error
	* @arg \c 7 NOISEMARK, set is the calibration diode is on, status
	* @arg \c 8 NOISEMARKERROR, set if the calibration mark should be and it is not, or viceversa, error
	* @arg \c 9 EXTNOISEMARK, set if the control of the calibration diode from external source is enabled, status
	* @arg \c 10 CONNECTIONERROR, set if an error was found during the comunication from/to the receiver, error
	* @arg \c 11 UNLOCKED, set if at least one of the local oscillator is not locked, error
	* @copybrief Receivers::CommonReceiverInterface::setLO 
	*/
    interface SRTSBandMF : ACS::CharacteristicComponent, Receiver {

        /***************************************************\
         *           COMMON_RECEIVER_INTERFACE             *
        \***************************************************/
        // void setMode(in string mode) raises (ReceiversErrors::ConfigurationEx);
        // readonly attribute ACS::ROdoubleSeq LO;
        // readonly attribute ACS::ROlong feeds;
        // readonly attribute ACS::ROlong IFs;
        // readonly attribute ACS::ROlongSeq polarization;
        // readonly attribute ACS::ROdoubleSeq initialFrequency;
        // readonly attribute ACS::ROdoubleSeq bandWidth;
        // readonly attribute ACS::ROstring mode;     
        // void calOn();
        // void calOff();
        // void setMode(in string mode);
        // void setLO(in ACS::doubleSeq lo1);
        // ACS::doubleSeq getCalibrationMark(...)
        // long getFeeds(out ACS::doubleSeq X,out ACS::doubleSeq Y,out ACS::doubleSeq power);
        // double getTaper(in double freq,in double bandWidth,in long feed,in long ifNumber,out double waveLen) 

        /***************************************************\
         *           GENERIC_RECEIVER_INTERFACE            *
        \***************************************************/
        // readonly attribute ACS::ROdouble vacuum;
        // readonly attribute ACS::ROpattern status;
        // readonly attribute Management::ROTSystemStatus receiverStatus;
        // void turnLNAsOn();
        // void turnLNAsOff();
        // void activate();


        /** LNA PROPERTIES
         *
         * We use the ROdoubleSeq, one sequence for each amplifier stage
         * and channel. The first index is for the amplifier stage, and
         * the second one is for the feed. The letters L and R mean Left 
         * and Right. For a N feed receiver we have the following
         * properties:
         * 
         * idL1 (idL1_1, idL1_2, ...., idL1_N)
         * idR1 (idR1_1, idR1_2, ...., idR1_N)
         * idL2 (idL2_1, idL2_2, ...., idL2_N)
         * idR2 (idR2_1, idR2_2, ...., idR2_N)
         *     |
         * idL5 (idL5_1, idL5_2, ...., idL5_N)
         * idR5 (idR5_1, idR5_2, ...., idR5_N)
         * 
         * 
         * vdL1 (vdL1_1, vdL1_2, ...., vdL1_N)
         * vdR1 (vdR1_1, vdR1_2, ...., vdR1_N)
         * vdL2 (vdL2_1, vdL2_2, ...., vdL2_N)
         * vdR2 (vdR2_1, vdR2_2, ...., vdR2_N)
         *     |
         * vdL5 (vdL5_1, vdL5_2, ...., vdL5_N)
         * vdR5 (vdR5_1, vdR5_2, ...., vdR5_N)
         * 
         * 
         * vgL1 (vgL1_1, vgL1_2, ...., vgL1_N)
         * vgR1 (vgR1_1, vgR1_2, ...., vgR1_N)
         * vgL2 (vgL2_1, vgL2_2, ...., vgL2_N)
         * vgR2 (vgR2_1, vgR2_2, ...., vgR2_N)
         *     |
         * vgL5 (vgL5_1, vgL5_2, ...., vgL5_N)
         * vgR5 (vgR5_1, vgR5_2, ...., vgR5_N)
         */

        /**************************\ 
         *      DRAIN VOLTAGE     *
        \**************************/ 

        /// LNA Drain voltage: stage number 1, left channel
        readonly attribute ACS::ROdoubleSeq vdL1;

        /// LNA Drain voltage: stage number 1, right channel
        readonly attribute ACS::ROdoubleSeq vdR1;

        /// LNA Drain voltage: stage number 2, left channel
        readonly attribute ACS::ROdoubleSeq vdL2;

        /// LNA Drain voltage: stage number 2, right channel
        readonly attribute ACS::ROdoubleSeq vdR2;

        /// LNA Drain voltage: stage number 3, left channel
        readonly attribute ACS::ROdoubleSeq vdL3;

        /// LNA Drain voltage: stage number 3, right channel
        readonly attribute ACS::ROdoubleSeq vdR3;

        /// LNA Drain voltage: stage number 4, left channel
        readonly attribute ACS::ROdoubleSeq vdL4;

        /// LNA Drain voltage: stage number 4, right channel
        readonly attribute ACS::ROdoubleSeq vdR4;

        /// LNA Drain voltage: stage number 5, left channel
        readonly attribute ACS::ROdoubleSeq vdL5;

        /// LNA Drain voltage: stage number 5, right channel
        readonly attribute ACS::ROdoubleSeq vdR5;


        /**************************\ 
         *      DRAIN CURRENT     *
        \**************************/ 

        /// stage number 1, left channel
        readonly attribute ACS::ROdoubleSeq idL1;

        /// stage number 1, right channel
        readonly attribute ACS::ROdoubleSeq idR1;

        /// stage number 2, left channel
        readonly attribute ACS::ROdoubleSeq idL2;

        /// stage number 2, right channel
        readonly attribute ACS::ROdoubleSeq idR2;

        /// stage number 3, left channel
        readonly attribute ACS::ROdoubleSeq idL3;

        /// stage number 3, right channel
        readonly attribute ACS::ROdoubleSeq idR3;

        /// stage number 4, left channel
        readonly attribute ACS::ROdoubleSeq idL4;

        /// stage number 4, right channel
        readonly attribute ACS::ROdoubleSeq idR4;

        /// stage number 5, left channel
        readonly attribute ACS::ROdoubleSeq idL5;

        /// stage number 5, right channel
        readonly attribute ACS::ROdoubleSeq idR5;


        /**************************\ 
         *       GATE VOLTAGE     *
        \**************************/ 

        /// LNA Gate voltage: stage number 1, left channel
        readonly attribute ACS::ROdoubleSeq vgL1;

        /// LNA Gate voltage: stage number 1, right channel
        readonly attribute ACS::ROdoubleSeq vgR1;

        /// LNA Gate voltage: stage number 2, left channel
        readonly attribute ACS::ROdoubleSeq vgL2;

        /// LNA Gate voltage: stage number 2, right channel
        readonly attribute ACS::ROdoubleSeq vgR2;

        /// LNA Gate voltage: stage number 3, left channel
        readonly attribute ACS::ROdoubleSeq vgL3;

        /// LNA Gate voltage: stage number 3, right channel
        readonly attribute ACS::ROdoubleSeq vgR3;

        /// LNA Gate voltage: stage number 4, left channel
        readonly attribute ACS::ROdoubleSeq vgL4;

        /// LNA Gate voltage: stage number 4, right channel
        readonly attribute ACS::ROdoubleSeq vgR4;

        /// LNA Gate voltage: stage number 5, left channel
        readonly attribute ACS::ROdoubleSeq vgL5;

        /// LNA Gate voltage: stage number 5, right channel
        readonly attribute ACS::ROdoubleSeq vgR5;

        /** Cryogenic temperature of the cool head. Approximately 65K */
        readonly attribute ACS::ROdouble cryoTemperatureCoolHead;

        /** Cryogenic temperature of the cool head measured at the window. Approximately 100K */
        readonly attribute ACS::ROdouble cryoTemperatureCoolHeadWindow;

        /** Cryogenic temperature of the Low Noise Amplifier. Approximately 20K */
        readonly attribute ACS::ROdouble cryoTemperatureLNA;

        /** Cryogenic temperature of the cool head measured at the window. Approximately 35K */
        readonly attribute ACS::ROdouble cryoTemperatureLNAWindow;
        
        /** Value of the environment temperature in °C */
        readonly attribute ACS::ROdouble environmentTemperature;

        /** Receiver Name */
        readonly attribute ACS::ROstring receiverName;

        /** 
         * It allows to turn the vacuum sensor on. The vacuum sensor is necessary to have a correct 
         * measurment of the vacuum characteristic. 
         * If the vacuum sensor is not working the dafult_value for the  vacuum characteristic is always reported.  
         */
        void turnVacuumSensorOn() raises (ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx);

        /** 
         * It allows to turn the vacuum sensor off. The vacuum sensor is necessary to have a correct 
         * measurment of the vacuum characteristic. 
         * If the vacuum sensor is not working the dafult_value for the  vacuum characteristic is always reported.  
         */
        void turnVacuumSensorOff() raises (ComponentErrors::ComponentErrorsEx,ReceiversErrors::ReceiversErrorsEx);
         
	};


};

#endif
