From 23fb47b1d07c90e0e79a91d21ee2bdf437414514 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 15 May 2015 19:38:51 +0200 Subject: [PATCH] Initializing non-static data members --- ...lileo_e1_pcps_8ms_ambiguous_acquisition.cc | 10 +++-- .../galileo_e1_pcps_ambiguous_acquisition.cc | 7 +++- ...eo_e1_pcps_cccwsr_ambiguous_acquisition.cc | 10 +++-- ...e1_pcps_quicksync_ambiguous_acquisition.cc | 41 +++++++++++-------- ...ileo_e1_pcps_tong_ambiguous_acquisition.cc | 11 +++-- ...ileo_e5a_noncoherent_iq_acquisition_caf.cc | 12 ++++-- .../adapters/gps_l1_ca_pcps_acquisition.cc | 3 +- ...gps_l1_ca_pcps_acquisition_fine_doppler.cc | 25 ++++++----- .../gps_l1_ca_pcps_assisted_acquisition.cc | 26 +++++++----- .../gps_l1_ca_pcps_multithread_acquisition.cc | 36 +++++++++------- .../gps_l1_ca_pcps_opencl_acquisition.cc | 34 ++++++++------- .../gps_l1_ca_pcps_quicksync_acquisition.cc | 14 +++++-- .../gps_l1_ca_pcps_tong_acquisition.cc | 9 +++- .../adapters/gps_l2_m_pcps_acquisition.cc | 8 +++- ...cps_acquisition_gsoc2014_gensource_test.cc | 7 ++-- ...ps_l1_ca_pcps_acquisition_gsoc2013_test.cc | 15 +++---- 16 files changed, 170 insertions(+), 98 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc index 9c44f2daa..04315b7ca 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_8ms_ambiguous_acquisition.cc @@ -103,10 +103,14 @@ GalileoE1Pcps8msAmbiguousAcquisition::GalileoE1Pcps8msAmbiguousAcquisition( } 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; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc index 9aedcac8c..56e591094 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition.cc @@ -111,9 +111,14 @@ GalileoE1PcpsAmbiguousAcquisition::GalileoE1PcpsAmbiguousAcquisition( } else { + 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; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc index a565a3cc2..ec3e03f3d 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_cccwsr_ambiguous_acquisition.cc @@ -103,10 +103,14 @@ GalileoE1PcpsCccwsrAmbiguousAcquisition::GalileoE1PcpsCccwsrAmbiguousAcquisition } 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; } diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc index eec0c0315..cb185baec 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_quicksync_ambiguous_acquisition.cc @@ -76,10 +76,10 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui lues different that the expressed in the paper. In adition, it is important to point out that by making the folding factor smaller we were able to get QuickSync work with Galileo. Future work should be directed to test this asumption statistically.*/ - + //folding_factor_ = (unsigned int)ceil(sqrt(log2(code_length_))); folding_factor_ = configuration_->property(role + ".folding_factor", 2); - + if (sampled_ms_ % (folding_factor_*4) != 0) { LOG(WARNING) << "QuickSync Algorithm requires a coherent_integration_time" @@ -99,8 +99,8 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui << sampled_ms_ << " ms will be used."; } - // vector_length_ = (sampled_ms_/folding_factor_) * code_length_; - vector_length_ = sampled_ms_ * samples_per_ms; + // vector_length_ = (sampled_ms_/folding_factor_) * code_length_; + vector_length_ = sampled_ms_ * samples_per_ms; bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false); if (!bit_transition_flag_) @@ -116,11 +116,11 @@ GalileoE1PcpsQuickSyncAmbiguousAcquisition::GalileoE1PcpsQuickSyncAmbiguousAcqui default_dump_filename); code_ = new gr_complex[code_length_]; - LOG(INFO) <<"Vector Length: "<unique_id() << ")"; DLOG(INFO) << "acquisition_quicksync(" << acquisition_cc_->unique_id() - << ")"; + << ")"; } 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; } @@ -313,14 +318,14 @@ float GalileoE1PcpsQuickSyncAmbiguousAcquisition::calculate_threshold(float pfa) frequency_bins++; } - DLOG(INFO) <<"Channel "<unique_id() - << ")"; - DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() - << ")"; - } + DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() + << ")"; + DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() + << ")"; + } else - { - LOG(WARNING) << item_type_ << " unknown acquisition item type"; - } - gnss_synchro_ = new Gnss_Synchro(); + { + item_size_ = sizeof(gr_complex); + LOG(WARNING) << item_type_ << " unknown acquisition item type"; + } + gnss_synchro_ = 0; + threshold_ = 0.0; + doppler_max_ = 5000; + doppler_step_ = 250; + channel_internal_queue_ = 0; + channel_ = 0; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc index 95f52335b..f1d85aedb 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_opencl_acquisition.cc @@ -82,25 +82,31 @@ GpsL1CaPcpsOpenClAcquisition::GpsL1CaPcpsOpenClAcquisition( 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) - { - item_size_ = sizeof(gr_complex); - acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, - shift_resolution_, if_, fs_in_, code_length_, code_length_, - bit_transition_flag_, queue_, dump_, dump_filename_); + { + item_size_ = sizeof(gr_complex); + acquisition_cc_ = pcps_make_opencl_acquisition_cc(sampled_ms_, max_dwells_, + shift_resolution_, if_, fs_in_, code_length_, code_length_, + 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) << "acquisition(" << acquisition_cc_->unique_id() << ")"; - } + DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")"; + DLOG(INFO) << "acquisition(" << acquisition_cc_->unique_id() << ")"; + } else - { - LOG(WARNING) << item_type_ << " unknown acquisition item type"; - } - gnss_synchro_ = new Gnss_Synchro(); + { + item_size_ = sizeof(gr_complex); + LOG(WARNING) << item_type_ << " unknown acquisition item type"; + } + gnss_synchro_ = 0; + threshold_ = 0.0; + doppler_max_ = 5000; + doppler_step_ = 250; + channel_internal_queue_ = 0; + channel_ = 0; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc index 79af3d528..d025a9d8b 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_quicksync_acquisition.cc @@ -132,10 +132,16 @@ GpsL1CaPcpsQuickSyncAcquisition::GpsL1CaPcpsQuickSyncAcquisition( } else { + 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; } @@ -295,11 +301,11 @@ float GpsL1CaPcpsQuickSyncAcquisition::calculate_threshold(float pfa) } DLOG(INFO) << "Channel " << channel_<< " Pfa = " << pfa; unsigned int ncells = (code_length_ / folding_factor_) * frequency_bins; - double exponent = 1 / static_cast(ncells); + double exponent = 1.0 / static_cast(ncells); double val = pow(1.0 - pfa, exponent); - double lambda = double((code_length_ / folding_factor_)); + double lambda = static_cast(code_length_) / static_castfolding_factor_); boost::math::exponential_distribution mydist (lambda); - float threshold = (float)quantile(mydist,val); + float threshold = static_cast(quantile(mydist,val)); return threshold; } diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc index 219cf87df..f3bc0e4f6 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_tong_acquisition.cc @@ -93,9 +93,16 @@ GpsL1CaPcpsTongAcquisition::GpsL1CaPcpsTongAcquisition( } else { + 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; } diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc index 0b10e6b7d..10257fb9d 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition.cc @@ -118,7 +118,13 @@ GpsL2MPcpsAcquisition::GpsL2MPcpsAcquisition( // 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; } diff --git a/src/tests/gnss_block/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc b/src/tests/gnss_block/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc index cbf9cce69..d51a755be 100644 --- a/src/tests/gnss_block/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc +++ b/src/tests/gnss_block/galileo_e5a_pcps_acquisition_gsoc2014_gensource_test.cc @@ -58,17 +58,16 @@ class GalileoE5aPcpsAcquisitionGSoC2014GensourceTest: public ::testing::Test { protected: GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() -{ + { item_size = sizeof(gr_complex); stop = false; message = 0; gnss_synchro = Gnss_Synchro(); init(); -} + } ~GalileoE5aPcpsAcquisitionGSoC2014GensourceTest() - { - } + {} void init(); void config_1(); diff --git a/src/tests/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc b/src/tests/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc index 9e977b4b2..53d3a58b8 100644 --- a/src/tests/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc +++ b/src/tests/gnss_block/gps_l1_ca_pcps_acquisition_gsoc2013_test.cc @@ -63,6 +63,7 @@ protected: stop = false; message = 0; gnss_synchro = Gnss_Synchro(); + init(); } ~GpsL1CaPcpsAcquisitionGSoC2013Test() @@ -88,15 +89,15 @@ protected: int message; boost::thread ch_thread; - unsigned int integration_time_ms; - unsigned int fs_in; + unsigned int integration_time_ms = 0; + unsigned int fs_in = 0; - double expected_delay_chips; - double expected_doppler_hz; - float max_doppler_error_hz; - float max_delay_error_chips; + double expected_delay_chips = 0.0; + double expected_doppler_hz = 0.0; + float max_doppler_error_hz = 0.0; + float max_delay_error_chips = 0.0; - unsigned int num_of_realizations; + unsigned int num_of_realizations = 0; unsigned int realization_counter; unsigned int detection_counter; unsigned int correct_estimation_counter;