mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-11 21:03:07 +00:00
Code cleaning
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@278 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -51,18 +51,16 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
GNSSBlockInterface *pass_through, AcquisitionInterface *acq,
|
||||
TrackingInterface *trk, 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), channel_(channel),
|
||||
queue_(queue)
|
||||
|
||||
pass_through_(pass_through), acq_(acq), trk_(trk), nav_(nav),
|
||||
role_(role), implementation_(implementation), channel_(channel),
|
||||
queue_(queue)
|
||||
{
|
||||
stop_ = false;
|
||||
acq_->set_channel(channel_);
|
||||
trk_->set_channel(channel_);
|
||||
nav_->set_channel(channel_);
|
||||
|
||||
gnss_synchro_.Channel_ID=channel_;
|
||||
|
||||
gnss_synchro_.Channel_ID = channel_;
|
||||
acq_->set_gnss_synchro(&gnss_synchro_);
|
||||
trk_->set_gnss_synchro(&gnss_synchro_);
|
||||
|
||||
@@ -108,32 +106,27 @@ Channel::~Channel()
|
||||
|
||||
void Channel::connect(gr_top_block_sptr top_block)
|
||||
{
|
||||
|
||||
if (connected_)
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "channel already connected internally";
|
||||
return;
|
||||
}
|
||||
|
||||
pass_through_->connect(top_block);
|
||||
acq_->connect(top_block);
|
||||
trk_->connect(top_block);
|
||||
nav_->connect(top_block);
|
||||
|
||||
top_block->connect(pass_through_->get_right_block(), 0,
|
||||
acq_->get_left_block(), 0);
|
||||
top_block->connect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
|
||||
DLOG(INFO) << "pass_through_ -> acquisition";
|
||||
|
||||
top_block->connect(pass_through_->get_right_block(), 0,
|
||||
trk_->get_left_block(), 0);
|
||||
top_block->connect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
|
||||
DLOG(INFO) << "pass_through_ -> tracking";
|
||||
top_block->connect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
|
||||
DLOG(INFO) << "tracking -> telemetry_decoder";
|
||||
|
||||
connected_ = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Channel::disconnect(gr_top_block_sptr top_block)
|
||||
{
|
||||
if (!connected_)
|
||||
@@ -141,18 +134,13 @@ void Channel::disconnect(gr_top_block_sptr top_block)
|
||||
LOG_AT_LEVEL(WARNING) << "Channel already disconnected internally";
|
||||
return;
|
||||
}
|
||||
|
||||
top_block->disconnect(pass_through_->get_right_block(), 0,
|
||||
acq_->get_left_block(), 0);
|
||||
top_block->disconnect(pass_through_->get_right_block(), 0,
|
||||
trk_->get_left_block(), 0);
|
||||
top_block->disconnect(pass_through_->get_right_block(), 0, acq_->get_left_block(), 0);
|
||||
top_block->disconnect(pass_through_->get_right_block(), 0, trk_->get_left_block(), 0);
|
||||
top_block->disconnect(trk_->get_right_block(), 0, nav_->get_left_block(), 0);
|
||||
|
||||
pass_through_->disconnect(top_block);
|
||||
acq_->disconnect(top_block);
|
||||
trk_->disconnect(top_block);
|
||||
nav_->disconnect(top_block);
|
||||
|
||||
connected_ = false;
|
||||
}
|
||||
|
||||
@@ -205,12 +193,17 @@ void Channel::run()
|
||||
channel_internal_queue_.wait_and_pop(message_);
|
||||
process_channel_messages();
|
||||
}
|
||||
|
||||
}
|
||||
void Channel::standby(){
|
||||
|
||||
|
||||
|
||||
void Channel::standby()
|
||||
{
|
||||
channel_fsm_.Event_gps_failed_tracking_standby();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Set stop_ to true and blocks the calling thread until
|
||||
* the thread of the constructor has completed
|
||||
@@ -218,8 +211,7 @@ void Channel::standby(){
|
||||
void Channel::stop()
|
||||
{
|
||||
channel_internal_queue_.push(0); //message to stop channel
|
||||
stop_ = true;
|
||||
|
||||
stop_ = true;
|
||||
/* When the boost::thread object that represents a thread of execution
|
||||
* is destroyed the thread becomes detached. Once a thread is detached,
|
||||
* it will continue executing until the invocation of the function or
|
||||
@@ -234,26 +226,23 @@ void Channel::stop()
|
||||
ch_thread_.join();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Channel::process_channel_messages()
|
||||
{
|
||||
switch (message_)
|
||||
{
|
||||
case 0:
|
||||
|
||||
DLOG(INFO) << "Stop channel " << channel_;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_
|
||||
<< " ACQ SUCCESS satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
|
||||
DLOG(INFO) << "Channel " << channel_ << " ACQ SUCCESS satellite " <<
|
||||
gnss_synchro_.System << " " << gnss_synchro_.PRN;
|
||||
channel_fsm_.Event_gps_valid_acquisition();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_
|
||||
<< " ACQ FAILED satellite " << gnss_synchro_.System << " "<< gnss_synchro_.PRN;
|
||||
DLOG(INFO) << "Channel " << channel_
|
||||
<< " ACQ FAILED satellite " << gnss_synchro_.System << " " << gnss_synchro_.PRN;
|
||||
if (repeat_ == true)
|
||||
{
|
||||
channel_fsm_.Event_gps_failed_acquisition_repeat();
|
||||
@@ -263,9 +252,6 @@ void Channel::process_channel_messages()
|
||||
channel_fsm_.Event_gps_failed_acquisition_no_repeat();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
LOG_AT_LEVEL(WARNING) << "Default case, invalid message.";
|
||||
break;
|
||||
|
||||
@@ -40,25 +40,22 @@
|
||||
#include <gnuradio/gr_io_signature.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include "gnss_synchro.h"
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
|
||||
gps_l1_ca_observables_cc_sptr
|
||||
gps_l1_ca_make_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging)
|
||||
{
|
||||
|
||||
return gps_l1_ca_observables_cc_sptr(new gps_l1_ca_observables_cc(nchannels, queue, dump, dump_filename, output_rate_ms, flag_averaging));
|
||||
}
|
||||
|
||||
|
||||
gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, gr_msg_queue_sptr queue, bool dump, std::string dump_filename, int output_rate_ms, bool flag_averaging) :
|
||||
gr_block ("gps_l1_ca_observables_cc", gr_make_io_signature (nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr_make_io_signature(nchannels, nchannels, sizeof(Gnss_Synchro)))
|
||||
gr_block ("gps_l1_ca_observables_cc", gr_make_io_signature (nchannels, nchannels, sizeof(Gnss_Synchro)),
|
||||
gr_make_io_signature(nchannels, nchannels, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
// initialize internal vars
|
||||
d_queue = queue;
|
||||
@@ -80,13 +77,16 @@ gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, gr_ms
|
||||
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
|
||||
std::cout << "Observables dump enabled Log file: " << d_dump_filename.c_str() << std::endl;
|
||||
}
|
||||
catch (std::ifstream::failure e) {
|
||||
catch (std::ifstream::failure e)
|
||||
{
|
||||
std::cout << "Exception opening observables dump file " << e.what() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
gps_l1_ca_observables_cc::~gps_l1_ca_observables_cc()
|
||||
{
|
||||
d_dump_file.close();
|
||||
@@ -94,28 +94,35 @@ gps_l1_ca_observables_cc::~gps_l1_ca_observables_cc()
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool pairCompare_gnss_synchro_Prn_delay_ms( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
|
||||
{
|
||||
return (a.second.Prn_timestamp_ms) < (b.second.Prn_timestamp_ms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool pairCompare_gnss_synchro_preamble_symbol_count( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
|
||||
{
|
||||
return (a.second.Preamble_symbol_counter) < (b.second.Preamble_symbol_counter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool pairCompare_gnss_synchro_preamble_delay_ms( std::pair<int,Gnss_Synchro> a, std::pair<int,Gnss_Synchro> b)
|
||||
{
|
||||
return (a.second.Preamble_timestamp_ms) < (b.second.Preamble_timestamp_ms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool pairCompare_double( std::pair<int,double> a, std::pair<int,double> b)
|
||||
{
|
||||
return (a.second) < (b.second);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void clearQueue( std::deque<double> &q )
|
||||
{
|
||||
std::deque<double> empty;
|
||||
@@ -123,27 +130,21 @@ void clearQueue( std::deque<double> &q )
|
||||
}
|
||||
|
||||
|
||||
int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) {
|
||||
|
||||
int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
Gnss_Synchro **in = (Gnss_Synchro **) &input_items[0]; //Get the input pointer
|
||||
Gnss_Synchro **out = (Gnss_Synchro **) &output_items[0]; //Get the output pointer
|
||||
|
||||
Gnss_Synchro current_gnss_synchro[d_nchannels];
|
||||
|
||||
// Gnss_Synchro current_gnss_synchro[cd_channels];
|
||||
|
||||
// Gnss_Synchro current_gnss_synchro[cd_channels];
|
||||
std::map<int,Gnss_Synchro> current_gnss_synchro_map;
|
||||
std::map<int,Gnss_Synchro> gnss_synchro_aligned_map;
|
||||
|
||||
std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
|
||||
|
||||
|
||||
double traveltime_ms;
|
||||
double pseudorange_m;
|
||||
|
||||
d_sample_counter++; //count for the processed samples
|
||||
|
||||
bool flag_history_ok = true; //flag to indicate that all the queues have filled their GNSS SYNCHRO history
|
||||
/*
|
||||
* 1. Read the GNSS SYNCHRO objects from available channels
|
||||
@@ -151,14 +152,13 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
for (unsigned int i=0; i<d_nchannels ; i++)
|
||||
{
|
||||
//Copy the telemetry decoder data to local copy
|
||||
current_gnss_synchro[i]=in[i][0];
|
||||
|
||||
current_gnss_synchro[i] = in[i][0];
|
||||
if (current_gnss_synchro[i].Flag_valid_word) //if this channel have valid word
|
||||
{
|
||||
//record the word structure in a map for pseudoranges
|
||||
current_gnss_synchro_map.insert(std::pair<int,Gnss_Synchro>(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i]));
|
||||
current_gnss_synchro_map.insert(std::pair<int, Gnss_Synchro>(current_gnss_synchro[i].Channel_ID, current_gnss_synchro[i]));
|
||||
// RECORD PRN start timestamps history
|
||||
if (d_history_gnss_synchro_deque[i].size()<MAX_TOA_DELAY_MS)
|
||||
if (d_history_gnss_synchro_deque[i].size() < MAX_TOA_DELAY_MS)
|
||||
{
|
||||
d_history_gnss_synchro_deque[i].push_front(current_gnss_synchro[i]);
|
||||
flag_history_ok = false; // at least one channel need more samples
|
||||
@@ -177,24 +177,22 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
*/
|
||||
for (unsigned int i=0; i<d_nchannels ; i++)
|
||||
{
|
||||
current_gnss_synchro[i].Flag_valid_pseudorange = false;
|
||||
current_gnss_synchro[i].Pseudorange_m = 0.0;
|
||||
current_gnss_synchro[i].Pseudorange_symbol_shift = 0.0;
|
||||
current_gnss_synchro[i].Flag_valid_pseudorange = false;
|
||||
current_gnss_synchro[i].Pseudorange_m = 0.0;
|
||||
current_gnss_synchro[i].Pseudorange_symbol_shift = 0.0;
|
||||
}
|
||||
/*
|
||||
* 2. Compute RAW pseudorranges: Use only the valid channels (channels that are tracking a satellite)
|
||||
*/
|
||||
if(current_gnss_synchro_map.size() > 0 and flag_history_ok == true)
|
||||
{
|
||||
|
||||
/*
|
||||
* 2.1 Find the correct symbol timestamp in the gnss_synchro history: we have to compare timestamps between channels on the SAME symbol
|
||||
* (common TX time algorithm)
|
||||
*/
|
||||
|
||||
double min_preamble_delay_ms;
|
||||
double max_preamble_delay_ms;
|
||||
int current_symbol=0;
|
||||
int current_symbol = 0;
|
||||
int reference_channel;
|
||||
int history_shift;
|
||||
Gnss_Synchro tmp_gnss_synchro;
|
||||
@@ -205,25 +203,24 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
gnss_synchro_iter = max_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_delay_ms);
|
||||
max_preamble_delay_ms = gnss_synchro_iter->second.Preamble_timestamp_ms; //[ms]
|
||||
|
||||
if ((max_preamble_delay_ms-min_preamble_delay_ms)< MAX_TOA_DELAY_MS)
|
||||
if ((max_preamble_delay_ms - min_preamble_delay_ms) < MAX_TOA_DELAY_MS)
|
||||
{
|
||||
// we have a valid information set. Its time to align the symbols information
|
||||
// what is the most delayed symbol in the current set? -> this will be the reference symbol
|
||||
gnss_synchro_iter=min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_symbol_count);
|
||||
current_symbol=gnss_synchro_iter->second.Preamble_symbol_counter;
|
||||
reference_channel=gnss_synchro_iter->second.Channel_ID;
|
||||
gnss_synchro_iter = min_element(current_gnss_synchro_map.begin(), current_gnss_synchro_map.end(), pairCompare_gnss_synchro_preamble_symbol_count);
|
||||
current_symbol = gnss_synchro_iter->second.Preamble_symbol_counter;
|
||||
reference_channel = gnss_synchro_iter->second.Channel_ID;
|
||||
// save it in the aligned symbols map
|
||||
gnss_synchro_aligned_map.insert(std::pair<int,Gnss_Synchro>(gnss_synchro_iter->second.Channel_ID, gnss_synchro_iter->second));
|
||||
|
||||
// Now find where the same symbols were in the rest of the channels searching in the symbol history
|
||||
for(gnss_synchro_iter = current_gnss_synchro_map.begin(); gnss_synchro_iter != current_gnss_synchro_map.end(); gnss_synchro_iter++)
|
||||
{
|
||||
//TODO: Replace the loop using current current_symbol-Preamble_symbol_counter
|
||||
if (reference_channel!=gnss_synchro_iter->second.Channel_ID)
|
||||
if (reference_channel != gnss_synchro_iter->second.Channel_ID)
|
||||
{
|
||||
// compute the required symbol history shift in order to match the reference symbol
|
||||
history_shift=gnss_synchro_iter->second.Preamble_symbol_counter-current_symbol;
|
||||
if (history_shift<(int)MAX_TOA_DELAY_MS)// and history_shift>=0)
|
||||
history_shift = gnss_synchro_iter->second.Preamble_symbol_counter-current_symbol;
|
||||
if (history_shift < (int)MAX_TOA_DELAY_MS ) // and history_shift>=0)
|
||||
{
|
||||
tmp_gnss_synchro= d_history_gnss_synchro_deque[gnss_synchro_iter->second.Channel_ID][history_shift];
|
||||
gnss_synchro_aligned_map.insert(std::pair<int,Gnss_Synchro>(gnss_synchro_iter->second.Channel_ID,tmp_gnss_synchro));
|
||||
@@ -243,7 +240,6 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
gnss_synchro_iter = max_element(gnss_synchro_aligned_map.begin(), gnss_synchro_aligned_map.end(), pairCompare_gnss_synchro_Prn_delay_ms);
|
||||
max_symbol_timestamp_ms = gnss_synchro_iter->second.Prn_timestamp_ms; //[ms]
|
||||
|
||||
|
||||
// check again if this is a valid set of observations
|
||||
if ((max_symbol_timestamp_ms - min_symbol_timestamp_ms) < MAX_TOA_DELAY_MS)
|
||||
/*
|
||||
@@ -253,18 +249,17 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
for(gnss_synchro_iter = gnss_synchro_aligned_map.begin(); gnss_synchro_iter != gnss_synchro_aligned_map.end(); gnss_synchro_iter++)
|
||||
{
|
||||
traveltime_ms = gnss_synchro_iter->second.Prn_timestamp_ms - min_symbol_timestamp_ms + GPS_STARTOFFSET_ms; //[ms]
|
||||
pseudorange_m = traveltime_ms*GPS_C_m_ms; // [m]
|
||||
pseudorange_m = traveltime_ms * GPS_C_m_ms; // [m]
|
||||
// update the pseudorange object
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID]=gnss_synchro_iter->second;
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID] = gnss_synchro_iter->second;
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_m = pseudorange_m;
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_symbol_shift = (double)current_symbol; // number of symbols shifted from preamble start symbol
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Flag_valid_pseudorange = true;
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_timestamp_ms=max_symbol_timestamp_ms;
|
||||
current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Pseudorange_timestamp_ms = max_symbol_timestamp_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
@@ -295,11 +290,11 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
|
||||
// mod 8/4/2012: always make the observables output
|
||||
//if ((d_sample_counter % d_output_rate_ms) == 0)
|
||||
// {
|
||||
for (unsigned int i=0; i<d_nchannels ; i++)
|
||||
{
|
||||
*out[i] = current_gnss_synchro[i];
|
||||
}
|
||||
return 1; //Output the observables
|
||||
for (unsigned int i=0; i<d_nchannels ; i++)
|
||||
{
|
||||
*out[i] = current_gnss_synchro[i];
|
||||
}
|
||||
return 1; //Output the observables
|
||||
// }
|
||||
//else
|
||||
// {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -45,13 +45,10 @@ FileOutputFilter::FileOutputFilter(ConfigurationInterface* configuration,
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
|
||||
std::string default_filename = "./output.dat";
|
||||
std::string default_item_type = "short";
|
||||
|
||||
filename_ = configuration->property(role + ".filename", default_filename);
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
||||
if(item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
@@ -69,30 +66,37 @@ FileOutputFilter::FileOutputFilter(ConfigurationInterface* configuration,
|
||||
LOG_AT_LEVEL(WARNING) << item_type_ << " Unrecognized item type. Using short.";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
|
||||
file_sink_ = gr_make_file_sink(item_size_, filename_.c_str());
|
||||
|
||||
DLOG(INFO) << "file sink(" << file_sink_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
|
||||
FileOutputFilter::~FileOutputFilter()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
void FileOutputFilter::connect(gr_top_block_sptr top_block)
|
||||
{
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void FileOutputFilter::disconnect(gr_top_block_sptr top_block)
|
||||
{
|
||||
// Nothing to disconnect internally
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr FileOutputFilter::get_left_block()
|
||||
{
|
||||
return file_sink_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr FileOutputFilter::get_right_block()
|
||||
{
|
||||
return file_sink_;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2011 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@@ -29,8 +29,6 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "null_sink_output_filter.h"
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
@@ -47,10 +45,8 @@ NullSinkOutputFilter::NullSinkOutputFilter(ConfigurationInterface* configuration
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
|
||||
std::string default_item_type = "short";
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
||||
if(item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
@@ -65,32 +61,41 @@ NullSinkOutputFilter::NullSinkOutputFilter(ConfigurationInterface* configuration
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_ << " unrecognized item type. Usign float";
|
||||
LOG_AT_LEVEL(WARNING) << item_type_ << " unrecognized item type. Using float";
|
||||
item_size_ = sizeof(float);
|
||||
}
|
||||
|
||||
sink_ = gr_make_null_sink(item_size_);
|
||||
DLOG(INFO) << "null_sink(" << sink_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
|
||||
NullSinkOutputFilter::~NullSinkOutputFilter()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
void NullSinkOutputFilter::connect(gr_top_block_sptr top_block)
|
||||
{
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
|
||||
void NullSinkOutputFilter::disconnect(gr_top_block_sptr top_block)
|
||||
{
|
||||
// Nothing to connect
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr NullSinkOutputFilter::get_left_block()
|
||||
{
|
||||
return sink_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr NullSinkOutputFilter::get_right_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Right block of a signal sink should not be retrieved";
|
||||
|
||||
Reference in New Issue
Block a user