Commit 6f07f23a authored by Matteo DB's avatar Matteo DB
Browse files

lo2set value bug

parent cbaefb8b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@
				xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SynthesizerEntry><Frequency>4300.0</Frequency><OutputPower>14.0</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5050.0</Frequency><OutputPower>14.0</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5800.0</Frequency><OutputPower>14.0</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>6300.0</Frequency><OutputPower>14.0</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>4300.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5050.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5800.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>6300.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
</LocalOscillatorLookUpTable>
 No newline at end of file
+1 −4
Original line number Diff line number Diff line
@@ -5,9 +5,6 @@
				xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<SynthesizerEntry><Frequency>4300.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5050.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>5800.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>6300.0</Frequency><OutputPower>16.2</OutputPower></SynthesizerEntry>
<SynthesizerEntry><Frequency>2300.0</Frequency><OutputPower>14.0</OutputPower></SynthesizerEntry>

</LocalOscillatorLookUpTable>
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -150,11 +150,12 @@ public:
	double getRightMarkTemp(double freq);

	/**
	 * @param p_lo_name oscillatore we are referring to (LO / LO2)
	 * @param freq vector with the synthesizer frequencies. It must be freed by caller.
	 * @param power corresponding powers for the frequencies vector. It must be freed by caller.
	 * @return the size of the output vectors
	 */
	DWORD getSynthesizerTable(double *& freq,double *& power) const;
	DWORD getSynthesizerTable(const char * p_lo_name, double *& freq,double *& power) const;

	/**
	 * @param freq vector with the frequencies. It must be freed by caller.
+22 −9
Original line number Diff line number Diff line
@@ -191,9 +191,10 @@ double CConfiguration::getRightMarkTemp(double freq)
	return l_ret;
}

DWORD CConfiguration::getSynthesizerTable(double *& freq,double *& power) const
DWORD CConfiguration::getSynthesizerTable(const char * p_lo_name, double *& freq,double *& power) const
{
	/* returning only one table values, we assume similar steps between two stages */
	if (p_lo_name == "LO"){	
		WORD l_synt_len= m_synt_table_1st.size();	
		freq= new double [l_synt_len];
		power=new double [l_synt_len];
@@ -203,6 +204,18 @@ DWORD CConfiguration::getSynthesizerTable(double *& freq,double *& power) const
		}
		return l_synt_len;
	}
	if (p_lo_name == "LO2"){	
		WORD l_synt_len= m_synt_table_2nd.size();	
		freq= new double [l_synt_len];
		power=new double [l_synt_len];
		for (DWORD j=0;j < l_synt_len; j++){
			freq[j]= m_synt_table_2nd[j].frequency;
			power[j]= m_synt_table_2nd[j].outputPower;
		}
		return l_synt_len;
	}
	return 0;
}

DWORD CConfiguration::getTaperTable(double * &freq,double *&taper) const
{
+32 −12
Original line number Diff line number Diff line
@@ -121,10 +121,13 @@ bool MixerOperator::setValue(const ACS::doubleSeq& p_values)
        throw impl;
    }
    /**/
    double trueValue,amp;
    double *freq=NULL;
    double *power=NULL;
    DWORD size;
    double trueValue;
    double amp_lo, amp_lo2; 
    DWORD size_lo, size_lo2;
    double *freq_lo=NULL;
    double *power_lo=NULL;
    double *freq_lo2=NULL;
    double *power_lo2=NULL;

    ReceiverConfHandler::ConfigurationSetup l_setup= m_configuration->getCurrentSetup();	  
    
@@ -153,16 +156,33 @@ bool MixerOperator::setValue(const ACS::doubleSeq& p_values)
        throw impl;
    }
	MED_TRACE_MSG(" calculate value ");
    // LO2 specs fiex freq, get the freq, get the power
    size_lo2= m_configuration->getSynthesizerTable("LO2", freq_lo2, power_lo2);
    if (size_lo2 != 1){
        _EXCPT(ComponentErrors::ValueOutofRangeExImpl,impl,"MixerOperator::setLO");
        impl.setValueName("local oscillator 2 expecting only one configuration for freq/power value");        
        throw impl;
    } 
    if (l_setup.m_fixedLO2[0] != power_lo2[0]){
        _EXCPT(ComponentErrors::ValueOutofRangeExImpl,impl,"MixerOperator::setLO");
        impl.setValueName("local oscillator 2 conf table freq not matching expencting fixed frequency (2300MHz)");        
        throw impl;
    }
    amp_lo2= power_lo2[0];    
    //computes the synthesizer settings
    trueValue= p_values[0]+ l_setup.m_fixedLO2[0];
    size= m_configuration->getSynthesizerTable(freq,power);
    amp= round(Helpers::linearFit(freq,power,size,trueValue));
    if (power) delete [] power;
    if (freq) delete [] freq;
    ACS_LOG(LM_FULL_INFO,"MixerOperator::setLO()",(LM_DEBUG,"SYNTHESIZER_VALUES %lf %lf",trueValue,amp));
    // LO specs 
    size_lo= m_configuration->getSynthesizerTable("LO", freq_lo, power_lo);
    amp_lo= round(Helpers::linearFit(freq_lo, power_lo, size_lo, trueValue));
    if (power_lo) delete [] power_lo;
    if (freq_lo) delete [] freq_lo;    
    if (power_lo2) delete [] power_lo2;
    if (freq_lo2) delete [] freq_lo2; 
    ACS_LOG(LM_FULL_INFO,"MixerOperator::setLO()",(LM_DEBUG, "SYNTHESIZER_VALUES %lf %lf", trueValue, amp_lo));
    try {
		#ifndef EXCLUDE_MIXER
        	m_loDev_1st->set(amp, trueValue);
            m_loDev_2nd->set(amp_lo2, l_setup.m_fixedLO2[0]);
        	m_loDev_1st->set(amp_lo, trueValue);
        #endif
    }
    catch (CORBA::SystemException& ex) {