From 9542cbb7337318a733bcc535f15dd0cd67077a54 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sun, 10 May 2015 12:35:49 +0200 Subject: [PATCH] Bug fixes --- src/core/receiver/gnss_block_factory.cc | 2 +- src/core/receiver/gnss_block_factory.h | 25 ++++++++++++------------ src/core/receiver/gnss_flowgraph.cc | 22 +++++++++------------ src/core/system_parameters/gnss_signal.h | 2 +- 4 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/core/receiver/gnss_block_factory.cc b/src/core/receiver/gnss_block_factory.cc index 18f177227..9d0fe65bc 100644 --- a/src/core/receiver/gnss_block_factory.cc +++ b/src/core/receiver/gnss_block_factory.cc @@ -618,7 +618,7 @@ std::unique_ptr>> GNSSBlockFacto // Push back the channel to the vector of channels, if apply. if((channel_count > 0) and apply_) { - channels->push_back(std::move(GetChannel_GPS(configuration, + channels->push_back(std::move(GetChannel_2S(configuration, acquisition_implementation, tracking_implementation, telemetry_decoder_implementation, i, queue))); channel_absolute_id++; } diff --git a/src/core/receiver/gnss_block_factory.h b/src/core/receiver/gnss_block_factory.h index 5ca34ce09..5fa3b61d7 100644 --- a/src/core/receiver/gnss_block_factory.h +++ b/src/core/receiver/gnss_block_factory.h @@ -71,6 +71,18 @@ public: std::unique_ptr GetOutputFilter(std::shared_ptr configuration, boost::shared_ptr queue); + std::unique_ptr>> GetChannels(std::shared_ptr configuration, + boost::shared_ptr queue); + + /* + * \brief Returns the block with the required configuration and implementation + */ + std::unique_ptr GetBlock(std::shared_ptr configuration, + std::string role, std::string implementation, + unsigned int in_streams, unsigned int out_streams, + boost::shared_ptr queue); + +private: // DEPRECATED std::unique_ptr GetChannel_GPS(std::shared_ptr configuration, std::string acq, std::string trk, std::string tlm, int channel, @@ -97,19 +109,6 @@ public: std::string acq, std::string trk, std::string tlm, int channel, boost::shared_ptr queue); - - std::unique_ptr>> GetChannels(std::shared_ptr configuration, - boost::shared_ptr queue); - - /* - * \brief Returns the block with the required configuration and implementation - */ - std::unique_ptr GetBlock(std::shared_ptr configuration, - std::string role, std::string implementation, - unsigned int in_streams, unsigned int out_streams, - boost::shared_ptr queue); - -private: std::unique_ptr GetAcqBlock( std::shared_ptr configuration, std::string role, diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 4092c44fd..18755f2f4 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -392,12 +392,11 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) switch (what) { case 0: - LOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite()<<", Signal " << channels_.at(who)->get_signal().get_signal(); + LOG(INFO) << "Channel " << who << " ACQ FAILED satellite " << channels_.at(who)->get_signal().get_satellite() << ", Signal " << channels_.at(who)->get_signal().get_signal(); available_GNSS_signals_.push_back(channels_.at(who)->get_signal()); //TODO: Optimize the channel and signal matching! - while (//channels_.at(who)->get_signal().get_satellite().get_system() != available_GNSS_signals_.front().get_satellite().get_system() - channels_.at(who)->get_signal().get_signal() != available_GNSS_signals_.front().get_signal() ) + while ( channels_.at(who)->get_signal().get_signal().compare(available_GNSS_signals_.front().get_signal()) != 0 ) { available_GNSS_signals_.push_back(available_GNSS_signals_.front()); available_GNSS_signals_.pop_front(); @@ -591,7 +590,7 @@ void GNSSFlowgraph::set_signals_list() std::set available_sbas_prn = {120, 124, 126}; std::set available_galileo_prn = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}; @@ -630,8 +629,6 @@ void GNSSFlowgraph::set_signals_list() /* * Loop to create SBAS L1 C/A signals */ - - for (available_gnss_prn_iter = available_sbas_prn.begin(); available_gnss_prn_iter != available_sbas_prn.end(); available_gnss_prn_iter++) @@ -642,7 +639,6 @@ void GNSSFlowgraph::set_signals_list() } - if ((configuration_->property("Channels_1B.count", 0) > 0) or (default_system.find(std::string("Galileo")) != std::string::npos) or (default_signal.compare("1B") == 0) or (configuration_->property("Channels_Galileo.count", 0) > 0)) { /* @@ -680,21 +676,21 @@ void GNSSFlowgraph::set_signals_list() for (unsigned int i = 0; i < total_channels; i++) { - std::string gnss_system = (configuration_->property("Channel" + boost::lexical_cast(i) + ".system", default_system)); - std::string gnss_signal = (configuration_->property("Channel" + boost::lexical_cast(i) + ".signal", default_signal)); - LOG(INFO) << "Channel " << i << " signal " << gnss_signal; + std::string gnss_system; + if((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) ) gnss_system = "GPS"; + if((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0) ) gnss_system = "Galileo"; + + LOG(INFO) << "Channel " << i << " system " << gnss_system << ", signal " << gnss_signal; unsigned int sat = configuration_->property("Channel" + boost::lexical_cast(i) + ".satellite", 0); - if (((sat == 0) || (sat == gnss_it->get_satellite().get_PRN())) and ( gnss_it->get_signal().compare(gnss_signal) == 0 ) ) // 0 = not PRN in configuration file and ( gnss_it->get_signal().compare(gnss_signal) == 0 ) + if (((sat == 0) || (sat == gnss_it->get_satellite().get_PRN())) and ( gnss_it->get_signal().compare(gnss_signal) == 0 ) ) // 0 = not PRN in configuration file { gnss_it++; } else { - if((gnss_signal.compare("1C") == 0) or (gnss_signal.compare("2S") == 0) ) gnss_system = "GPS"; - if((gnss_signal.compare("1B") == 0) or (gnss_signal.compare("5X") == 0) ) gnss_system = "Galileo"; Gnss_Signal signal_value = Gnss_Signal(Gnss_Satellite(gnss_system, gnss_it->get_satellite().get_PRN()), gnss_signal); available_GNSS_signals_.remove(signal_value); available_GNSS_signals_.insert(gnss_it, signal_value); diff --git a/src/core/system_parameters/gnss_signal.h b/src/core/system_parameters/gnss_signal.h index 1bf0c5872..e07d050ca 100644 --- a/src/core/system_parameters/gnss_signal.h +++ b/src/core/system_parameters/gnss_signal.h @@ -49,7 +49,7 @@ public: Gnss_Signal(); Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_); ~Gnss_Signal(); - std::string get_signal() const; //!< Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"} + std::string get_signal() const; //!< Get the satellite signal {"1C" for GPS L1 C/A, "2S" for GPS L2C (M), "1B" for Galileo E1B, "5X" for Galileo E5a} Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal friend bool operator== (const Gnss_Signal &, const Gnss_Signal &); //!< operator== for comparison friend std::ostream& operator<<(std::ostream &, const Gnss_Signal &); //!< operator<< for pretty printing