From b7217033397a1c84fc8daf09085b7a756b297745 Mon Sep 17 00:00:00 2001 From: iucgnaw Date: Wed, 10 Mar 2021 20:51:00 +0800 Subject: [PATCH 1/2] Fixed wrong SignalSource.implementation check. --- src/core/receiver/control_thread.cc | 36 ++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index fb62f9d86..19c1348f9 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -92,23 +92,37 @@ ControlThread::ControlThread() const std::string empty_implementation; std::string src_impl = configuration_->property("SignalSource.implementation", empty_implementation); int src_count = configuration_->property("Receiver.sources_count", 1); - if (src_impl.empty() && (src_count != 1)) + if (src_impl.empty()) { - int num_src = 0; - for (int i = 0; i < src_count; i++) + if ((src_count == 1)) { - std::string src_impl_multiple = configuration_->property("SignalSource" + std::to_string(i) + ".implementation", empty_implementation); - if (!src_impl_multiple.empty()) + conf_has_signal_sources_ = false; + } + else + { + int num_src = 0; + for (int i = 0; i < src_count; i++) { - num_src++; + std::string src_impl_multiple = configuration_->property("SignalSource" + std::to_string(i) + ".implementation", empty_implementation); + if (!src_impl_multiple.empty()) + { + num_src++; + } + } + if (num_src == src_count) + { + conf_has_signal_sources_ = true; + } + else + { + conf_has_signal_sources_ = false; } } - if (num_src != src_count) - { - src_impl = std::string(""); - } } - conf_has_signal_sources_ = !src_impl.empty(); + else + { + conf_has_signal_sources_ = true; + } std::string pvt_impl = configuration_->property("PVT.implementation", empty_implementation); conf_has_pvt_ = !pvt_impl.empty(); From 9417e713c3e0e4d7f220db24d5a8ef1860ecff93 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 13 Mar 2021 21:35:55 +0100 Subject: [PATCH 2/2] Replace Receiver.sources_count configuration parameter name by GNSS-SDR.num_sources. The former parameter name is still read to ensure backward compatibility --- conf/gnss-sdr_BDS_B3I_GPS_L1_CA_ibyte.conf | 2 +- ...nss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf | 6 ++-- .../gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf | 2 +- ...nss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf | 4 +-- .../gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf | 2 +- conf/gnss-sdr_multisource_Hybrid_ishort.conf | 2 +- conf/gnss-sdr_multisource_Hybrid_nsr.conf | 2 +- src/core/receiver/control_thread.cc | 31 +++++-------------- src/core/receiver/file_configuration.cc | 3 +- src/core/receiver/gnss_flowgraph.cc | 15 ++++++--- 10 files changed, 30 insertions(+), 39 deletions(-) diff --git a/conf/gnss-sdr_BDS_B3I_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_BDS_B3I_GPS_L1_CA_ibyte.conf index cd9e0c1a3..f6df123ee 100644 --- a/conf/gnss-sdr_BDS_B3I_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_BDS_B3I_GPS_L1_CA_ibyte.conf @@ -12,7 +12,7 @@ ;######### GLOBAL OPTIONS ################## ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. GNSS-SDR.internal_fs_sps=30000000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### CONTROL_THREAD CONFIG ############ ControlThread.wait_for_flowgraph=false diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf index 8ab657656..021b12ae8 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L1_CA_ibyte.conf @@ -7,11 +7,11 @@ ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=6625000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source -SignalSource0.filename=/archive/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource0.filename=../data/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource0.item_type=ibyte SignalSource0.sampling_frequency=6625000 SignalSource0.samples=0 @@ -19,7 +19,7 @@ SignalSource0.dump=false; SignalSource0.dump_filename=/archive/signal_glonass.bin SignalSource1.implementation=File_Signal_Source -SignalSource1.filename=/archive/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE +SignalSource1.filename=../data/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE SignalSource1.item_type=ibyte SignalSource1.sampling_frequency=6625000 SignalSource1.samples=0 diff --git a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf index 0e1f86f56..8d37347c8 100644 --- a/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L1_CA_GPS_L2C_ibyte.conf @@ -7,7 +7,7 @@ ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=6625000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source diff --git a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf index 21e282f52..e4f7a4488 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf @@ -1,4 +1,4 @@ -; This is a GNSS-SDR configuration file +GNSS-SDR.num_sources; This is a GNSS-SDR configuration file ; The configuration API is described at https://gnss-sdr.org/docs/sp-blocks/ ; SPDX-License-Identifier: GPL-3.0-or-later ; SPDX-FileCopyrightText: (C) 2010-2020 (see AUTHORS file for a list of contributors) @@ -7,7 +7,7 @@ ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=6625000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source diff --git a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf index 4ff0a65d2..79585a6ae 100644 --- a/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf +++ b/conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf @@ -7,7 +7,7 @@ ;######### GLOBAL OPTIONS ################## GNSS-SDR.internal_fs_sps=6625000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### SIGNAL_SOURCE CONFIG ############ SignalSource0.implementation=File_Signal_Source diff --git a/conf/gnss-sdr_multisource_Hybrid_ishort.conf b/conf/gnss-sdr_multisource_Hybrid_ishort.conf index 1de85f0a6..5838a3b88 100644 --- a/conf/gnss-sdr_multisource_Hybrid_ishort.conf +++ b/conf/gnss-sdr_multisource_Hybrid_ishort.conf @@ -13,7 +13,7 @@ ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. GNSS-SDR.internal_fs_sps=4000000 -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 SignalSource.enable_throttle_control=false SignalSource.repeat=false diff --git a/conf/gnss-sdr_multisource_Hybrid_nsr.conf b/conf/gnss-sdr_multisource_Hybrid_nsr.conf index 44bc9d716..c5c5e9134 100644 --- a/conf/gnss-sdr_multisource_Hybrid_nsr.conf +++ b/conf/gnss-sdr_multisource_Hybrid_nsr.conf @@ -9,7 +9,7 @@ [GNSS-SDR] -Receiver.sources_count=2 +GNSS-SDR.num_sources=2 ;######### GLOBAL OPTIONS ################## ;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [samples per second]. diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index 19c1348f9..59baf3475 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -91,33 +91,18 @@ ControlThread::ControlThread() const std::string empty_implementation; std::string src_impl = configuration_->property("SignalSource.implementation", empty_implementation); - int src_count = configuration_->property("Receiver.sources_count", 1); + int src_count_deprecated = configuration_->property("Receiver.sources_count", 1); + int src_count = configuration_->property("GNSS-SDR.num_sources", src_count_deprecated); if (src_impl.empty()) { - if ((src_count == 1)) + src_impl = std::string(""); + int num_src = 0; + for (auto i = 0; i < src_count; i++) { - conf_has_signal_sources_ = false; - } - else - { - int num_src = 0; - for (int i = 0; i < src_count; i++) - { - std::string src_impl_multiple = configuration_->property("SignalSource" + std::to_string(i) + ".implementation", empty_implementation); - if (!src_impl_multiple.empty()) - { - num_src++; - } - } - if (num_src == src_count) - { - conf_has_signal_sources_ = true; - } - else - { - conf_has_signal_sources_ = false; - } + auto src_impl_multiple = configuration_->property("SignalSource" + std::to_string(i) + ".implementation", empty_implementation); + num_src += !src_impl_multiple.empty(); } + conf_has_signal_sources_ = (num_src == src_count); } else { diff --git a/src/core/receiver/file_configuration.cc b/src/core/receiver/file_configuration.cc index 53700a21c..9828a332d 100644 --- a/src/core/receiver/file_configuration.cc +++ b/src/core/receiver/file_configuration.cc @@ -22,6 +22,7 @@ #include "file_configuration.h" #include "gnss_sdr_make_unique.h" #include +#include #include @@ -55,7 +56,7 @@ void FileConfiguration::init() } else { - LOG(WARNING) << "Unable to open configuration file " << filename_; + std::cerr << "Unable to open configuration file " << filename_ << '\n'; } } diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index 516d65b5d..fdb2d43a1 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -100,7 +100,8 @@ void GNSSFlowgraph::init() channels_status_ = channel_status_msg_receiver_make(); // 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 sources_count_deprecated = configuration_->property("Receiver.sources_count", 1); + sources_count_ = configuration_->property("GNSS-SDR.num_sources", sources_count_deprecated); int signal_conditioner_ID = 0; @@ -112,7 +113,10 @@ void GNSSFlowgraph::init() { auto& src = sig_source_.back(); auto RF_Channels = src->getRfChannels(); - std::cout << "RF Channels: " << RF_Channels << '\n'; + if (sources_count_ == 1) + { + std::cout << "RF Channels: " << RF_Channels << '\n'; + } for (auto j = 0U; j < RF_Channels; ++j) { sig_conditioner_.push_back(block_factory->GetSignalConditioner(configuration_.get(), signal_conditioner_ID)); @@ -120,6 +124,10 @@ void GNSSFlowgraph::init() } } } + if (sources_count_ != 1 && !enable_fpga_offloading_) + { + std::cout << "RF Channels: " << sources_count_ << '\n'; + } if (!sig_conditioner_.empty()) { signal_conditioner_connected_ = std::vector(sig_conditioner_.size(), false); @@ -522,7 +530,6 @@ int GNSSFlowgraph::disconnect_desktop_flowgraph() int GNSSFlowgraph::connect_fpga_flowgraph() { // Check that the Signal Source has been instantiated successfully - for (auto& src : sig_source_) { if (src == nullptr) @@ -541,7 +548,6 @@ int GNSSFlowgraph::connect_fpga_flowgraph() } // Connect blocks to the top_block - if (connect_channels() != 0) { return 1; @@ -560,7 +566,6 @@ int GNSSFlowgraph::connect_fpga_flowgraph() DLOG(INFO) << "Blocks connected internally to the top_block"; // Connect the counter - if (connect_fpga_sample_counter() != 0) { return 1;