Sample counter now accepts any data type

This commit is contained in:
Antonio Ramos
2018-04-04 11:16:35 +02:00
parent bc6a568414
commit 46bc52ce9e
4 changed files with 26 additions and 29 deletions
+17 -19
View File
@@ -61,8 +61,6 @@ GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configurati
GNSSFlowgraph::~GNSSFlowgraph() {}
void GNSSFlowgraph::start()
{
if (running_)
@@ -249,25 +247,25 @@ void GNSSFlowgraph::connect()
//connect the signal source to sample counter
//connect the sample counter to Observables
try
{
double fs = static_cast<double>(configuration_->property("GNSS-SDR.internal_fs_sps", 0));
if(fs == 0.0)
{
LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file";
std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl;
throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration"));
double fs = static_cast<double>(configuration_->property("GNSS-SDR.internal_fs_sps", 0));
if (fs == 0.0)
{
LOG(WARNING) << "Set GNSS-SDR.internal_fs_sps in configuration file";
std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl;
throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration"));
}
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0));
top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0);
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
}
catch (const std::exception& e)
{
LOG(WARNING) << "Can't connect sample counter";
LOG(ERROR) << e.what();
top_block_->disconnect_all();
return;
}
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs);
top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0);
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
}
catch (const std::exception & e)
{
LOG(WARNING) << "Can't connect sample counter";
LOG(ERROR) << e.what();
top_block_->disconnect_all();
return;
}
// Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)