From 6d39e31a67c68abec76beb8a05fe3bbbdb15e2f6 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Thu, 12 Jul 2018 20:01:18 +0200 Subject: [PATCH] Fix bug that was causing runtime breaks --- src/core/receiver/gnss_flowgraph.cc | 43 ++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 1f72636f6..cb9f4c937 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -416,7 +416,11 @@ void GNSSFlowgraph::connect() { LOG(WARNING) << e.what(); } - if (sat != 0) + if (sat == 0) + { + channels_.at(i)->set_signal(search_next_signal(gnss_signal, false)); + } + else { std::string gnss_system; Gnss_Signal signal_value; @@ -892,6 +896,43 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what) case 1: LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_[who]->get_signal().get_satellite(); + + // If the satellite is in the list of available ones, remove it. + switch (mapStringValues_[channels_[who]->get_signal().get_signal_str()]) + { + case evGPS_1C: + available_GPS_1C_signals_.remove(channels_[who]->get_signal()); + break; + + case evGPS_2S: + available_GPS_2S_signals_.remove(channels_[who]->get_signal()); + break; + + case evGPS_L5: + available_GPS_L5_signals_.remove(channels_[who]->get_signal()); + break; + + case evGAL_1B: + available_GAL_1B_signals_.remove(channels_[who]->get_signal()); + break; + + case evGAL_5X: + available_GAL_5X_signals_.remove(channels_[who]->get_signal()); + break; + + case evGLO_1G: + available_GLO_1G_signals_.remove(channels_[who]->get_signal()); + break; + + case evGLO_2G: + available_GLO_2G_signals_.remove(channels_[who]->get_signal()); + break; + + default: + LOG(ERROR) << "This should not happen :-("; + break; + } + channels_state_[who] = 2; acq_channels_count_--; for (unsigned int i = 0; i < channels_count_; i++)