Replace Receiver.sources_count configuration parameter name by GNSS-SDR.num_sources. The former parameter name is still read to ensure backward compatibility

This commit is contained in:
Carles Fernandez 2021-03-13 21:35:55 +01:00
parent 99818fdcc2
commit 9417e713c3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
10 changed files with 30 additions and 39 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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].

View File

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

View File

@ -22,6 +22,7 @@
#include "file_configuration.h"
#include "gnss_sdr_make_unique.h"
#include <glog/logging.h>
#include <iostream>
#include <utility>
@ -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';
}
}

View File

@ -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<bool>(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;