#ifndef ___KQWBAND_IDL__
#define ___KQWBAND_IDL__


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

#pragma prefix "alma"

module Receivers {

    /**
    * This module defines the interface of the KQW band simultaneous receiver installed in all three italian telescopes.
    * @author <a href=mailto:andrea.orlati@inaf.it>Andrea Orlati</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 KQWBand : 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 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();

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

        /// LNA Drain voltage: K band, LCP channel
        readonly attribute ACS::ROdouble vdKL;
        
        /// LNA Drain voltage: K band, RCP channel
        readonly attribute ACS::ROdouble vdKR;

        /// LNA Drain voltage: Q band, LCP channel
        readonly attribute ACS::ROdouble vdQL;
        
        /// LNA Drain voltage: Q band, RCP channel
        readonly attribute ACS::ROdouble vdQR;

        /// LNA Drain voltage: W band, LCP channel
        readonly attribute ACS::ROdouble vdWL;
        
        /// LNA Drain voltage: W band, RCP channel
        readonly attribute ACS::ROdouble vdWR;


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

        /// LNA Drain current: K band, LCP channel
        readonly attribute ACS::ROdouble idKL;
        
        /// LNA Drain current: K band, RCP channel
        readonly attribute ACS::ROdouble idKR;

        /// LNA Drain current: Q band, LCP channel
        readonly attribute ACS::ROdouble idQL;
        
        /// LNA Drain current: Q band, RCP channel
        readonly attribute ACS::ROdouble idQR;

        /// LNA Drain current: W band, LCP channel
        readonly attribute ACS::ROdouble idWL;
        
        /// LNA Drain current: W band, RCP channel
        readonly attribute ACS::ROdouble idWR;

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

          /// LNA gate voltage: K band, LCP channel
        readonly attribute ACS::ROdouble vgKL;
        
        /// LNA gate voltage: K band, RCP channel
        readonly attribute ACS::ROdouble vgKR;

        /// LNA gate voltage: Q band, LCP channel
        readonly attribute ACS::ROdouble vgQL;
        
        /// LNA gate voltage: Q band, RCP channel
        readonly attribute ACS::ROdouble vgQR;

        /// LNA gate voltage: W band, LCP channel
        readonly attribute ACS::ROdouble vgWL;
        
        /// LNA gate voltage: W band, RCP channel
        readonly attribute ACS::ROdouble vgWR;
        
        /**************************\ 
         *   CRYO TEMPERATURE     *
        \**************************/ 

        /** 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
