[hamradio-commits] [gnss-sdr] 25/60: Merge remote-tracking branch 'Arribas/next' into multisource

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sun Mar 22 11:15:42 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 7c7f0ecbd2c4881b7117daca94fcd33106aaef3b
Merge: 8bb61f6 7a681a2
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Sun Mar 1 22:23:17 2015 +0100

    Merge remote-tracking branch 'Arribas/next' into multisource
    
    Conflicts:
    	src/algorithms/signal_source/adapters/uhd_signal_source.cc
    	src/core/receiver/gnss_flowgraph.cc

 ...sdr_multichannel_GPS_L1_USRP_X300_realtime.conf | 257 +++++++++++----------
 conf/gnss-sdr_multisource_Hybrid_nsr.conf          |  36 +--
 .../signal_source/adapters/uhd_signal_source.cc    |  24 +-
 src/core/receiver/gnss_flowgraph.cc                |  71 ++++--
 4 files changed, 222 insertions(+), 166 deletions(-)

diff --cc src/algorithms/signal_source/adapters/uhd_signal_source.cc
index f39cea0,aad3769..dc3502f
--- a/src/algorithms/signal_source/adapters/uhd_signal_source.cc
+++ b/src/algorithms/signal_source/adapters/uhd_signal_source.cc
@@@ -130,10 -128,10 +130,10 @@@ UhdSignalSource::UhdSignalSource(Config
          }
  
      // select the number of channels and the subdevice specifications
-     for (int i = 0; i< RF_channels_; i++)
 -	for (int i=0;i<RF_channels_;i++)
 -	{
 -		uhd_stream_args_.channels.push_back(i);
 -	}
++    for (int i = 0; i < RF_channels_; i++)
 +        {
 +            uhd_stream_args_.channels.push_back(i);
 +        }
  
      // 1.2 Make the UHD source object
      uhd_source_ = gr::uhd::usrp_source::make(dev_addr, uhd_stream_args_);
@@@ -161,69 -159,71 +161,70 @@@
      std::cout << boost::format("Sampling Rate for the USRP device: %f [sps]...") % (uhd_source_->get_samp_rate()) << std::endl;
      LOG(INFO) << boost::format("Sampling Rate for the USRP device: %f [sps]...") % (uhd_source_->get_samp_rate());
  
 -	std::vector<std::string> sensor_names;
 -
 -	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;
 -		LOG(INFO) << boost::format("Actual USRP center freq. set to: %f [Hz]...") % (uhd_source_->get_center_freq(i));
 -
 -		// TODO: Assign the remnant IF from the PLL tune error
 -		std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i)) << std::endl;
 -		LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i));
 -
 -		// 4. set the gain for the daughterboard
 -		uhd_source_->set_gain(gain_.at(i),i);
 -		std::cout << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i) << std::endl;
 -		LOG(INFO) << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i);
 -
 -		//5.  Set the bandpass filter on the RF frontend
 -		std::cout << boost::format("Setting RF bandpass filter bandwidth to: %f [Hz]...") % IF_bandwidth_hz_.at(i) << std::endl;
 -		uhd_source_->set_bandwidth(IF_bandwidth_hz_.at(i),i);
 -
 -		//set the antenna (optional)
 -		//uhd_source_->set_antenna(ant);
 -
 -		// We should wait? #include <boost/thread.hpp>
 -		// boost::this_thread::sleep(boost::posix_time::seconds(1));
 -
 -		// Check out the status of the lo_locked sensor (boolean for LO lock state)
 -		sensor_names = uhd_source_->get_sensor_names(i);
 -		if (std::find(sensor_names.begin(), sensor_names.end(), "lo_locked") != sensor_names.end())
 -			{
 -				uhd::sensor_value_t lo_locked = uhd_source_->get_sensor("lo_locked", i);
 -				std::cout << boost::format("Check for front-end %s ...") % lo_locked.to_pp_string() << " is ";
 -				if (lo_locked.to_bool() == true)
 -					{
 -						std::cout << "Locked" << std::endl;
 -					}
 -				else
 -					{
 -						std::cout << "UNLOCKED!" <<std::endl;
 -					}
 -				//UHD_ASSERT_THROW(lo_locked.to_bool());
 -			}
 -	}
 -
 -
 -	for (int i=0;i<RF_channels_;i++)
 -	{
 -	    if (samples_.at(i) != 0)
 -	        {
 -	            LOG(INFO) << "RF_channel "<<i<<" Send STOP signal after " << samples_.at(i) << " samples";
 -	            valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_));
 -	            DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")";
 -	        }
 -
 -	    if (dump_.at(i))
 -	        {
 -	            LOG(INFO) << "RF_channel "<<i<< "Dumping output into file " << dump_filename_.at(i);
 -	            file_sink_.push_back(gr::blocks::file_sink::make(item_size_, dump_filename_.at(i).c_str()));
 -	            DLOG(INFO) << "file_sink(" << file_sink_.at(i)->unique_id() << ")";
 -	        }
 -	}
 +    std::vector<std::string> sensor_names;
  
 +    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;
++            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;
 +            LOG(INFO) << boost::format("Actual USRP center freq. set to: %f [Hz]...") % (uhd_source_->get_center_freq(i));
 +
 +            // TODO: Assign the remnant IF from the PLL tune error
 +            std::cout << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i)) << std::endl;
 +            LOG(INFO) << boost::format("PLL Frequency tune error %f [Hz]...") % (uhd_source_->get_center_freq(i) - freq_.at(i));
 +
 +            // 4. set the gain for the daughterboard
-             uhd_source_->set_gain(gain_.at(i),i);
++            uhd_source_->set_gain(gain_.at(i), i);
 +            std::cout << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i) << std::endl;
 +            LOG(INFO) << boost::format("Actual daughterboard gain set to: %f dB...") % uhd_source_->get_gain(i);
 +
 +            //5.  Set the bandpass filter on the RF frontend
 +            std::cout << boost::format("Setting RF bandpass filter bandwidth to: %f [Hz]...") % IF_bandwidth_hz_.at(i) << std::endl;
-             uhd_source_->set_bandwidth(IF_bandwidth_hz_.at(i),i);
++            uhd_source_->set_bandwidth(IF_bandwidth_hz_.at(i), i);
 +
 +            //set the antenna (optional)
 +            //uhd_source_->set_antenna(ant);
 +
 +            // We should wait? #include <boost/thread.hpp>
 +            // boost::this_thread::sleep(boost::posix_time::seconds(1));
 +
 +            // Check out the status of the lo_locked sensor (boolean for LO lock state)
 +            sensor_names = uhd_source_->get_sensor_names(i);
 +            if (std::find(sensor_names.begin(), sensor_names.end(), "lo_locked") != sensor_names.end())
 +                {
 +                    uhd::sensor_value_t lo_locked = uhd_source_->get_sensor("lo_locked", i);
 +                    std::cout << boost::format("Check for front-end %s ...") % lo_locked.to_pp_string() << " is ";
 +                    if (lo_locked.to_bool() == true)
 +                        {
 +                            std::cout << "Locked" << std::endl;
 +                        }
 +                    else
 +                        {
-                             std::cout << "UNLOCKED!" <<std::endl;
++                            std::cout << "UNLOCKED!" << std::endl;
 +                        }
 +                    //UHD_ASSERT_THROW(lo_locked.to_bool());
 +                }
 +        }
 +
 +
 +    for (int i = 0; i < RF_channels_; i++)
 +        {
 +            if (samples_.at(i) != 0)
 +                {
-                     LOG(INFO) << "RF_channel "<<i<<" Send STOP signal after " << samples_.at(i) << " samples";
++                    LOG(INFO) << "RF_channel "<< i << " Send STOP signal after " << samples_.at(i) << " samples";
 +                    valve_.push_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_));
 +                    DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")";
 +                }
 +
 +            if (dump_.at(i))
 +                {
-                     LOG(INFO) << "RF_channel "<<i<< "Dumping output into file " << dump_filename_.at(i);
++                    LOG(INFO) << "RF_channel "<< i << "Dumping output into file " << dump_filename_.at(i);
 +                    file_sink_.push_back(gr::blocks::file_sink::make(item_size_, dump_filename_.at(i).c_str()));
 +                    DLOG(INFO) << "file_sink(" << file_sink_.at(i)->unique_id() << ")";
 +                }
 +        }
  }
  
  
@@@ -231,30 -231,31 +232,30 @@@
  UhdSignalSource::~UhdSignalSource()
  {}
  
 +
  void UhdSignalSource::connect(gr::top_block_sptr top_block)
  {
 -
 -	for (int i=0;i<RF_channels_;i++)
 -	{
 -
 -		if (samples_.at(i) != 0)
 -			{
 -				top_block->connect(uhd_source_, i, valve_.at(i), 0);
 -				DLOG(INFO) << "connected usrp source to valve RF Channel "<< i;
 -				if (dump_.at(i))
 -					{
 -						top_block->connect(valve_.at(i), 0, file_sink_.at(i), 0);
 -						DLOG(INFO) << "connected valve to file sink RF Channel "<< i;
 -					}
 -			}
 -		else
 -			{
 -				if (dump_.at(i))
 -					{
 -						top_block->connect(uhd_source_, i, file_sink_.at(i), 0);
 -						DLOG(INFO) << "connected usrp source to file sink RF Channel "<< i;
 -					}
 -			}
 -	}
 +    for (int i = 0; i < RF_channels_; i++)
 +        {
 +            if (samples_.at(i) != 0)
 +                {
 +                    top_block->connect(uhd_source_, i, valve_.at(i), 0);
-                     DLOG(INFO) << "connected usrp source to valve RF Channel "<< i;
++                    DLOG(INFO) << "connected usrp source to valve RF Channel " << i;
 +                    if (dump_.at(i))
 +                        {
 +                            top_block->connect(valve_.at(i), 0, file_sink_.at(i), 0);
-                             DLOG(INFO) << "connected valve to file sink RF Channel "<< i;
++                            DLOG(INFO) << "connected valve to file sink RF Channel " << i;
 +                        }
 +                }
 +            else
 +                {
 +                    if (dump_.at(i))
 +                        {
 +                            top_block->connect(uhd_source_, i, file_sink_.at(i), 0);
-                             DLOG(INFO) << "connected usrp source to file sink RF Channel "<< i;
++                            DLOG(INFO) << "connected usrp source to file sink RF Channel " << i;
 +                        }
 +                }
 +        }
  }
  
  
@@@ -294,12 -295,12 +295,13 @@@ gr::basic_block_sptr UhdSignalSource::g
  
  gr::basic_block_sptr UhdSignalSource::get_right_block()
  {
 -	return get_right_block(0);
 +    return get_right_block(0);
  }
  
 +
  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!
++    //TODO: There is a incoherence here: Multichannel UHD is a single block with multiple outputs, but if the sample limit is enabled, the output is a multiple block!
      if (samples_.at(RF_channel) != 0)
          {
              return valve_.at(RF_channel);
diff --cc src/core/receiver/gnss_flowgraph.cc
index 3ec80e7,77a07f9..f2986d9
--- a/src/core/receiver/gnss_flowgraph.cc
+++ b/src/core/receiver/gnss_flowgraph.cc
@@@ -111,36 -113,37 +111,36 @@@ void GNSSFlowgraph::connect(
              return;
          }
  
 -		for (int i = 0; i < sources_count_; i++)
 -		{
 -			try
 -			{
 -				sig_source_.at(i)->connect(top_block_);
 -			}
 -			catch (std::exception& e)
 -			{
 -				LOG(INFO) << "Can't connect signal source block " << i << " internally";
 -				LOG(ERROR) << e.what();
 -				top_block_->disconnect_all();
 -				return;
 -			}
 -		}
 +    for (int i = 0; i < sources_count_; i++)
 +        {
 +            try
 +            {
 +                    sig_source_.at(i)->connect(top_block_);
 +            }
 +            catch (std::exception& e)
 +            {
 +                    LOG(INFO) << "Can't connect signal source block " << i << " internally";
 +                    LOG(ERROR) << e.what();
 +                    top_block_->disconnect_all();
 +                    return;
 +            }
 +        }
  
      // Signal Source > Signal conditioner >
-     for (int i = 0; i < sources_count_; i++)
 -
 -		for (unsigned int i = 0; i < sig_conditioner_.size(); i++)
 -		{
 -			try
 -			{
 -				sig_conditioner_.at(i)->connect(top_block_);
 -			}
 -			catch (std::exception& e)
 -			{
 -				LOG(INFO) << "Can't connect signal conditioner block " << i << " internally";
 -				LOG(ERROR) << e.what();
 -				top_block_->disconnect_all();
 -				return;
 -			}
 -		}
++    for (unsigned int i = 0; i < sig_conditioner_.size(); i++)
 +        {
 +            try
 +            {
 +                    sig_conditioner_.at(i)->connect(top_block_);
 +            }
 +            catch (std::exception& e)
 +            {
 +                    LOG(INFO) << "Can't connect signal conditioner block " << i << " internally";
 +                    LOG(ERROR) << e.what();
 +                    top_block_->disconnect_all();
 +                    return;
 +            }
 +        }
  
      for (unsigned int i = 0; i < channels_count_; i++)
          {
@@@ -198,59 -204,76 +198,70 @@@
      DLOG(INFO) << "blocks connected internally";
  
      // Signal Source (i) >  Signal conditioner (i) >
++    int RF_Channels = 0;
++    int signal_conditioner_ID = 0;
++
 +    for (int i = 0; i < sources_count_; i++)
 +        {
 +            try
 +            {
 +                    //TODO: Remove this array implementation and create generic multistream connector
 +                    //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner)
 +                    if(sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0)
 +                        {
 +                            //Multichannel Array
 +                            std::cout << "ARRAY MODE" << std::endl;
 +                            for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++)
 +                                {
-                                     std::cout << "connecting ch "<< j << std::endl;
++                                    std::cout << "connecting ch " << j << std::endl;
 +                                    top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j);
 +                                }
 +                        }
 +                    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
++                                    top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0);
++                                    signal_conditioner_ID++;
++                                }
++                        }
 +            }
 +            catch (std::exception& e)
 +            {
 +                    LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i;
 +                    LOG(ERROR) << e.what();
 +                    top_block_->disconnect_all();
 +                    return;
 +            }
 +        }
+ 
 -    int RF_Channels=0;
 -    int signal_conditioner_ID=0;
 -	for (int i = 0; i < sources_count_; i++)
 -	{
 -
 -			try
 -			{
 -					//TODO: Remove this array implementation and create generic multistream connector
 -				    //(if a signal source has more than 1 stream, then connect it to the multistream signal conditioner)
 -					if(sig_source_.at(i)->implementation().compare("Raw_Array_Signal_Source") == 0)
 -						{
 -							//Multichannel Array
 -							std::cout << "ARRAY MODE" << std::endl;
 -							for (int j = 0; j < GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS; j++)
 -								{
 -									std::cout << "connecting ch "<< j << std::endl;
 -									top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(i)->get_left_block(), j);
 -								}
 -						}
 -					else
 -						{
 -							//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
 -								top_block_->connect(sig_source_.at(i)->get_right_block(), j, sig_conditioner_.at(signal_conditioner_ID)->get_left_block(), 0);
 -								signal_conditioner_ID++;
 -							}
 -
 -
 -						}
 -
 -			}
 -			catch (std::exception& e)
 -			{
 -					LOG(WARNING) << "Can't connect signal source " << i << " to signal conditioner " << i;
 -					LOG(ERROR) << e.what();
 -					top_block_->disconnect_all();
 -					return;
 -			}
 -    }
      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);
 -            selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast<std::string>(i) +".RF_channel_ID", 0);
 -
++            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_conditioner_ID)->get_right_block(), 0,
 -					channels_.at(i)->get_left_block(), 0);
 -
 +            {
-                     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);
              }
              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(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;
++            DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i;
  
              // Signal Source > Signal conditioner >> Channels >> Observables
              try
@@@ -282,15 -305,15 +293,15 @@@
                  {
                      channels_.at(i)->start_acquisition();
                      LOG(INFO) << "Channel " << i
--                              << " connected to observables and ready for acquisition";
++                            << " connected to observables and ready for acquisition";
                  }
              else
                  {
                      LOG(INFO) << "Channel " << i
--                              << " connected to observables in standby mode";
++                            << " connected to observables in standby mode";
                  }
 -
          }
 +
      /*
       * Connect the observables output of each channel to the PVT block
       */
@@@ -450,21 -473,51 +461,49 @@@ 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));
 -			//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));
 -		//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);
 -		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));
 -		}
 -	}
 -
 -
++    int RF_Channels = 0;
++    int signal_conditioner_ID = 0;
+ 
 +    if (sources_count_ > 1)
 +        {
 +            for (int i = 0; i < sources_count_; i++)
 +                {
-                     std::cout << "Creating signal source " << i << std::endl;
++                    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));
++                    //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);
++            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_);

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