Commit 40f41152 authored by Andrea Orlati's avatar Andrea Orlati
Browse files

fix issue #885: implemented the çNA monitoring and the command to...

fix issue #885: implemented the çNA monitoring and the command to activate/deactivate bypass. LocalOscillator control is still missing. Also some tests are required.
parent d0604c1e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@
#include "MicroControllerBoard.h"
#include <pthread.h>

// SETMODE_SLEEP_TIME is the time to wait until the bit commutation is stable
const unsigned int SETMODE_SLEEP_TIME = 100000; // 0.1 seconds
const unsigned int SWITCH_SLEEP_TIME = 100000; // 0.1 seconds

namespace IRA {

@@ -909,7 +912,7 @@ public:
    );


private:
protected:
    
	/** Send the request to the board and receive the answer
     * @param board_ptr pointer to the board (dewar of LNA board)
+0 −5
Original line number Diff line number Diff line
@@ -7,11 +7,6 @@ using IRA::ReceiverControlEx;
// using IRA::ReceiverControl::StageValues;
using IRA::any2string;

// SETMODE_SLEEP_TIME is the time to wait until the bit commutation is stable
const unsigned int SETMODE_SLEEP_TIME = 100000; // 0.1 seconds
const unsigned int SWITCH_SLEEP_TIME = 100000; // 0.1 seconds


ReceiverControl::ReceiverControl(
        const std::string dewar_ip,
        const unsigned short dewar_port, 
+3 −1
Original line number Diff line number Diff line
@@ -145,7 +145,9 @@
        <!-- Name of the LocalOscillator component serving the Q band -->
        <xs:attribute name="LocalOscillator_Q_Instance" type="xs:string" use="required"/>
        <!-- Name of the LocalOscillator component serving the W band -->
        <xs:attribute name="LocalOscillator_W_Instance" type="xs:string" use="required"/>
        <xs:attribute name="LocalOscillator_W1_Instance" type="xs:string" use="required"/>
        <!-- Name of the LocalOscillator component serving the W band -->
        <xs:attribute name="LocalOscillator_W2_Instance" type="xs:string" use="required"/>

      </xs:extension>
     </xs:complexContent>
+60 −5
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 IRA Istituto di Radioastronomia                                 
 This code is under GNU General Public License (GPL).          
                                                              
 Andrea Orlati (aorlati@ira.inaf.it): Author
 Andrea Orlati (andrea.orlati@inaf.it): Author
\***********************************************************************/

#include "Configuration.h"
@@ -13,11 +13,42 @@
#include <LocalOscillatorInterfaceC.h>
#include <ReceiversErrors.h>
#include <ManagmentDefinitionsC.h>
#include "utils.h"

#define NUMBER_OF_STAGES 1
#define PHYSICAL_FEEDS 3
#define KBAND_FEED 0
#define QBAND_FEED 1
#define WBAND_FEED 2

/**
 * This class extends the ReceiverControl class in order to include the bypass activation on the Wband RF chain to enable Sun observations
 * @author <a href=mailto:andrea.orlati@inaf.it>Andrea Orlati</a>,
 * Istituto di Radioastronomia, Italia
 * <br>  
*/

class CKQWReceiverControl: public virtual IRA::ReceiverControl {
public:
	CKQWReceiverControl(const std::string dewar_ip,
                       const unsigned short dewar_port, 
                       const std::string lna_ip, 
                       const unsigned short lna_port, 
                       const unsigned int guard_time=250000, 
                       const unsigned short number_of_feeds=1) :  ReceiverControl(dewar_ip,dewar_port,lna_ip,guard_time,number_of_feeds) {}
	virtual ~CKQWReceiverControl() {}
	/**
	* @throw ReceiverControlEx
	*/
	bool enableBypass();
	/**
	* @throw ReceiverControlEx
	*/
	bool disableBypass();
};

/**
 * This class contains the code of almost all the features  of the component
 * @author <a href=mailto:a.orlati@ira.cnr.it>Andrea Orlati</a>,
 * @author <a href=mailto:andrea.orlati@inaf.it>Andrea Orlati</a>,
 * Istituto di Radioastronomia, Italia
 * <br>
  */
@@ -395,7 +426,6 @@ public:
    void getPolarizations(ACS::longSeq& pol);

    /** 
     * This is a pure virtual function, so you must write it in your derived class.
     * It allows to change the operating mode of the receiver. 
     * If the mode does not correspond to a valid mode an error is thrown.
     * @param  mode mode code as a string
@@ -406,9 +436,31 @@ public:
     * @throw ReceiversErrors::LocalOscillatorErrorExImpl
     * @throw ComponentErrors::CDBAccessExImpl
     * @throw ReceiversErrors::ModeErrorExImpl
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
     */
    virtual void setMode(const char * mode);
    
    /*  
     * This method will update the last readout of the gate voltage parameters of the LNAs    
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
    */
	 void updateVgLNAControls();


	 /*  
     * This method will update the last readout of the drain voltage parameters of the LNAs    
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
    */
	 void updateVdLNAControls();

	    /*  
     * This method will update the last readout of the drain current parameters of the LNAs    
     * @throw ReceiversErrors::ReceiverControlBoardErrorExImpl
    */	
	 void updateIdLNAControls();
	 
	 ACS::doubleSeq getStageValues(const IRA::ReceiverControl::FetValue& control, DWORD ifs, DWORD stage);


protected:

@@ -483,7 +535,7 @@ protected:


    CConfiguration<maci::ContainerServices> m_configuration;
    IRA::ReceiverControl *m_control; // This object is thread safe
    CKQWReceiverControl *m_control; // This object is thread safe
    BACIMutex m_mutex;
    //IRA::CString m_actualMode;
    //IRA::CString m_setupMode; 
@@ -501,6 +553,9 @@ private:
    CConfiguration<maci::ContainerServices>::BoardValue m_cryoLNA;
    CConfiguration<maci::ContainerServices>::BoardValue m_cryoLNAWin;
    CConfiguration<maci::ContainerServices>::BoardValue m_envTemperature;
    std::vector<IRA::ReceiverControl::StageValues> m_vdStageValues;
    std::vector<IRA::ReceiverControl::StageValues> m_idStageValues;
    std::vector<IRA::ReceiverControl::StageValues> m_vgStageValues;
    double m_vacuumDefault;
    bool m_calDiode;
    IRA::ReceiverControl::FetValues m_fetValues;
+11 −4
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ public:
	/**
	 * @return the instance of the local oscillator component  that the receiver will use to drive the set its LO
	 */
	inline const IRA::CString& getLocalOscillatorInstance() const { return m_localOscillatorInstance; }
	//inline const IRA::CString& getLocalOscillatorInstance() const { return m_localOscillatorInstance; }

	/**
	 * @param freq vector with the synthesizer frequencies. It must be freed by caller.
@@ -335,7 +335,11 @@ private:
	DWORD m_LNASamplingTime;
	DWORD m_repetitionCacheTime;
	DWORD m_repetitionExpireTime;
	IRA::CString m_localOscillatorInstance;
	IRA::CString m_localOscillator_K_Instance;
	IRA::CString m_localOscillator_Q_Instance;
	IRA::CString m_localOscillator_W1_Instance;
	IRA::CString m_localOscillator_W2_Instance;
	
   T* m_services;
	IRA::CString m_mode;
	IRA::CString m_defaultMode;
@@ -470,7 +474,10 @@ void CConfiguration<T>::init(T *Services,IRA::CString comp_name)
    // read component configuration
    _GET_STRING_ATTRIBUTE(m_services,"DewarIPAddress","Dewar IP address:",m_dewarIPAddress,comp_name);
    _GET_STRING_ATTRIBUTE(m_services,"LNAIPAddress", "LNA IP address:",m_LNAIPAddress,comp_name);
	 _GET_STRING_ATTRIBUTE(m_services,"LocalOscillatorInstance","Local oscillator instance:",m_localOscillatorInstance,comp_name);
	 _GET_STRING_ATTRIBUTE(m_services,"LocalOscillator_K_Instance","Local oscillator for K band:",m_localOscillator_K_Instance,comp_name);
	 _GET_STRING_ATTRIBUTE(m_services,"LocalOscillator_Q_Instance","Local oscillator for Q band:",m_localOscillator_Q_Instance,comp_name);
	 _GET_STRING_ATTRIBUTE(m_services,"LocalOscillator_W1_Instance","Local oscillator for W1 band:",m_localOscillator_W1_Instance,comp_name);
	 _GET_STRING_ATTRIBUTE(m_services,"LocalOscillator_W2_Instance","Local oscillator for W2 band:",m_localOscillator_W2_Instance,comp_name);
	 _GET_DWORD_ATTRIBUTE(m_services,"DewarPort","Dewar port:",m_dewarPort,comp_name);
    _GET_DWORD_ATTRIBUTE(m_services,"LNAPort","LNA port:",m_LNAPort,comp_name);
    _GET_DWORD_ATTRIBUTE(m_services,"WatchDogResponseTime","Response time of watch dog thread (uSec):",m_watchDogResponseTime,comp_name);
Loading