mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-12-03 07:08:08 +00:00
Improve const correctness, fix string comparisons
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
#include "channel.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -44,14 +43,14 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel,
|
||||
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
|
||||
std::string role, std::string implementation, gr::msg_queue::sptr queue)
|
||||
{
|
||||
pass_through_ = pass_through;
|
||||
acq_ = acq;
|
||||
trk_ = trk;
|
||||
nav_ = nav;
|
||||
role_ = role;
|
||||
implementation_ = implementation;
|
||||
pass_through_ = std::move(pass_through);
|
||||
acq_ = std::move(acq);
|
||||
trk_ = std::move(trk);
|
||||
nav_ = std::move(nav);
|
||||
role_ = std::move(role);
|
||||
implementation_ = std::move(implementation);
|
||||
channel_ = channel;
|
||||
queue_ = queue;
|
||||
queue_ = std::move(queue);
|
||||
channel_fsm_ = std::make_shared<ChannelFsm>();
|
||||
|
||||
flag_enable_fpga = configuration->property("Channel.enable_FPGA", false);
|
||||
@@ -59,6 +58,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel,
|
||||
trk_->set_channel(channel_);
|
||||
nav_->set_channel(channel_);
|
||||
|
||||
gnss_synchro_ = Gnss_Synchro();
|
||||
gnss_synchro_.Channel_ID = channel_;
|
||||
acq_->set_gnss_synchro(&gnss_synchro_);
|
||||
trk_->set_gnss_synchro(&gnss_synchro_);
|
||||
@@ -76,21 +76,21 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel,
|
||||
|
||||
// IMPORTANT: Do not change the order between set_doppler_step and set_threshold
|
||||
|
||||
uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".doppler_step", 0);
|
||||
uint32_t doppler_step = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".doppler_step", 0);
|
||||
if (doppler_step == 0) doppler_step = configuration->property("Acquisition_" + implementation_ + ".doppler_step", 500);
|
||||
if (FLAGS_doppler_step != 0) doppler_step = static_cast<uint32_t>(FLAGS_doppler_step);
|
||||
DLOG(INFO) << "Channel " << channel_ << " Doppler_step = " << doppler_step;
|
||||
|
||||
acq_->set_doppler_step(doppler_step);
|
||||
|
||||
float threshold = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".threshold", 0.0);
|
||||
float threshold = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".threshold", 0.0);
|
||||
if (threshold == 0.0) threshold = configuration->property("Acquisition_" + implementation_ + ".threshold", 0.0);
|
||||
|
||||
acq_->set_threshold(threshold);
|
||||
|
||||
acq_->init();
|
||||
|
||||
repeat_ = configuration->property("Acquisition_" + implementation_ + boost::lexical_cast<std::string>(channel_) + ".repeat_satellite", false);
|
||||
repeat_ = configuration->property("Acquisition_" + implementation_ + std::to_string(channel_) + ".repeat_satellite", false);
|
||||
DLOG(INFO) << "Channel " << channel_ << " satellite repeat = " << repeat_;
|
||||
|
||||
channel_fsm_->set_acquisition(acq_);
|
||||
@@ -107,7 +107,9 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel,
|
||||
|
||||
|
||||
// Destructor
|
||||
Channel::~Channel() {}
|
||||
Channel::~Channel() = default;
|
||||
|
||||
|
||||
void Channel::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (connected_)
|
||||
|
||||
Reference in New Issue
Block a user