1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-04 13:19:19 +00:00

merging next Merge branch 'next' of https://git.code.sf.net/p/gnss-sdr/cttc into next

This commit is contained in:
Carles Fernandez 2015-02-27 19:21:49 +01:00
commit e4bd312731
7 changed files with 290 additions and 284 deletions

View File

@ -85,9 +85,6 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role,
fir_filter_fff_2_ = gr::filter::fir_filter_fff::make(1, taps_);
DLOG(INFO) << "I input_filter(" << fir_filter_fff_1_->unique_id() << ")";
DLOG(INFO) << "Q input_filter(" << fir_filter_fff_2_->unique_id() << ")";
//float_to_short_1_ = gr::blocks::float_to_short::make();
//float_to_short_2_ = gr::blocks::float_to_short::make();
//short_x2_to_cshort_ = make_short_x2_to_cshort();
float_to_complex_ = gr::blocks::float_to_complex::make();
if (dump_)
{

View File

@ -47,8 +47,18 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro
out_streams_(out_streams)
{
std::string default_item_type = "gr_complex";
item_type_ = configuration->property(role + ".item_type", default_item_type);
std::string input_type = configuration->property(role + ".input_item_type", default_item_type);
std::string output_type = configuration->property(role + ".output_item_type", default_item_type);
if(input_type.compare(output_type) != 0)
{
LOG(WARNING) << "input_item_type and output_item_type are different in a Pass_Through implementation! Taking "
<< input_type
<< ", but item_size will supersede it.";
}
item_type_ = configuration->property(role + ".item_type", input_type);
vector_size_ = configuration->property(role + ".vector_size", 1);
if(item_type_.compare("float") == 0)
{
item_size_ = sizeof(float);
@ -61,6 +71,10 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro
{
item_size_ = sizeof(int16_t);
}
else if(item_type_.compare("ishort") == 0)
{
item_size_ = sizeof(int16_t);
}
else if(item_type_.compare("cshort") == 0)
{
item_size_ = sizeof(lv_16sc_t);
@ -69,6 +83,10 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, std::string ro
{
item_size_ = sizeof(int8_t);
}
else if(item_type_.compare("ibyte") == 0)
{
item_size_ = sizeof(int8_t);
}
else if(item_type_.compare("cbyte") == 0)
{
item_size_ = sizeof(lv_8sc_t);

View File

@ -80,7 +80,9 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
IF_bandwidth_hz_.push_back(configuration->property(role + ".IF_bandwidth_hz", sample_rate_/2));
}else{
}
else
{
// multiple RF channels selected
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() << ")";
}
}
}
@ -230,12 +231,11 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
UhdSignalSource::~UhdSignalSource()
{}
void UhdSignalSource::connect(gr::top_block_sptr top_block)
{
for (int i = 0; i < RF_channels_; i++)
{
if (samples_.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);
}
gr::basic_block_sptr UhdSignalSource::get_right_block(int RF_channel)
{
if (samples_.at(RF_channel) != 0)

View File

@ -54,16 +54,13 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configurati
connected_ = false;
running_ = false;
configuration_ = configuration;
//std::shared_ptr<std::vector<std::shared_ptr<GNSSBlockInterface>>> blocks_ = std::make_shared<std::vector<std::shared_ptr<GNSSBlockInterface>>>();
queue_ = queue;
init();
}
GNSSFlowgraph::~GNSSFlowgraph()
{
//blocks_->clear();
}
{}
void GNSSFlowgraph::start()
{
@ -87,6 +84,7 @@ void GNSSFlowgraph::start()
running_ = true;
}
void GNSSFlowgraph::stop()
{
for (unsigned int i = 0; i < channels_count_; i++)
@ -129,7 +127,6 @@ void GNSSFlowgraph::connect()
}
// Signal Source > Signal conditioner >
for (int i = 0; i < sources_count_; i++)
{
try
@ -149,9 +146,6 @@ void GNSSFlowgraph::connect()
{
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_);
}
catch (std::exception& e)
@ -165,7 +159,6 @@ void GNSSFlowgraph::connect()
try
{
//observables_ = std::move(blocks_->at(2));
observables_->connect(top_block_);
}
catch (std::exception& e)
@ -179,7 +172,6 @@ void GNSSFlowgraph::connect()
// Signal Source > Signal conditioner >> Channels >> Observables > PVT
try
{
//pvt_ = std::move(blocks_->at(3));
pvt_->connect(top_block_);
}
catch (std::exception& e)
@ -193,7 +185,6 @@ void GNSSFlowgraph::connect()
// Signal Source > Signal conditioner >> Channels >> Observables > PVT > Output Filter
try
{
//output_filter_ = std::move(blocks_->at(4));
output_filter_->connect(top_block_);
}
catch (std::exception& e)
@ -207,10 +198,8 @@ void GNSSFlowgraph::connect()
DLOG(INFO) << "blocks connected internally";
// Signal Source (i) > Signal conditioner (i) >
for (int i = 0; i < sources_count_; i++)
{
try
{
//TODO: Remove this array implementation and create generic multistream connector
@ -300,8 +289,8 @@ void GNSSFlowgraph::connect()
LOG(INFO) << "Channel " << i
<< " connected to observables in standby mode";
}
}
/*
* 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++)
{
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_conditioner_.push_back(block_factory_->GetSignalConditioner(configuration_, queue_, i));
}
}else{
}
else
{
//backwards compatibility for old config files
sig_source_.push_back(block_factory_->GetSignalSource(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.";
}
void GNSSFlowgraph::set_signals_list()
{
/*
@ -621,7 +613,6 @@ void GNSSFlowgraph::set_signals_list()
// {
// std::cout << *available_gnss_list_iter << std::endl;
// }
}

View File

@ -124,7 +124,6 @@ private:
std::string config_file_;
std::shared_ptr<ConfigurationInterface> configuration_;
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_conditioner_;