[hamradio-commits] [gnss-sdr] 21/60: Added multichannel frontend support. Enabled in UHD signal source. Multisource configuration minor changes

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sun Mar 22 11:15:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch next
in repository gnss-sdr.

commit 304f38b81acc887dd4accd49945db6ad1893a303
Author: Javier <jarribas at cttc.es>
Date:   Sun Mar 1 20:25:50 2015 +0100

    Added multichannel frontend support. Enabled in UHD signal source. Multisource configuration minor changes
---
 ...sdr_multichannel_GPS_L1_USRP_X300_realtime.conf | 257 +++++++++++----------
 conf/gnss-sdr_multisource_Hybrid_nsr.conf          |  36 +--
 .../signal_source/adapters/uhd_signal_source.cc    |   4 +
 src/core/receiver/gnss_flowgraph.cc                |  78 +++++--
 4 files changed, 221 insertions(+), 154 deletions(-)

diff --git a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
index 9641665..8513403 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
@@ -29,7 +29,7 @@ GNSS-SDR.SUPL_CI=0x31b0
 SignalSource.implementation=UHD_Signal_Source
 
 ;#When left empty, the device discovery routines will search all vailable transports on the system (ethernet, usb...)
-SignalSource.device_address=192.168.40.2
+SignalSource.device_address=192.168.50.2
 
 ;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
 SignalSource.item_type=gr_complex
@@ -76,121 +76,200 @@ SignalSource.dump1=false
 SignalSource.dump_filename1=../data/signal_source1.dat
 
 
-;######### SIGNAL_CONDITIONER CONFIG ############
+;######### SIGNAL_CONDITIONER 0 CONFIG ############
 ;## It holds blocks to change data type, filter and resample input data. 
 
 ;#implementation: Use [Pass_Through] or [Signal_Conditioner]
 ;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
 ;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
-;SignalConditioner.implementation=Signal_Conditioner
-SignalConditioner.implementation=Pass_Through
+SignalConditioner0.implementation=Pass_Through
 
-;######### DATA_TYPE_ADAPTER CONFIG ############
-;## Changes the type of input data. Please disable it in this version.
+;######### DATA_TYPE_ADAPTER 0 CONFIG ############
+;## Changes the type of input data.
 ;#implementation: [Pass_Through] disables this block
-DataTypeAdapter.implementation=Pass_Through
+DataTypeAdapter0.implementation=Pass_Through
+DataTypeAdapter0.item_type=gr_complex
 
-;######### INPUT_FILTER CONFIG ############
+;######### INPUT_FILTER 0 CONFIG ############
 ;## Filter the input data. Can be combined with frequency translation for IF signals
 
 ;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
-;#[Pass_Through] disables this block
-;#[Fir_Filter] enables a FIR Filter
-;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation that shifts IF down to zero Hz.
+;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation 
+;# that shifts IF down to zero Hz.
 
-;InputFilter.implementation=Fir_Filter
-;InputFilter.implementation=Freq_Xlating_Fir_Filter
-InputFilter.implementation=Pass_Through
+InputFilter0.implementation=Pass_Through
 
 ;#dump: Dump the filtered data to a file.
-InputFilter.dump=false
+InputFilter0.dump=false
 
 ;#dump_filename: Log path and filename.
-InputFilter.dump_filename=../data/input_filter.dat
+InputFilter0.dump_filename=../data/input_filter.dat
 
 ;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. 
 ;#These options are based on parameters of gnuradio's function: gr_remez.
-;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse reponse given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.
+;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse 
+;#reponse given a set of band edges, the desired reponse on those bands, 
+;#and the weight given to the error in those bands.
 
 ;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
-InputFilter.input_item_type=gr_complex
+InputFilter0.input_item_type=float
 
 ;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
-InputFilter.output_item_type=gr_complex
+InputFilter0.output_item_type=gr_complex
 
 ;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
-InputFilter.taps_item_type=float
+InputFilter0.taps_item_type=float
 
 ;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
-InputFilter.number_of_taps=5
+InputFilter0.number_of_taps=5
 
 ;#number_of _bands: Number of frequency bands in the filter.
-InputFilter.number_of_bands=2
+InputFilter0.number_of_bands=2
 
 ;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
 ;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
 ;#The number of band_begin and band_end elements must match the number of bands
 
-InputFilter.band1_begin=0.0
-InputFilter.band1_end=0.45
-InputFilter.band2_begin=0.55
-InputFilter.band2_end=1.0
+InputFilter0.band1_begin=0.0
+InputFilter0.band1_end=0.45
+InputFilter0.band2_begin=0.55
+InputFilter0.band2_end=1.0
 
 ;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
 ;#The number of ampl_begin and ampl_end elements must match the number of bands
 
-InputFilter.ampl1_begin=1.0
-InputFilter.ampl1_end=1.0
-InputFilter.ampl2_begin=0.0
-InputFilter.ampl2_end=0.0
+InputFilter0.ampl1_begin=1.0
+InputFilter0.ampl1_end=1.0
+InputFilter0.ampl2_begin=0.0
+InputFilter0.ampl2_end=0.0
 
 ;#band_error: weighting applied to each band (usually 1).
 ;#The number of band_error elements must match the number of bands
-InputFilter.band1_error=1.0
-InputFilter.band2_error=1.0
+InputFilter0.band1_error=1.0
+InputFilter0.band2_error=1.0
 
 ;#filter_type: one of "bandpass", "hilbert" or "differentiator" 
-InputFilter.filter_type=bandpass
+InputFilter0.filter_type=bandpass
 
 ;#grid_density: determines how accurately the filter will be constructed.
 ;The minimum value is 16; higher values are slower to compute the filter.
-InputFilter.grid_density=16
+InputFilter0.grid_density=16
 
-;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
-;#InputFilter.IF is the intermediate frequency (in Hz) shifted down to zero Hz
+;# Original sampling frequency stored in the signal file
+InputFilter0.sampling_frequency=20480000
 
-InputFilter.sampling_frequency=4000000
-InputFilter.IF=0
+;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
+;#InputFilter0.IF is the intermediate frequency (in Hz) shifted down to zero Hz
 
+InputFilter0.IF=5499998.47412109
 
+;# Decimation factor after the frequency tranaslating block
+InputFilter0.decimation_factor=8
 
-;######### RESAMPLER CONFIG ############
+;######### RESAMPLER CONFIG 0 ############
 ;## Resamples the input data. 
 
 ;#implementation: Use [Pass_Through] or [Direct_Resampler]
 ;#[Pass_Through] disables this block
 ;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation
-;Resampler.implementation=Direct_Resampler
-Resampler.implementation=Pass_Through
+Resampler0.implementation=Pass_Through
+
+;######### SIGNAL_CONDITIONER 1 CONFIG ############
+;## It holds blocks to change data type, filter and resample input data. 
+
+;#implementation: Use [Pass_Through] or [Signal_Conditioner]
+;#[Pass_Through] disables this block and the [DataTypeAdapter], [InputFilter] and [Resampler] blocks
+;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
+SignalConditioner1.implementation=Pass_Through
+
+;######### INPUT_FILTER 1 CONFIG ############
+;## Filter the input data. Can be combined with frequency translation for IF signals
+
+;#implementation: Use [Pass_Through] or [Fir_Filter] or [Freq_Xlating_Fir_Filter]
+;#[Freq_Xlating_Fir_Filter] enables FIR filter and a composite frequency translation 
+;# that shifts IF down to zero Hz.
+
+InputFilter1.implementation=Pass_Through
+
+;#dump: Dump the filtered data to a file.
+InputFilter1.dump=false
 
-;#dump: Dump the resampled data to a file.
-Resampler.dump=false
 ;#dump_filename: Log path and filename.
-Resampler.dump_filename=../data/resampler.dat
+InputFilter1.dump_filename=../data/input_filter.dat
 
-;#item_type: Type and resolution for each of the signal samples. Use only gr_complex in this version.
-Resampler.item_type=gr_complex
+;#The following options are used in the filter design of Fir_Filter and Freq_Xlating_Fir_Filter implementation. 
+;#These options are based on parameters of gnuradio's function: gr_remez.
+;#These function calculates the optimal (in the Chebyshev/minimax sense) FIR filter inpulse 
+;#reponse given a set of band edges, the desired reponse on those bands, 
+;#and the weight given to the error in those bands.
+
+;#input_item_type: Type and resolution for input signal samples. Use only gr_complex in this version.
+InputFilter1.input_item_type=float
+
+;#outut_item_type: Type and resolution for output filtered signal samples. Use only gr_complex in this version.
+InputFilter1.output_item_type=gr_complex
 
-;#sample_freq_in: the sample frequency of the input signal
-Resampler.sample_freq_in=4000000
+;#taps_item_type: Type and resolution for the taps of the filter. Use only float in this version.
+InputFilter1.taps_item_type=float
 
-;#sample_freq_out: the desired sample frequency of the output signal
-Resampler.sample_freq_out=4000000
+;#number_of_taps: Number of taps in the filter. Increasing this parameter increases the processing time
+InputFilter1.number_of_taps=5
+
+;#number_of _bands: Number of frequency bands in the filter.
+InputFilter1.number_of_bands=2
+
+;#bands: frequency at the band edges [ b1 e1 b2 e2 b3 e3 ...].
+;#Frequency is in the range [0, 1], with 1 being the Nyquist frequency (Fs/2)
+;#The number of band_begin and band_end elements must match the number of bands
 
+InputFilter1.band1_begin=0.0
+InputFilter1.band1_end=0.45
+InputFilter1.band2_begin=0.55
+InputFilter1.band2_end=1.0
+
+;#ampl: desired amplitude at the band edges [ a(b1) a(e1) a(b2) a(e2) ...].
+;#The number of ampl_begin and ampl_end elements must match the number of bands
+
+InputFilter1.ampl1_begin=1.0
+InputFilter1.ampl1_end=1.0
+InputFilter1.ampl2_begin=0.0
+InputFilter1.ampl2_end=0.0
+
+;#band_error: weighting applied to each band (usually 1).
+;#The number of band_error elements must match the number of bands
+InputFilter1.band1_error=1.0
+InputFilter1.band2_error=1.0
+
+;#filter_type: one of "bandpass", "hilbert" or "differentiator" 
+InputFilter1.filter_type=bandpass
+
+;#grid_density: determines how accurately the filter will be constructed.
+;The minimum value is 16; higher values are slower to compute the filter.
+InputFilter1.grid_density=16
+
+;# Original sampling frequency stored in the signal file
+InputFilter1.sampling_frequency=20480000
+
+;#The following options are used only in Freq_Xlating_Fir_Filter implementation.
+;#InputFilter1.IF is the intermediate frequency (in Hz) shifted down to zero Hz
+
+InputFilter1.IF=5499998.47412109
+
+;# Decimation factor after the frequency tranaslating block
+InputFilter1.decimation_factor=8
+
+
+;######### RESAMPLER CONFIG 1 ############
+;## Resamples the input data. 
+
+;#implementation: Use [Pass_Through] or [Direct_Resampler]
+;#[Pass_Through] disables this block
+;#[Direct_Resampler] enables a resampler that implements a nearest neigbourhood interpolation
+Resampler1.implementation=Pass_Through
 
 ;######### CHANNELS GLOBAL CONFIG ############
 ;#count: Number of available GPS satellite channels.
-Channels_GPS.count=8
+Channels_GPS.count=2
 ;#count: Number of available Galileo satellite channels.
 Channels_Galileo.count=0
 ;#in_acquisition: Number of channels simultaneously acquiring for the whole receiver
@@ -199,82 +278,17 @@ Channels.in_acquisition=1
 ;#if the option is disabled by default is assigned GPS
 Channel.system=GPS
 
+;# CHANNEL CONNECTION
+Channel0.RF_channel_ID=0
+Channel1.RF_channel_ID=1
+
 ;#signal: 
-;# "1C" GPS L1 C/A
-;# "1P" GPS L1 P
-;# "1W" GPS L1 Z-tracking and similar (AS on)
-;# "1Y" GPS L1 Y
-;# "1M" GPS L1 M
-;# "1N" GPS L1 codeless
-;# "2C" GPS L2 C/A
-;# "2D" GPS L2 L1(C/A)+(P2-P1) semi-codeless
-;# "2S" GPS L2 L2C (M)
-;# "2L" GPS L2 L2C (L)
-;# "2X" GPS L2 L2C (M+L)
-;# "2P" GPS L2 P
-;# "2W" GPS L2 Z-tracking and similar (AS on)
-;# "2Y" GPS L2 Y
-;# "2M" GPS GPS L2 M
-;# "2N" GPS L2 codeless
-;# "5I" GPS L5 I
-;# "5Q" GPS L5 Q
-;# "5X" GPS L5 I+Q
-;# "1C" GLONASS G1 C/A
-;# "1P" GLONASS G1 P
-;# "2C" GLONASS G2 C/A  (Glonass M)
-;# "2P" GLONASS G2 P
-;# "1A" GALILEO E1 A (PRS)
-;# "1B" GALILEO E1 B (I/NAV OS/CS/SoL)
-;# "1C" GALILEO E1 C (no data)
-;# "1X" GALILEO E1 B+C
-;# "1Z" GALILEO E1 A+B+C
-;# "5I" GALILEO E5a I (F/NAV OS)
-;# "5Q" GALILEO E5a Q  (no data)
-;# "5X" GALILEO E5a I+Q
-;# "7I" GALILEO E5b I
-;# "7Q" GALILEO E5b Q
-;# "7X" GALILEO E5b I+Q
-;# "8I" GALILEO E5 I
-;# "8Q" GALILEO E5 Q
-;# "8X" GALILEO E5 I+Q
-;# "6A" GALILEO E6 A
-;# "6B" GALILEO E6 B
-;# "6C" GALILEO E6 C
-;# "6X" GALILEO E6 B+C
-;# "6Z" GALILEO E6 A+B+C
-;# "1C" SBAS L1 C/A
-;# "5I" SBAS L5 I
-;# "5Q" SBAS L5 Q
-;# "5X" SBAS L5 I+Q
-;# "2I" COMPASS E2 I
-;# "2Q" COMPASS E2 Q
-;# "2X" COMPASS E2 IQ
-;# "7I" COMPASS E5b I
-;# "7Q" COMPASS E5b Q
-;# "7X" COMPASS E5b IQ
-;# "6I" COMPASS E6 I
-;# "6Q" COMPASS E6 Q
-;# "6X" COMPASS E6 IQ
 ;#if the option is disabled by default is assigned "1C" GPS L1 C/A
 Channel.signal=1C
 
 ;######### SPECIFIC CHANNELS CONFIG ######
 ;#The following options are specific to each channel and overwrite the generic options 
 
-;######### CHANNEL 0 CONFIG ############
-
-Channel0.system=GPS
-Channel0.signal=1C
-
-;#satellite: Satellite PRN ID for this channel. Disable this option to random search
-Channel0.satellite=11
-
-;######### CHANNEL 1 CONFIG ############
-
-Channel1.system=GPS
-Channel1.signal=1C
-Channel1.satellite=18
-
 
 ;######### ACQUISITION GLOBAL CONFIG ############
 
@@ -299,7 +313,8 @@ Acquisition_GPS.doppler_max=8000
 ;#doppler_max: Doppler step in the grid search [Hz]
 Acquisition_GPS.doppler_step=500
 ;#bit_transition_flag: Enable or disable a strategy to deal with bit transitions in GPS signals: process two dwells and take
-maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] (should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
+;#maximum test statistics. Only use with implementation: [GPS_L1_CA_PCPS_Acquisition] 
+;#(should not be used for Galileo_E1_PCPS_Ambiguous_Acquisition])
 Acquisition_GPS.bit_transition_flag=false
 ;#max_dwells: Maximum number of consecutive dwells to be processed. It will be ignored if bit_transition_flag=true
 Acquisition_GPS.max_dwells=1
diff --git a/conf/gnss-sdr_multisource_Hybrid_nsr.conf b/conf/gnss-sdr_multisource_Hybrid_nsr.conf
index 2db65c2..c7ce58f 100644
--- a/conf/gnss-sdr_multisource_Hybrid_nsr.conf
+++ b/conf/gnss-sdr_multisource_Hybrid_nsr.conf
@@ -287,24 +287,24 @@ Channels.in_acquisition=1
 ;#if the option is disabled by default is assigned GPS
 Channel.system=GPS, Galileo
 
-;# CHANNEL CONNECTION
-Channel0.SignalSource_ID=0
-Channel1.SignalSource_ID=0
-Channel2.SignalSource_ID=0
-Channel3.SignalSource_ID=0
-Channel4.SignalSource_ID=0
-Channel5.SignalSource_ID=0
-Channel6.SignalSource_ID=0
-Channel7.SignalSource_ID=0
-
-Channel8.SignalSource_ID=1
-Channel9.SignalSource_ID=1
-Channel10.SignalSource_ID=1
-Channel11.SignalSource_ID=1
-Channel12.SignalSource_ID=1
-Channel13.SignalSource_ID=1
-Channel14.SignalSource_ID=1
-Channel15.SignalSource_ID=1
+;# SOURCE CONNECTION
+Channel0.RF_channel_ID=0
+Channel1.RF_channel_ID=0
+Channel2.RF_channel_ID=0
+Channel3.RF_channel_ID=0
+Channel4.RF_channel_ID=0
+Channel5.RF_channel_ID=0
+Channel6.RF_channel_ID=0
+Channel7.RF_channel_ID=0
+
+Channel8.RF_channel_ID=1
+Channel9.RF_channel_ID=1
+Channel10.RF_channel_ID=1
+Channel11.RF_channel_ID=1
+Channel12.RF_channel_ID=1
+Channel13.RF_channel_ID=1
+Channel14.RF_channel_ID=1
+Channel15.RF_channel_ID=1
 
 ;#signal: 
 ;#if the option is disabled by default is assigned "1C" GPS L1 C/A
diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.cc b/src/algorithms/signal_source/adapters/uhd_signal_source.cc
index 7531821..5d1cd5e 100644
--- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc
@@ -163,6 +163,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
 
 	for (int i=0;i<RF_channels_;i++)
 	{
+		std::cout<< "UHD RF CHANNEL #"<<i<< " SETTINGS"<<std::endl;
 		// 3. Tune the usrp device to the desired center frequency
 		uhd_source_->set_center_freq(freq_.at(i),i);
 		std::cout << boost::format("Actual USRP center freq.: %f [Hz]...") % (uhd_source_->get_center_freq(i)) << std::endl << std::endl;
@@ -299,12 +300,15 @@ gr::basic_block_sptr UhdSignalSource::get_right_block()
 
 gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel)
 {
+	//TODO: There is a incoherence here: Multichannel UHD is a single block with multiple outputs, but if the sample imit is enable, the output is a multiple block!
     if (samples_.at(RF_channel) != 0)
         {
+    		std::cout<<"return valve!"<<std::endl;
             return valve_.at(RF_channel);
         }
     else
         {
+    	std::cout<<"return uhd!"<<std::endl;
             return uhd_source_;
         }
 }
diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc
index 7ed8ab8..9014d0d 100644
--- a/src/core/receiver/gnss_flowgraph.cc
+++ b/src/core/receiver/gnss_flowgraph.cc
@@ -130,7 +130,7 @@ void GNSSFlowgraph::connect()
 
     // Signal Source > Signal conditioner >
 
-		for (int i = 0; i < sources_count_; i++)
+		for (unsigned int i = 0; i < sig_conditioner_.size(); i++)
 		{
 			try
 			{
@@ -165,7 +165,6 @@ void GNSSFlowgraph::connect()
 
     try
     {
-            //observables_ = std::move(blocks_->at(2));
             observables_->connect(top_block_);
     }
     catch (std::exception& e)
@@ -179,7 +178,6 @@ void GNSSFlowgraph::connect()
     // Signal Source > Signal conditioner >> Channels >> Observables > PVT
     try
     {
-            //pvt_ = std::move(blocks_->at(3));
             pvt_->connect(top_block_);
     }
     catch (std::exception& e)
@@ -193,7 +191,6 @@ void GNSSFlowgraph::connect()
     // Signal Source > Signal conditioner >> Channels >> Observables > PVT > Output Filter
     try
     {
-            //output_filter_ = std::move(blocks_->at(4));
             output_filter_->connect(top_block_);
     }
     catch (std::exception& e)
@@ -208,6 +205,8 @@ void GNSSFlowgraph::connect()
 
     // Signal Source (i) >  Signal conditioner (i) >
 
+    int RF_Channels=0;
+    int signal_conditioner_ID=0;
 	for (int i = 0; i < sources_count_; i++)
 	{
 
@@ -227,8 +226,21 @@ void GNSSFlowgraph::connect()
 						}
 					else
 						{
-							//single channel
-							top_block_->connect(sig_source_.at(i)->get_right_block(), 0, sig_conditioner_.at(i)->get_left_block(), 0);
+							//TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface.
+							//Include GetRFChannels in the interface to avoid read config parameters here
+							//read the number of RF channels for each front-end
+							RF_Channels=configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1);
+
+							for (int j=0; j<RF_Channels; j++)
+							{
+								//Connect the multichannel signal source to multiple signal conditioners
+								std::cout<<"Output signature max cstreams ="<<sig_source_.at(i)->get_right_block()->output_signature()->max_streams()<<std::endl;
+								top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0);
+								std::cout << "Connect signal source "<<i<<", CH "<<j<<" to sign_conditioner "<<signal_conditioner_ID<<std::endl;
+								signal_conditioner_ID++;
+							}
+
+
 						}
 
 			}
@@ -243,25 +255,28 @@ void GNSSFlowgraph::connect()
     DLOG(INFO) << "Signal source connected to signal conditioner";
 
     // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)
-    int selected_signal_source;
+    int selected_signal_conditioner_ID;
     for (unsigned int i = 0; i < channels_count_; i++)
         {
 
-            selected_signal_source = configuration_->property("Channel" + boost::lexical_cast<std::string>(i) +".SignalSource_ID", 0);
-			try
+            selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast<std::string>(i) +".RF_channel_ID", 0);
+
+            try
 			{
-			top_block_->connect(sig_conditioner_.at(selected_signal_source)->get_right_block(), 0,
+			top_block_->connect(sig_conditioner_.at(selected_signal_conditioner_ID)->get_right_block(), 0,
 					channels_.at(i)->get_left_block(), 0);
+			std::cout << "Connect sig_conditioner_ "<<selected_signal_conditioner_ID<<" to channel "<<i<<std::endl;
+
             }
             catch (std::exception& e)
             {
-                    LOG(WARNING) << "Can't connect signal conditioner "<<selected_signal_source<<" to channel " << i;
+                    LOG(WARNING) << "Can't connect signal conditioner "<<selected_signal_conditioner_ID<<"  to channel " << i;
                     LOG(ERROR) << e.what();
                     top_block_->disconnect_all();
                     return;
             }
 
-            DLOG(INFO) << "signal conditioner "<<selected_signal_source<<" connected to channel " << i;
+            DLOG(INFO) << "signal conditioner "<<selected_signal_conditioner_ID<<" connected to channel " << i;
 
             // Signal Source > Signal conditioner >> Channels >> Observables
             try
@@ -461,20 +476,53 @@ void GNSSFlowgraph::init()
     // 1. read the number of RF front-ends available (one file_source per RF front-end)
     sources_count_ = configuration_->property("Receiver.sources_count", 1);
 
+    int RF_Channels=0;
+    int signal_conditioner_ID=0;
+
     if (sources_count_>1)
     {
 		for (int i = 0; i < sources_count_; i++)
 			{
 			std::cout<<"creating source "<<i<<std::endl;
-				sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_,i));
-				sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, i));
+			sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_,i));
+			//TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface.
+			//Include GetRFChannels in the interface to avoid read config parameters here
+		    //read the number of RF channels for each front-end
+			RF_Channels=configuration_->property(sig_source_.at(i)->role() + ".RF_channels", 1);
+			std::cout<<"RF_Channels="<<RF_Channels<<std::endl;
+			for (int j=0; j<RF_Channels; j++)
+			{
+
+				sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, signal_conditioner_ID));
+				signal_conditioner_ID++;
+			}
+
 			}
     }else{
     	//backwards compatibility for old config files
 		sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_,-1));
-		sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, -1));
+		//TODO: Create a class interface for SignalSources, derived from GNSSBlockInterface.
+		//Include GetRFChannels in the interface to avoid read config parameters here
+	    //read the number of RF channels for each front-end
+		RF_Channels=configuration_->property(sig_source_.at(0)->role() + ".RF_channels", 0);
+		std::cout<<"RF_Channels="<<RF_Channels<<std::endl;
+		if (RF_Channels!=0)
+		{
+			for (int j=0; j<RF_Channels; j++)
+			{
+
+				sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, signal_conditioner_ID));
+				signal_conditioner_ID++;
+			}
+		}else{
+			//old config file, single signal source and single channel, not specified
+			sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, -1));
+		}
 	}
 
+
+
+
     observables_ = block_factory_->GetObservables(configuration_, queue_);
     pvt_ = block_factory_->GetPVT(configuration_, queue_);
     output_filter_ = block_factory_->GetOutputFilter(configuration_, queue_);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list