From c63c85ff36f33c997161b430c351d237e1bb3458 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 4 Oct 2019 09:17:29 +0200 Subject: [PATCH] Set assist_dual_frequency_acq to true by default only for multiple-band receivers Fixes configurations which do not contain signals in L1 --- src/core/receiver/gnss_flowgraph.cc | 44 +++++++++++++++++++++++++++-- src/core/receiver/gnss_flowgraph.h | 2 ++ 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 46ac6f046..2f670e831 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -80,6 +80,7 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr configurati running_ = false; configuration_ = std::move(configuration); queue_ = queue; + multiband_ = GNSSFlowgraph::is_multiband(); init(); } @@ -1218,7 +1219,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who) estimated_doppler, RX_time); channels_[current_channel]->set_signal(gnss_signal); - start_acquisition = is_primary_freq or assistance_available or !configuration_->property("GNSS-SDR.assist_dual_frequency_acq", true); + start_acquisition = is_primary_freq or assistance_available or !configuration_->property("GNSS-SDR.assist_dual_frequency_acq", multiband_); } else { @@ -1233,7 +1234,7 @@ void GNSSFlowgraph::acquisition_manager(unsigned int who) DLOG(INFO) << "Channel " << current_channel << " Starting acquisition " << channels_[current_channel]->get_signal().get_satellite() << ", Signal " << channels_[current_channel]->get_signal().get_signal_str(); - if (assistance_available == true and configuration_->property("GNSS-SDR.assist_dual_frequency_acq", true)) + if (assistance_available == true and configuration_->property("GNSS-SDR.assist_dual_frequency_acq", multiband_)) { channels_[current_channel]->assist_acquisition_doppler(project_doppler(channels_[current_channel]->get_signal().get_signal_str(), estimated_doppler)); } @@ -1891,6 +1892,45 @@ void GNSSFlowgraph::set_channels_state() } +bool GNSSFlowgraph::is_multiband() const +{ + bool multiband = false; + if (configuration_->property("Channels_1C.count", 0) > 0) + { + if (configuration_->property("Channels_2S.count", 0) > 0) + { + multiband = true; + } + if (configuration_->property("Channels_L5.count", 0) > 0) + { + multiband = true; + } + } + if (configuration_->property("Channels_1B.count", 0) > 0) + { + if (configuration_->property("Channels_5X.count", 0) > 0) + { + multiband = true; + } + } + if (configuration_->property("Channels_1G.count", 0) > 0) + { + if (configuration_->property("Channels_2G.count", 0) > 0) + { + multiband = true; + } + } + if (configuration_->property("Channels_B1.count", 0) > 0) + { + if (configuration_->property("Channels_B3.count", 0) > 0) + { + multiband = true; + } + } + return multiband; +} + + Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal, const bool pop, bool& is_primary_frequency, diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 0d69e1d83..da8c98f9e 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -182,8 +182,10 @@ private: void remove_signal(const Gnss_Signal& gs); double project_doppler(const std::string& searched_signal, double primary_freq_doppler_hz); + bool is_multiband() const; bool connected_; bool running_; + bool multiband_; int sources_count_; unsigned int channels_count_;