mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-06-26 15:12:51 +00:00
Code cleaning
This commit is contained in:
parent
9e1017ed23
commit
2a2740cb01
@ -80,7 +80,9 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
|||||||
|
|
||||||
IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_/2));
|
IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_/2));
|
||||||
|
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// multiple RF channels selected
|
// multiple RF channels selected
|
||||||
for (int i = 0; i < RF_channels_; i++)
|
for (int i = 0; i < RF_channels_; i++)
|
||||||
{
|
{
|
||||||
@ -222,7 +224,6 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
|||||||
DLOG(INFO) << "file_sink(" << file_sink_.at(i)->unique_id() << ")";
|
DLOG(INFO) << "file_sink(" << file_sink_.at(i)->unique_id() << ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -230,12 +231,11 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
|||||||
UhdSignalSource::~UhdSignalSource()
|
UhdSignalSource::~UhdSignalSource()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void UhdSignalSource::connect(gr::top_block_sptr top_block)
|
void UhdSignalSource::connect(gr::top_block_sptr top_block)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < RF_channels_; i++)
|
for (int i = 0; i < RF_channels_; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (samples_.at(i) != 0)
|
if (samples_.at(i) != 0)
|
||||||
{
|
{
|
||||||
top_block->connect(uhd_source_, i, valve_.at(i), 0);
|
top_block->connect(uhd_source_, i, valve_.at(i), 0);
|
||||||
@ -297,6 +297,7 @@ gr::basic_block_sptr UhdSignalSource::get_right_block()
|
|||||||
return get_right_block(0);
|
return get_right_block(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel)
|
gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel)
|
||||||
{
|
{
|
||||||
if (samples_.at(RF_channel) != 0)
|
if (samples_.at(RF_channel) != 0)
|
||||||
|
@ -54,16 +54,13 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configurati
|
|||||||
connected_ = false;
|
connected_ = false;
|
||||||
running_ = false;
|
running_ = false;
|
||||||
configuration_ = configuration;
|
configuration_ = configuration;
|
||||||
//std::shared_ptr<std::vector<std::shared_ptr<GNSSBlockInterface>>> blocks_ = std::make_shared<std::vector<std::shared_ptr<GNSSBlockInterface>>>();
|
|
||||||
queue_ = queue;
|
queue_ = queue;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GNSSFlowgraph::~GNSSFlowgraph()
|
GNSSFlowgraph::~GNSSFlowgraph()
|
||||||
{
|
{}
|
||||||
//blocks_->clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void GNSSFlowgraph::start()
|
void GNSSFlowgraph::start()
|
||||||
{
|
{
|
||||||
@ -87,6 +84,7 @@ void GNSSFlowgraph::start()
|
|||||||
running_ = true;
|
running_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GNSSFlowgraph::stop()
|
void GNSSFlowgraph::stop()
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < channels_count_; i++)
|
for (unsigned int i = 0; i < channels_count_; i++)
|
||||||
@ -129,7 +127,6 @@ void GNSSFlowgraph::connect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Signal Source > Signal conditioner >
|
// Signal Source > Signal conditioner >
|
||||||
|
|
||||||
for (int i = 0; i < sources_count_; i++)
|
for (int i = 0; i < sources_count_; i++)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -149,9 +146,6 @@ void GNSSFlowgraph::connect()
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//auto chan_ = std::move(blocks_->at(i));
|
|
||||||
//std::shared_ptr<ChannelInterface> chan = std::dynamic_pointer_cast<ChannelInterface>(chan_);
|
|
||||||
//channels_.push_back(chan);
|
|
||||||
channels_.at(i)->connect(top_block_);
|
channels_.at(i)->connect(top_block_);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
@ -165,7 +159,6 @@ void GNSSFlowgraph::connect()
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//observables_ = std::move(blocks_->at(2));
|
|
||||||
observables_->connect(top_block_);
|
observables_->connect(top_block_);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
@ -179,7 +172,6 @@ void GNSSFlowgraph::connect()
|
|||||||
// Signal Source > Signal conditioner >> Channels >> Observables > PVT
|
// Signal Source > Signal conditioner >> Channels >> Observables > PVT
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//pvt_ = std::move(blocks_->at(3));
|
|
||||||
pvt_->connect(top_block_);
|
pvt_->connect(top_block_);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
@ -193,7 +185,6 @@ void GNSSFlowgraph::connect()
|
|||||||
// Signal Source > Signal conditioner >> Channels >> Observables > PVT > Output Filter
|
// Signal Source > Signal conditioner >> Channels >> Observables > PVT > Output Filter
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//output_filter_ = std::move(blocks_->at(4));
|
|
||||||
output_filter_->connect(top_block_);
|
output_filter_->connect(top_block_);
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
@ -207,10 +198,8 @@ void GNSSFlowgraph::connect()
|
|||||||
DLOG(INFO) << "blocks connected internally";
|
DLOG(INFO) << "blocks connected internally";
|
||||||
|
|
||||||
// Signal Source (i) > Signal conditioner (i) >
|
// Signal Source (i) > Signal conditioner (i) >
|
||||||
|
|
||||||
for (int i = 0; i < sources_count_; i++)
|
for (int i = 0; i < sources_count_; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//TODO: Remove this array implementation and create generic multistream connector
|
//TODO: Remove this array implementation and create generic multistream connector
|
||||||
@ -300,8 +289,8 @@ void GNSSFlowgraph::connect()
|
|||||||
LOG(INFO) << "Channel " << i
|
LOG(INFO) << "Channel " << i
|
||||||
<< " connected to observables in standby mode";
|
<< " connected to observables in standby mode";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Connect the observables output of each channel to the PVT block
|
* Connect the observables output of each channel to the PVT block
|
||||||
*/
|
*/
|
||||||
@ -465,11 +454,13 @@ void GNSSFlowgraph::init()
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < sources_count_; i++)
|
for (int i = 0; i < sources_count_; i++)
|
||||||
{
|
{
|
||||||
std::cout<<"creating source "<<i<<std::endl;
|
std::cout << "Creating signal source " << i << std::endl;
|
||||||
sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, i));
|
sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, i));
|
||||||
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, i));
|
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, i));
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
//backwards compatibility for old config files
|
//backwards compatibility for old config files
|
||||||
sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, -1));
|
sig_source_.push_back(block_factory_->GetSignalSource(configuration_, queue_, -1));
|
||||||
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, -1));
|
sig_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, -1));
|
||||||
@ -498,6 +489,7 @@ void GNSSFlowgraph::init()
|
|||||||
DLOG(INFO) << "Blocks instantiated. " << channels_count_ << " channels.";
|
DLOG(INFO) << "Blocks instantiated. " << channels_count_ << " channels.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GNSSFlowgraph::set_signals_list()
|
void GNSSFlowgraph::set_signals_list()
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -621,7 +613,6 @@ void GNSSFlowgraph::set_signals_list()
|
|||||||
// {
|
// {
|
||||||
// std::cout << *available_gnss_list_iter << std::endl;
|
// std::cout << *available_gnss_list_iter << std::endl;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,7 +124,6 @@ private:
|
|||||||
std::string config_file_;
|
std::string config_file_;
|
||||||
std::shared_ptr<ConfigurationInterface> configuration_;
|
std::shared_ptr<ConfigurationInterface> configuration_;
|
||||||
std::shared_ptr<GNSSBlockFactory> block_factory_;
|
std::shared_ptr<GNSSBlockFactory> block_factory_;
|
||||||
//std::shared_ptr<std::vector<std::shared_ptr<GNSSBlockInterface>>> blocks_ = std::make_shared<std::vector<std::shared_ptr<GNSSBlockInterface>>>();
|
|
||||||
|
|
||||||
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_;
|
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_source_;
|
||||||
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
|
std::vector<std::shared_ptr<GNSSBlockInterface>> sig_conditioner_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user