Commit 19df6bd0 authored by TheDebbio's avatar TheDebbio
Browse files

Broken: Toward Unified Mixer Oeprator

Some Conf review towards componentCore

First ideas on MixerOperator
parent e10e5790
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
{
    "files.associations": {
        "*.idl": "cpp"
        "*.idl": "cpp",
        "ira": "cpp"
    }
}
 No newline at end of file
+157 −127
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ public:
     */
    virtual ~CComponentCore();

        /* *** COMPONENT SERVICE *** */

    /**
     * This method initializes the object
     * @param service pointer to container services object provided by the container
@@ -51,16 +53,37 @@ public:
    virtual void cleanup();

    /**
     * It sets the local oscillator. System has 2 synth. Before commanding the new value some check are done. The the correspnding signal amplitude is computed.
     * @param lo lists of values for the local oscillator (MHz), one for each IF. 2 Values are processed. If a -1 is passed the present value is kept
     * @throw  ComponentErrors::ValidationErrorExImpl
     * @throw ComponentErrors::ValueOutofRangeExImpl
     * @throw ComponentErrors::CouldntGetComponentExImpl
     * @throw ComponentErrors::CORBAProblemExImpl
     * @thorw ReceiversErrors::LocalOscillatorErrorExImpl
     * It activate the receiver, in other words it allows to setup the default configuration and to make sure the LNA are turned on and selects the appropriate
     * C receiver ( LOW - HIGH ).
     * @details Throw an exception if mode is not valid or it got some init errors.
     */
    void setLO(const ACS::doubleSeq& lo) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CouldntGetComponentExImpl,
            ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl);
    void activate(const char *mode) throw (ReceiversErrors::ModeErrorExImpl,ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,
            ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl,ReceiversErrors::NoRemoteControlErrorExImpl,
            ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It deactivates the receiver.
     */
    void deactivate() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);
    
    /**
     * This method resumes the whole status of the component. It set the <i>componentStatus</i> member variable.
     */
    void updateComponent();
   
    /**
     * This is getter method. No need to make it thread safe......
     * @return the current status word
     */
    DWORD getStatusWord() const  { return  m_statusWord; }

     /**
     * @return the status flag of the component
     */
    const Management::TSystemStatus& getComponentStatus();


        /* *** MODE *** */

     /**
     * It allows to change the operating mode of the receiver. If the mode does not correspond to a valid mode an error is thrown.
@@ -70,32 +93,38 @@ public:
            ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl);

    /**
     * It activate the receiver, in other words it allows to setup the default configuration and to make sure the LNA are turned on and selects the appropriate
     * C receiver ( LOW - HIGH ).
     * @details Throw an exception if mode is not valid or it got some init errors.
     * It returns the current operating mode of the receiver.
     * @return output string
     */
    void activate(const char *mode) throw (ReceiversErrors::ModeErrorExImpl,ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,
            ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl,ReceiversErrors::NoRemoteControlErrorExImpl,
            ReceiversErrors::ReceiverControlBoardErrorExImpl);
    const IRA::CString& getSetupMode();


        /* *** LOs *** */

    /**
     * It deactivates the receiver.
     * It sets the local oscillator. System has 2 synth. Before commanding the new value some check are done. The the correspnding signal amplitude is computed.
     * @param lo lists of values for the local oscillator (MHz), one for each IF. 2 Values are processed. If a -1 is passed the present value is kept
     * @throw  ComponentErrors::ValidationErrorExImpl
     * @throw ComponentErrors::ValueOutofRangeExImpl
     * @throw ComponentErrors::CouldntGetComponentExImpl
     * @throw ComponentErrors::CORBAProblemExImpl
     * @thorw ReceiversErrors::LocalOscillatorErrorExImpl
     */
    void deactivate() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);
    void setLO(const ACS::doubleSeq& lo) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl,ComponentErrors::CouldntGetComponentExImpl,
            ComponentErrors::CORBAProblemExImpl,ReceiversErrors::LocalOscillatorErrorExImpl);
    /**
     * It returns back the current local oscillator frequency settings.
     * @param lo output sequence
     */
    void getLO(ACS::doubleSeq& lo);

    /**
     * It allows to compute the value of the calibration mark for any given sub bands in the IF space.
     * @param result this the sequence of computed mark values, the first entry correspond to first sub band and so on....
     * @param, resFreq the sequence reports the initial observed sky frequency (MHz), the  first entry correspond to first sub band and so on....
     * @param resBw the sequence reports the real bandwidth observed (MHz), the  first entry correspond to first sub band and so on....
     * @param freqs  list of start frequencies (MHz)
     * @param bandwidth list of the band widths (MHz)
     * @param feeds list of feed identifier, it allows to specifies form which feed the sub band comes from. In that case it is neglected since the receiver is a single feed
     * @param ifs list of IF identifier, it allows to specifies from which receiver IF the sub band comes from.
     * @param true if the calibration diode is turned on.
     * I checks if the local oscillator is locked properly
     */
    void getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds,
            const ACS::longSeq& ifs,bool& onoff,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl);
    void checkLocalOscillator() throw (ComponentErrors::CORBAProblemExImpl,ComponentErrors::CouldntGetAttributeExImpl);


        /* *** IFs *** */

        /**
     * It is called to get the all the receiver output information in one call.
@@ -120,6 +149,45 @@ public:
             ACS::doubleSeq& LO
     ) throw (ComponentErrors::ValidationErrorExImpl, ComponentErrors::ValueOutofRangeExImpl);

    /**
     * It returns the feed geometry of the receiver with respect to the central one. For this implementation it is just a placeholder since there is just one feed.
     */
    long getFeeds(ACS::doubleSeq& X,ACS::doubleSeq& Y,ACS::doubleSeq& power);


     /**
     * It returns back the current bandwidth for each IF.
     * @param bw output sequence
     */
    void getBandwidth(ACS::doubleSeq& bw);

    /**
     * It returns back the current start frequency for each IF.
     * @param sf output sequence
     */
    void getStartFrequency(ACS::doubleSeq& sf);

        /**
     * It returns back the current polarization for each IF.
     * @param pol output sequence
     */
    void getPolarization(ACS::longSeq& pol);


    /**
     * It returns the number of IF chains
     * @return output value
     */
    const DWORD& getIFs();

    /**
     * It returns the number of feeds
     * @return output value
     */
    const DWORD& getFeeds();

        /* *** TAPER *** */

    /**
     * It computes the taper given a reference band.
     * @param freq start frequency of the reference band
@@ -131,6 +199,23 @@ public:
    double getTaper(const double& freq,const double& bw,const long& feed,const long& ifNumber,double& waveLen) throw (
            ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl);


        /* *** CAL MARK *** */

    /**
     * It allows to compute the value of the calibration mark for any given sub bands in the IF space.
     * @param result this the sequence of computed mark values, the first entry correspond to first sub band and so on....
     * @param, resFreq the sequence reports the initial observed sky frequency (MHz), the  first entry correspond to first sub band and so on....
     * @param resBw the sequence reports the real bandwidth observed (MHz), the  first entry correspond to first sub band and so on....
     * @param freqs  list of start frequencies (MHz)
     * @param bandwidth list of the band widths (MHz)
     * @param feeds list of feed identifier, it allows to specifies form which feed the sub band comes from. In that case it is neglected since the receiver is a single feed
     * @param ifs list of IF identifier, it allows to specifies from which receiver IF the sub band comes from.
     * @param true if the calibration diode is turned on.
     */
    void getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& resFreq,ACS::doubleSeq& resBw,const ACS::doubleSeq& freqs,const ACS::doubleSeq& bandwidths,const ACS::longSeq& feeds,
            const ACS::longSeq& ifs,bool& onoff,double& scaleFactor) throw (ComponentErrors::ValidationErrorExImpl,ComponentErrors::ValueOutofRangeExImpl);

    /**
     * It turns the calibration diode on.
     */
@@ -157,32 +242,23 @@ public:
    );

    /**
     * It allows to turn LNA on
     * It checks is the status of the noise mark correspond to the commanded status, otherwise it sets the <i>NOISEMARKERROR</i> bit. It also check if the
     * external control of the noise mark has been enabled or not
     */
    void lnaOn() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);
    void updateNoiseMark() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It allows to turn LNA off
     */
    void lnaOff() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It reads and updates from the control board the current value of the vacuum
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void updateVacuum() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);
        /* *** LNAs *** */

    /**
     * It check if the vacuum pump is on and check is the status is fault or not (<i>VACUUMPUMPFAULT</i>)
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     * It allows to turn LNA on
     */
    void updateVacuumPump() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);
    void lnaOn() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It checks if the vacuum valve is opened or not
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     * It allows to turn LNA off
     */
    void updateVacuumValve() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);
    void lnaOff() throw (ReceiversErrors::NoRemoteControlErrorExImpl,ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It reads and updates from the LNA control board the current values of current and voltage of gate and drain of the transistors
@@ -191,39 +267,25 @@ public:
    void updateLNAControls() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);


    /**
     * It reads and updates from the control board the current vertex temperature
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void updateEnvironmentTemperature() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);
        /* *** VACUUM *** */

    /**
     * It checks if the Dewar power box is in remote or not
     * It reads and updates from the control board the current value of the vacuum
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void updateIsRemote() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);
    void updateVacuum() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It checks if the cool head is turned on or not
     * It check if the vacuum pump is on and check is the status is fault or not (<i>VACUUMPUMPFAULT</i>)
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void updateCoolHead() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It checks is the status of the noise mark correspond to the commanded status, otherwise it sets the <i>NOISEMARKERROR</i> bit. It also check if the
     * external control of the noise mark has been enabled or not
     */
    void updateNoiseMark() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * This method resumes the whole status of the component. It set the <i>componentStatus</i> member variable.
     */
    void updateComponent();
    void updateVacuumPump() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * I checks if the local oscillator is locked properly
     * It checks if the vacuum valve is opened or not
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void checkLocalOscillator() throw (ComponentErrors::CORBAProblemExImpl,ComponentErrors::CouldntGetAttributeExImpl);
    void updateVacuumValve() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

     /**
     * This is getter method. No need to make it thread safe......
@@ -232,82 +294,49 @@ public:
    double  getVacuum() const { return m_vacuum; }
    
    /**
     * This is getter method. No need to make it thread safe......
     * @return the current value of the vertex temperature
     */
    CConfiguration::BoardValue getEnvironmentTemperature() const { return m_environmentTemperature; }

    /**
     * This is getter method. No need to make it thread safe......
     * @return the current status word
     */
    DWORD getStatusWord() const  { return  m_statusWord; }

    /**
     * This is getter method. In this case, since it makes use of some class members that could be changed by other methods it is advisable to protect this method with the class mutex.
     * @param control name of the parameter that must be returned
     * @param ifs Intermediate frequency identifier, it permits to select which amplification chain we are interested in
     * @return a specific value of from the transistor control parameters
     * Allows to set the "default_value" for the vacuum characteristic. In principle it is possible to read it directly from CDB, but I found it more
     * comfortable to get it directly from the characteristic itself.
     */
    double getFetValue(const IRA::ReceiverControl::FetValue& control,const DWORD& ifs);
    inline void setVacuumDefault(const double& val) { m_vacuumDefault=val; }

    /**
     * It returns the feed geometry of the receiver with respect to the central one. For this implementation it is just a placeholder since there is just one feed.
     */
    long getFeeds(ACS::doubleSeq& X,ACS::doubleSeq& Y,ACS::doubleSeq& power);

    /**
     * It returns back the current local oscillator frequency settings.
     * @param lo output sequence
     */
    void getLO(ACS::doubleSeq& lo);
        /* *** TEMPERATURE *** */        
   
     /**
     * It returns back the current bandwidth for each IF.
     * @param bw output sequence
     * This is getter method. No need to make it thread safe......
     * @return the current value of the vertex temperature
     */
    void getBandwidth(ACS::doubleSeq& bw);
    CConfiguration::BoardValue getEnvironmentTemperature() const { return m_environmentTemperature; }

    /**
     * It returns back the current start frequency for each IF.
     * @param sf output sequence
     */
    void getStartFrequency(ACS::doubleSeq& sf);

    /**
     * It returns back the current polarization for each IF.
     * @param pol output sequence
     * It reads and updates from the control board the current vertex temperature
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    void getPolarization(ACS::longSeq& pol);
    void updateEnvironmentTemperature() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

     /**
     * It returns the current operating mode of the receiver.
     * @return output string
     * It checks if the cool head is turned on or not
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    const IRA::CString& getSetupMode();
    void updateCoolHead() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * It returns the number of IF chains
     * @return output value
     */
    const DWORD& getIFs();
        /* *** LOCAL REMOTE *** */

    /**
     * It returns the number of feeds
     * @return output value
     * It checks if the Dewar power box is in remote or not
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    const DWORD& getFeeds();
    void updateIsRemote() throw (ReceiversErrors::ReceiverControlBoardErrorExImpl);

    /**
     * @return the status flag of the component
     * This is getter method. In this case, since it makes use of some class members that could be changed by other methods it is advisable to protect this method with the class mutex.
     * @param control name of the parameter that must be returned
     * @param ifs Intermediate frequency identifier, it permits to select which amplification chain we are interested in
     * @return a specific value of from the transistor control parameters
     */
    const Management::TSystemStatus& getComponentStatus();
    double getFetValue(const IRA::ReceiverControl::FetValue& control,const DWORD& ifs);

    /**
     * Allows to set the "default_value" for the vacuum characteristic. In principle it is possible to read it directly from CDB, but I found it more
     * comfortable to get it directly from the characteristic itself.
     */
    inline void setVacuumDefault(const double& val) { m_vacuumDefault=val; }

protected:
    /**
@@ -405,12 +434,13 @@ private:
    ACS::doubleSeq m_startFreq;
    ACS::doubleSeq m_bandwidth;
    ACS::longSeq m_polarization;
    ACS::doubleSeq m_localOscillatorValue;  /**< Frequency Value */
    IRA::CString m_setupMode;

    struct LO{
        Receivers::LocalOscillator_var m_localOscillatorDevice; /**< LO  connected device */
        bool m_localOscillatorFault;    /**< Falut flag */
        double m_localOscillatorValue;  /**< Frequency Value */
        double m_value;                 /**< Freq Value */
    };

    LO m_lo_1st;        /**< 1st stage mixer */
+19 −19
Original line number Diff line number Diff line
@@ -155,68 +155,69 @@ public:

	/**
	 * @return the number of feeds
	 * @details Valid till you reallocate source data vector
	 */
	inline const  DWORD& getFeeds() const { return m_feeds; }
	inline const  DWORD& getFeeds() const { return m_conf_hnd.getCurrentSetup().m_feeds; }

	/**
	 * @return mnemonic of the working mode of the receiver
	 */
	inline const IRA::CString& getSetupMode() const { return m_mode; }
	inline const IRA::CString& getSetupMode() const { return m_conf_hnd.getCurrentSetup().m_name; }

	/**
	 * @return the lower limit of the RF coming from the receiver (MHz)
	 */
	inline double const * const  getRFMin() const { return m_RFMin; }
	inline double const * const  getRFMin() const { return &m_conf_hnd.getCurrentSetup().m_RFMin[0]; }

	/**
	 * @return the upper  limit of the RF coming from the receiver (MHz)
	 */
	inline double const * const  getRFMax() const { return m_RFMax; }
	inline double const * const  getRFMax() const { return &m_conf_hnd.getCurrentSetup().m_RFMax[0]; }

	/**
	 * @return the start frequency of the IF coming from the receiver (MHz)
	 */
	inline double const * const  getIFMin() const { return m_IFMin; }
	inline double const * const  getIFMin() const { return &m_conf_hnd.getCurrentSetup().m_IFMin[0]; }

	/**
	 * @return the bandwidth of the IF coming from the receiver (MHz)
	 */
	inline double const * const  getIFBandwidth() const{ return  m_IFBandwidth; }
	inline double const * const  getIFBandwidth() const{ return  &m_conf_hnd.getCurrentSetup().m_IFBandwidth[0]; }

	/**
	 * @return the number of IF chains for each feed
	 */
	inline const  DWORD& getIFs() const { return m_IFs; }
	inline const  DWORD getIFs() const { return m_conf_hnd.getCurrentSetup().m_IFs; }

	/**
	 * @return the pointer to the polarizations array, the first element correspond to the first IF and so on.....
	 */
	inline Receivers::TPolarization const * const getPolarizations() const { return m_polarizations; }
	inline Receivers::TPolarization const * const getPolarizations() const { return &m_conf_hnd.getCurrentSetup().m_polarizations[0]; }

	/**
	 * @return the number of feeds
	 */
	inline const  DWORD& getFeeds() const { return m_feeds; }
	inline const  DWORD getFeeds() const { return m_conf_hnd.getCurrentSetup().m_feeds; }

	/**
	 * @return the default frequency for the synthesizer  (MHz)
	 */
	inline double const * const  getDefaultLO()  const { return m_defaultLO; }
	inline double const * const  getDefaultLO()  const { return &m_conf_hnd.getCurrentSetup().m_defaultLO[0]; }

	/**
	 * @return the value of the fixed synthesizer used for the second conversion (MHz)
	 */
	inline double const * const  getFixedLO2() const { return m_fixedLO2; }
	inline double const * const  getFixedLO2() const { return &m_conf_hnd.getCurrentSetup().m_fixedLO2[0]; }

	/**
	 * @return lower limit for the synthesizer tuning (MHz)
	 */
	inline double const * const  getLOMin() const { return  m_LOMin; }
	inline double const * const  getLOMin() const { return  &m_conf_hnd.getCurrentSetup().m_LOMin[0]; }

	/**
	 * @return upper limit for  the  synthesizer tuning (MHz)
	 */
	inline double const * const  getLOMax() const { return  m_LOMax; }
	inline double const * const  getLOMax() const { return  &m_conf_hnd.getCurrentSetup().m_LOMax[0]; }

public: 

@@ -278,9 +279,8 @@ private:
	IRA::CString m_localOscillatorInstance1st; /**< 1st stage mixer component instance name */
	IRA::CString m_localOscillatorInstance2nd; /**< 2nd stage mixer component instance name */

	IRA::CDBTable *m_taperTable;	/**< Helper reading xml taper table */
	IRA::CDBTable *m_feedsTable;	/**< Helper reading xml feeds table */
	IRA::CDBTable *m_loTable;		/**< Helper reading xml local synth data table */
	std::vector<TFeedValue> m_feeds_vector;	/**< Feed data array */
	std::vector<TTaperValue> m_taper_vector;	/**< Feed data array */

	std::vector<TLOValue> m_synt_table_1st;	/**< Freq - power synt table 1st stage LO*/
	std::vector<TLOValue> m_synt_table_2nd;	/**< Freq - power synt table 2nd stage LO*/
+51 −0
Original line number Diff line number Diff line
#ifndef MED_C_BAND_LOCAL_OSCILLATOR_H
#define MED_C_BAND_LOCAL_OSCILLATOR_H

#include <IRA>

/**
 * @brief This class enclose both mixer stages into a unique interface
 */
class MixerOperator{

    public:

        /**
         * @brief Construct a new Mixer Operator object
         * @details devices initialization, set default freq
         * @param[in] p_defaults Default mixer values
         * @param[in] p_mins Minimal values 
         * @param[in] p_defaults Maximum values
         */
        MixerOperator(const ACS::doubleSeq& p_defaults, 
                    const ACS::doubleSeq& p_mins,
                    const ACS::doubleSeq& p_maxs);

        /**
         * @brief Destroy the Mixer Operator object
         * 
         */
        ~MixerOperator();

        /**
         * @brief Set LO equivalent value to the 2 stages LOs
         * 
         * @param p_value 
         * @return true Value is valid         
         */
        bool SetValue(double p_value);

        /**
         * @brief Get the equivalent LO value
         * 
         * @return double LO value
         */
        double GetValue();


    private:


};

#endif
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
#include "ReceiverConfHandler.h"
Loading