1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-20 22:17:03 +00:00

Initializing non-static data members

This commit is contained in:
Carles Fernandez 2015-05-15 19:38:51 +02:00
parent 70c97178fa
commit 23fb47b1d0
16 changed files with 170 additions and 98 deletions

View File

@ -103,10 +103,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition(
} }
else else
{ {
LOG(WARNING) << item_type_ item_size_ = sizeof(gr_complex);
<< " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
} }

View File

@ -111,9 +111,14 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition(
} }
else else
{ {
item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
} }

View File

@ -103,10 +103,14 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition
} }
else else
{ {
LOG(WARNING) << item_type_ item_size_ = sizeof(gr_complex);
<< " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
} }

View File

@ -99,8 +99,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
<< sampled_ms_ << " ms will be used."; << sampled_ms_ << " ms will be used.";
} }
// vector_length_ = (sampled_ms_/folding_factor_) * code_length_; // vector_length_ = (sampled_ms_/folding_factor_) * code_length_;
vector_length_ = sampled_ms_ * samples_per_ms; vector_length_ = sampled_ms_ * samples_per_ms;
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
if (!bit_transition_flag_) if (!bit_transition_flag_)
@ -116,11 +116,11 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
default_dump_filename); default_dump_filename);
code_ = new gr_complex[code_length_]; code_ = new gr_complex[code_length_];
LOG(INFO) <<"Vector Length: "<<vector_length_ LOG(INFO) << "Vector Length: " << vector_length_
<<", Samples per ms: "<<samples_per_ms << ", Samples per ms: " << samples_per_ms
<<", Folding factor: "<<folding_factor_ << ", Folding factor: " << folding_factor_
<<", Sampled ms: "<<sampled_ms_ << ", Sampled ms: " << sampled_ms_
<<", Code Length: "<<code_length_; << ", Code Length: " << code_length_;
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
@ -133,14 +133,19 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui
DLOG(INFO) << "stream_to_vector_quicksync(" DLOG(INFO) << "stream_to_vector_quicksync("
<< stream_to_vector_->unique_id() << ")"; << stream_to_vector_->unique_id() << ")";
DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id() DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id()
<< ")"; << ")";
} }
else else
{ {
LOG(WARNING) << item_type_ item_size_ = sizeof(gr_complex);
<< " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }
@ -313,14 +318,14 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa)
frequency_bins++; frequency_bins++;
} }
DLOG(INFO) <<"Channel "<<channel_<<" Pfa = "<< pfa; DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
unsigned int ncells = code_length_/folding_factor_ * frequency_bins; unsigned int ncells = code_length_ / folding_factor_ * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1.0 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double(code_length_/folding_factor_); double lambda = static_cast<double>(code_length_) / static_cast<double>(folding_factor_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val); float threshold = static_cast<float>(quantile(mydist,val));
return threshold; return threshold;
} }

View File

@ -104,10 +104,15 @@ GalileoE1PcpsTongAmbiguousAcquisition::GalileoE1PcpsTongAmbiguousAcquisition(
} }
else else
{ {
LOG(WARNING) << item_type_ item_size_ = sizeof(gr_complex);
<< " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -111,10 +111,16 @@ GalileoE5aNoncoherentIQAcquisitionCaf::GalileoE5aNoncoherentIQAcquisitionCaf(
} }
else else
{ {
LOG(WARNING) << item_type_ item_size_ = sizeof(gr_complex);
<< " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
bit_transition_flag_ = false;
} }

View File

@ -121,7 +121,8 @@ GpsL1CaPcpsAcquisition::GpsL1CaPcpsAcquisition(
threshold_ = 0.0; threshold_ = 0.0;
doppler_max_ = 0; doppler_max_ = 0;
doppler_step_ = 0; doppler_step_ = 0;
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
channel_internal_queue_ = 0;
} }

View File

@ -75,18 +75,23 @@ GpsL1CaPcpsAcquisitionFineDoppler::GpsL1CaPcpsAcquisitionFineDoppler(
code_= new gr_complex[vector_length_]; code_= new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_,sampled_ms_, acquisition_cc_ = pcps_make_acquisition_fine_doppler_cc(max_dwells_,sampled_ms_,
doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_, doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_,
dump_, dump_filename_); dump_, dump_filename_);
} }
else else
{ {
LOG(WARNING) << item_type_ << " unknown acquisition item type"; item_size_ = sizeof(gr_complex);
} LOG(WARNING) << item_type_ << " unknown acquisition item type";
gnss_synchro_ = new Gnss_Synchro(); }
channel_ = 0;
threshold_ = 0.0;
doppler_step_ = 0;
gnss_synchro_ = 0;
channel_internal_queue_ = 0;
} }

View File

@ -74,18 +74,24 @@ GpsL1CaPcpsAssistedAcquisition::GpsL1CaPcpsAssistedAcquisition(
code_= new gr_complex[vector_length_]; code_= new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_,sampled_ms_, acquisition_cc_ = pcps_make_assisted_acquisition_cc(max_dwells_,sampled_ms_,
doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_, doppler_max_, doppler_min_, if_, fs_in_, vector_length_, queue_,
dump_, dump_filename_); dump_, dump_filename_);
} }
else else
{ {
LOG(WARNING) << item_type_ << " unknown acquisition item type"; item_size_ = sizeof(gr_complex);
} LOG(WARNING) << item_type_ << " unknown acquisition item type";
gnss_synchro_ = new Gnss_Synchro(); }
gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -86,24 +86,30 @@ GpsL1CaPcpsMultithreadAcquisition::GpsL1CaPcpsMultithreadAcquisition(
code_= new gr_complex[vector_length_]; code_= new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_multithread_acquisition_cc(sampled_ms_, max_dwells_, acquisition_cc_ = pcps_make_multithread_acquisition_cc(sampled_ms_, max_dwells_,
shift_resolution_, if_, fs_in_, code_length_, code_length_, shift_resolution_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, queue_, dump_, dump_filename_); bit_transition_flag_, queue_, dump_, dump_filename_);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id()
<< ")"; << ")";
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id()
<< ")"; << ")";
} }
else else
{ {
LOG(WARNING) << item_type_ << " unknown acquisition item type"; item_size_ = sizeof(gr_complex);
} LOG(WARNING) << item_type_ << " unknown acquisition item type";
gnss_synchro_ = new Gnss_Synchro(); }
gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -82,25 +82,31 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition(
vector_length_ = code_length_ * sampled_ms_; vector_length_ = code_length_ * sampled_ms_;
code_= new gr_complex[vector_length_]; code_ = new gr_complex[vector_length_];
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_,
shift_resolution_, if_, fs_in_, code_length_, code_length_, shift_resolution_, if_, fs_in_, code_length_, code_length_,
bit_transition_flag_, queue_, dump_, dump_filename_); bit_transition_flag_, queue_, dump_, dump_filename_);
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_); stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")"; DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")";
} }
else else
{ {
LOG(WARNING) << item_type_ << " unknown acquisition item type"; item_size_ = sizeof(gr_complex);
} LOG(WARNING) << item_type_ << " unknown acquisition item type";
gnss_synchro_ = new Gnss_Synchro(); }
gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -132,10 +132,16 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition(
} }
else else
{ {
item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro(); gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }
@ -295,11 +301,11 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa)
} }
DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa;
unsigned int ncells = (code_length_ / folding_factor_) * frequency_bins; unsigned int ncells = (code_length_ / folding_factor_) * frequency_bins;
double exponent = 1 / static_cast<double>(ncells); double exponent = 1.0 / static_cast<double>(ncells);
double val = pow(1.0 - pfa, exponent); double val = pow(1.0 - pfa, exponent);
double lambda = double((code_length_ / folding_factor_)); double lambda = static_cast<double>(code_length_) / static_cast<double>folding_factor_);
boost::math::exponential_distribution<double> mydist (lambda); boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val); float threshold = static_cast<float>(quantile(mydist,val));
return threshold; return threshold;
} }

View File

@ -93,9 +93,16 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition(
} }
else else
{ {
item_size_ = sizeof(gr_complex);
LOG(WARNING) << item_type_ << " unknown acquisition item type"; LOG(WARNING) << item_type_ << " unknown acquisition item type";
} }
gnss_synchro_ = new Gnss_Synchro();
gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -118,7 +118,13 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition(
// LOG(WARNING) << item_type_ // LOG(WARNING) << item_type_
// << " unknown acquisition item type"; // << " unknown acquisition item type";
// } // }
gnss_synchro_ = new Gnss_Synchro();
gnss_synchro_ = 0;
threshold_ = 0.0;
doppler_max_ = 5000;
doppler_step_ = 250;
channel_internal_queue_ = 0;
channel_ = 0;
} }

View File

@ -58,17 +58,16 @@ class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest: public ::testing::Test
{ {
protected: protected:
GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() GalileoE5aPcpsAcquisitionGSoC2014GensourceTest()
{ {
item_size = sizeof(gr_complex); item_size = sizeof(gr_complex);
stop = false; stop = false;
message = 0; message = 0;
gnss_synchro = Gnss_Synchro(); gnss_synchro = Gnss_Synchro();
init(); init();
} }
~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest()
{ {}
}
void init(); void init();
void config_1(); void config_1();

View File

@ -63,6 +63,7 @@ protected:
stop = false; stop = false;
message = 0; message = 0;
gnss_synchro = Gnss_Synchro(); gnss_synchro = Gnss_Synchro();
init();
} }
~GpsL1CaPcpsAcquisitionGSoC2013Test() ~GpsL1CaPcpsAcquisitionGSoC2013Test()
@ -88,15 +89,15 @@ protected:
int message; int message;
boost::thread ch_thread; boost::thread ch_thread;
unsigned int integration_time_ms; unsigned int integration_time_ms = 0;
unsigned int fs_in; unsigned int fs_in = 0;
double expected_delay_chips; double expected_delay_chips = 0.0;
double expected_doppler_hz; double expected_doppler_hz = 0.0;
float max_doppler_error_hz; float max_doppler_error_hz = 0.0;
float max_delay_error_chips; float max_delay_error_chips = 0.0;
unsigned int num_of_realizations; unsigned int num_of_realizations = 0;
unsigned int realization_counter; unsigned int realization_counter;
unsigned int detection_counter; unsigned int detection_counter;
unsigned int correct_estimation_counter; unsigned int correct_estimation_counter;