From d66f5ef9557468d7c57b4349812d0ca3ba78ba14 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 14 Dec 2021 21:58:03 +0100 Subject: [PATCH] Prefer initialization to assignment in constructors --- ...o_e5a_noncoherent_iq_acquisition_caf_cc.cc | 68 +++++++++--------- .../galileo_pcps_8ms_acquisition_cc.cc | 61 ++++++++-------- .../pcps_acquisition_fine_doppler_cc.cc | 58 ++++++++-------- .../pcps_acquisition_fine_doppler_cc.h | 4 +- .../pcps_assisted_acquisition_cc.cc | 69 +++++++++---------- .../pcps_assisted_acquisition_cc.h | 14 ++-- .../pcps_cccwsr_acquisition_cc.cc | 61 ++++++++-------- .../pcps_quicksync_acquisition_cc.cc | 69 +++++++++---------- .../pcps_tong_acquisition_cc.cc | 67 +++++++++--------- .../pcps_tong_acquisition_cc.h | 2 +- 10 files changed, 227 insertions(+), 246 deletions(-) diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc index 538a2e6d6..6c0909d34 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_e5a_noncoherent_iq_acquisition_caf_cc.cc @@ -64,20 +64,42 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit bool both_signal_components_, int CAF_window_hz_, int Zero_padding_, - bool enable_monitor_output) : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("galileo_e5a_noncoherentIQ_acquisition_caf_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_threshold(0), + d_doppler_freq(0), + d_mag(0), + d_input_power(0.0), + d_test_statistics(0), + d_state(0), + d_samples_per_ms(samples_per_ms), + d_samples_per_code(samples_per_code), + d_CAF_window_hz(CAF_window_hz_), + d_buffer_count(0), + d_doppler_resolution(0), + d_doppler_max(static_cast(doppler_max)), + d_doppler_step(250), + d_fft_size(static_cast(sampled_ms) * d_samples_per_ms), + d_num_doppler_bins(0), + d_gr_stream_buffer(0), + d_channel(0), + d_max_dwells(max_dwells), + d_well_count(0), + d_code_phase(0), + d_bit_transition_flag(bit_transition_flag), + d_active(false), + d_dump(dump), + d_both_signal_components(both_signal_components_), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_state = 0; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_samples_per_code = samples_per_code; - d_max_dwells = max_dwells; - d_well_count = 0; - d_doppler_max = static_cast(doppler_max); + if (Zero_padding_ > 0) { d_sampled_ms = 1; @@ -86,15 +108,6 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit { d_sampled_ms = sampled_ms; } - d_fft_size = static_cast(sampled_ms) * d_samples_per_ms; - d_mag = 0; - d_input_power = 0.0; - d_num_doppler_bins = 0; - d_bit_transition_flag = bit_transition_flag; - d_buffer_count = 0; - d_both_signal_components = both_signal_components_; - d_CAF_window_hz = CAF_window_hz_; - d_enable_monitor_output = enable_monitor_output; d_inbuffer = std::vector(d_fft_size); d_fft_code_I_A = std::vector(d_fft_size); @@ -120,19 +133,6 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::galileo_e5a_noncoherentIQ_acquisit d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - - d_dump = dump; - d_dump_filename = dump_filename; - - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_step = 250; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_channel = 0; - d_gr_stream_buffer = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc index 446151499..85ad12ff1 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/galileo_pcps_8ms_acquisition_cc.cc @@ -52,46 +52,43 @@ galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc( int32_t samples_per_code, bool dump, const std::string &dump_filename, - bool enable_monitor_output) : gr::block("galileo_pcps_8ms_acquisition_cc", - gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("galileo_pcps_8ms_acquisition_cc", + gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_threshold(0), + d_doppler_freq(0), + d_mag(0), + d_input_power(0.0), + d_test_statistics(0), + d_state(0), + d_samples_per_ms(samples_per_ms), + d_samples_per_code(samples_per_code), + d_channel(0), + d_doppler_resolution(0), + d_doppler_max(doppler_max), + d_doppler_step(0), + d_sampled_ms(sampled_ms), + d_max_dwells(max_dwells), + d_well_count(0), + d_fft_size(d_sampled_ms * d_samples_per_ms), + d_num_doppler_bins(0), + d_code_phase(0), + d_active(false), + d_dump(dump), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_state = 0; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_samples_per_code = samples_per_code; - d_sampled_ms = sampled_ms; - d_max_dwells = max_dwells; - d_well_count = 0; - d_doppler_max = doppler_max; - d_fft_size = d_sampled_ms * d_samples_per_ms; - d_mag = 0; - d_input_power = 0.0; - d_num_doppler_bins = 0; d_fft_code_A = std::vector(d_fft_size, lv_cmake(0.0F, 0.0F)); d_fft_code_B = std::vector(d_fft_size, lv_cmake(0.0F, 0.0F)); d_magnitude = std::vector(d_fft_size, 0.0F); d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - - d_enable_monitor_output = enable_monitor_output; - - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_channel = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc index a52e99520..0b2d0d885 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.cc @@ -41,30 +41,41 @@ pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(cons pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Conf &conf_) : gr::block("pcps_acquisition_fine_doppler_cc", gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(conf_.dump_filename), + d_gnss_synchro(nullptr), + acq_parameters(conf_), + d_fs_in(conf_.fs_in), + d_dump_number(0), + d_sample_counter(0ULL), + d_threshold(0), + d_test_statistics(0), + d_positive_acq(0), + d_state(0), + d_samples_per_ms(static_cast(conf_.samples_per_ms)), + d_max_dwells(conf_.max_dwells), + d_config_doppler_max(conf_.doppler_max), + d_num_doppler_points(0), + d_well_count(0), + d_n_samples_in_buffer(0), + d_fft_size(d_samples_per_ms), + d_gnuradio_forecast_samples(d_fft_size), + d_doppler_step(0), + d_channel(0), + d_dump_channel(0), + d_active(false), + d_dump(conf_.dump) { this->message_port_register_out(pmt::mp("events")); - acq_parameters = conf_; - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_fs_in = conf_.fs_in; - d_samples_per_ms = static_cast(conf_.samples_per_ms); - d_config_doppler_max = conf_.doppler_max; - d_fft_size = d_samples_per_ms; - // HS Acquisition - d_max_dwells = conf_.max_dwells; - d_gnuradio_forecast_samples = d_fft_size; - d_state = 0; + d_fft_codes = volk_gnsssdr::vector(d_fft_size); d_magnitude = volk_gnsssdr::vector(d_fft_size); d_10_ms_buffer = volk_gnsssdr::vector(50 * d_samples_per_ms); d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - // For dumping samples into a file - d_dump = conf_.dump; - d_dump_filename = conf_.dump_filename; - + // this implementation can only produce dumps in channel 0 + // todo: migrate config parameters to the unified acquisition config class if (d_dump) { std::string dump_path; @@ -96,21 +107,6 @@ pcps_acquisition_fine_doppler_cc::pcps_acquisition_fine_doppler_cc(const Acq_Con d_dump = false; } } - - d_n_samples_in_buffer = 0; - d_threshold = 0; - d_num_doppler_points = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_well_count = 0; - d_channel = 0; - d_positive_acq = 0; - d_dump_number = 0; - d_dump_channel = 0; // this implementation can only produce dumps in channel 0 - // todo: migrate config parameters to the unified acquisition config class } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h index 22f6b35dd..d9c073e01 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_fine_doppler_cc.h @@ -219,7 +219,6 @@ private: int64_t d_dump_number; uint64_t d_sample_counter; - float d_doppler_freq; float d_threshold; float d_test_statistics; @@ -227,15 +226,14 @@ private: int d_state; int d_samples_per_ms; int d_max_dwells; - int d_gnuradio_forecast_samples; int d_config_doppler_max; int d_num_doppler_points; int d_well_count; int d_n_samples_in_buffer; int d_fft_size; + int d_gnuradio_forecast_samples; unsigned int d_doppler_step; unsigned int d_channel; - unsigned int d_code_phase; unsigned int d_dump_channel; bool d_active; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc index d799a1d59..81d168365 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.cc @@ -47,48 +47,45 @@ pcps_assisted_acquisition_cc_sptr pcps_make_assisted_acquisition_cc( pcps_assisted_acquisition_cc::pcps_assisted_acquisition_cc( int32_t max_dwells, uint32_t sampled_ms, int32_t doppler_max, int32_t doppler_min, int64_t fs_in, int32_t samples_per_ms, bool dump, const std::string &dump_filename, - bool enable_monitor_output) : gr::block("pcps_assisted_acquisition_cc", - gr::io_signature::make(1, 1, sizeof(gr_complex)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("pcps_assisted_acquisition_cc", + gr::io_signature::make(1, 1, sizeof(gr_complex)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_threshold(0), + d_doppler_freq(0), + d_input_power(0.0), + d_test_statistics(0), + d_doppler_resolution(0), + d_channel(0), + d_sampled_ms(sampled_ms), + d_code_phase(0), + d_samples_per_ms(samples_per_ms), + d_fft_size(d_sampled_ms * d_samples_per_ms), + d_max_dwells(max_dwells), + d_gnuradio_forecast_samples(d_fft_size * 4), + d_doppler_max(0), + d_doppler_min(0), + d_config_doppler_max(doppler_max), + d_config_doppler_min(doppler_min), + d_num_doppler_points(0), + d_doppler_step(0), + d_state(0), + d_well_count(0), + d_active(false), + d_disable_assist(false), + d_dump(dump), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_sampled_ms = sampled_ms; - d_config_doppler_max = doppler_max; - d_config_doppler_min = doppler_min; - d_fft_size = d_sampled_ms * d_samples_per_ms; - // HS Acquisition - d_max_dwells = max_dwells; - d_gnuradio_forecast_samples = d_fft_size * 4; - d_input_power = 0.0; - d_state = 0; - d_disable_assist = false; + d_fft_codes = std::vector(d_fft_size); d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - - d_enable_monitor_output = enable_monitor_output; - - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_max = 0; - d_doppler_min = 0; - d_num_doppler_points = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_well_count = 0; - d_channel = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h index 55fdfd39d..4115130f2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_assisted_acquisition_cc.h @@ -219,7 +219,16 @@ private: float d_doppler_freq; float d_input_power; float d_test_statistics; + + uint32_t d_doppler_resolution; + uint32_t d_channel; + uint32_t d_sampled_ms; + uint32_t d_code_phase; + int32_t d_samples_per_ms; + + uint32_t d_fft_size; + int32_t d_max_dwells; int32_t d_gnuradio_forecast_samples; int32_t d_doppler_max; @@ -230,11 +239,6 @@ private: int32_t d_doppler_step; int32_t d_state; int32_t d_well_count; - uint32_t d_doppler_resolution; - uint32_t d_channel; - uint32_t d_sampled_ms; - uint32_t d_fft_size; - uint32_t d_code_phase; bool d_active; bool d_disable_assist; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc index 1bf2ea65e..47db3495a 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_cccwsr_acquisition_cc.cc @@ -57,25 +57,37 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( int32_t samples_per_code, bool dump, const std::string &dump_filename, - bool enable_monitor_output) : gr::block("pcps_cccwsr_acquisition_cc", - gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("pcps_cccwsr_acquisition_cc", + gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_threshold(0), + d_doppler_freq(0), + d_mag(0), + d_input_power(0.0), + d_test_statistics(0), + d_state(0), + d_samples_per_ms(samples_per_ms), + d_samples_per_code(samples_per_code), + d_doppler_resolution(0), + d_doppler_max(doppler_max), + d_doppler_step(0), + d_sampled_ms(sampled_ms), + d_max_dwells(max_dwells), + d_well_count(0), + d_fft_size(d_sampled_ms * d_samples_per_ms), + d_num_doppler_bins(0), + d_code_phase(0), + d_channel(0), + d_active(false), + d_dump(dump), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_state = 0; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_samples_per_code = samples_per_code; - d_sampled_ms = sampled_ms; - d_max_dwells = max_dwells; - d_well_count = 0; - d_doppler_max = doppler_max; - d_fft_size = d_sampled_ms * d_samples_per_ms; - d_mag = 0; - d_input_power = 0.0; - d_num_doppler_bins = 0; d_fft_code_data = std::vector(d_fft_size); d_fft_code_pilot = std::vector(d_fft_size); @@ -87,21 +99,6 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc( d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - - d_enable_monitor_output = enable_monitor_output; - - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_channel = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc index d4047c3fd..0463ef99f 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_quicksync_acquisition_cc.cc @@ -59,29 +59,40 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( bool bit_transition_flag, bool dump, const std::string& dump_filename, - bool enable_monitor_output) : gr::block("pcps_quicksync_acquisition_cc", - gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("pcps_quicksync_acquisition_cc", + gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_noise_floor_power(0), + d_threshold(0), + d_doppler_freq(0), + d_mag(0), + d_input_power(0.0), + d_test_statistics(0), + d_samples_per_ms(samples_per_ms), + d_samples_per_code(samples_per_code), + d_state(0), + d_channel(0), + d_folding_factor(folding_factor), + d_doppler_resolution(0), + d_doppler_max(doppler_max), + d_doppler_step(0), + d_sampled_ms(sampled_ms), + d_max_dwells(max_dwells), + d_well_count(0), + d_fft_size((d_samples_per_code) / d_folding_factor), + d_num_doppler_bins(0), + d_code_phase(0), + d_bit_transition_flag(bit_transition_flag), + d_active(false), + d_dump(dump), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_state = 0; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_samples_per_code = samples_per_code; - d_sampled_ms = sampled_ms; - d_max_dwells = max_dwells; - d_well_count = 0; - d_doppler_max = doppler_max; - d_mag = 0; - d_input_power = 0.0; - d_num_doppler_bins = 0; - d_bit_transition_flag = bit_transition_flag; - d_folding_factor = folding_factor; - - // fft size is reduced. - d_fft_size = (d_samples_per_code) / d_folding_factor; d_fft_codes = std::vector(d_fft_size); d_magnitude = std::vector(d_samples_per_code * d_folding_factor); @@ -96,24 +107,8 @@ pcps_quicksync_acquisition_cc::pcps_quicksync_acquisition_cc( d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - - d_enable_monitor_output = enable_monitor_output; - d_code_folded = std::vector(d_fft_size, lv_cmake(0.0F, 0.0F)); - d_signal_folded = std::vector(d_fft_size); - d_noise_floor_power = 0; - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_channel = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc index c8a56277f..b3c5c61a9 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.cc @@ -75,49 +75,46 @@ pcps_tong_acquisition_cc::pcps_tong_acquisition_cc( uint32_t tong_max_dwells, bool dump, const std::string &dump_filename, - bool enable_monitor_output) : gr::block("pcps_tong_acquisition_cc", - gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), - gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))) + bool enable_monitor_output) + : gr::block("pcps_tong_acquisition_cc", + gr::io_signature::make(1, 1, static_cast(sizeof(gr_complex) * sampled_ms * samples_per_ms)), + gr::io_signature::make(0, 1, sizeof(Gnss_Synchro))), + d_dump_filename(dump_filename), + d_gnss_synchro(nullptr), + d_fs_in(fs_in), + d_sample_counter(0ULL), + d_threshold(0), + d_doppler_freq(0), + d_mag(0), + d_input_power(0.0), + d_test_statistics(0), + d_state(0), + d_samples_per_ms(samples_per_ms), + d_samples_per_code(samples_per_code), + d_channel(0), + d_doppler_resolution(0), + d_doppler_max(doppler_max), + d_doppler_step(0), + d_sampled_ms(sampled_ms), + d_dwell_count(0), + d_tong_init_val(tong_init_val), + d_tong_max_val(tong_max_val), + d_tong_max_dwells(tong_max_dwells), + d_tong_count(d_tong_init_val), + d_fft_size(d_sampled_ms * d_samples_per_ms), + d_num_doppler_bins(0), + d_code_phase(0), + d_active(false), + d_dump(dump), + d_enable_monitor_output(enable_monitor_output) { this->message_port_register_out(pmt::mp("events")); - d_sample_counter = 0ULL; // SAMPLE COUNTER - d_active = false; - d_state = 0; - d_fs_in = fs_in; - d_samples_per_ms = samples_per_ms; - d_samples_per_code = samples_per_code; - d_sampled_ms = sampled_ms; - d_dwell_count = 0; - d_tong_max_val = tong_max_val; - d_tong_max_dwells = tong_max_dwells; - d_tong_init_val = tong_init_val; - d_tong_count = d_tong_init_val; - d_doppler_max = doppler_max; - d_fft_size = d_sampled_ms * d_samples_per_ms; - d_mag = 0; - d_input_power = 0.0; - d_num_doppler_bins = 0; d_fft_codes = std::vector(d_fft_size); d_magnitude = std::vector(d_fft_size); d_fft_if = gnss_fft_fwd_make_unique(d_fft_size); d_ifft = gnss_fft_rev_make_unique(d_fft_size); - - // For dumping samples into a file - d_dump = dump; - d_dump_filename = dump_filename; - - d_enable_monitor_output = enable_monitor_output; - - d_doppler_resolution = 0; - d_threshold = 0; - d_doppler_step = 0; - d_gnss_synchro = nullptr; - d_code_phase = 0; - d_doppler_freq = 0; - d_test_statistics = 0; - d_channel = 0; } diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h index 45d8495ff..2f3f9f498 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_tong_acquisition_cc.h @@ -231,10 +231,10 @@ private: uint32_t d_doppler_step; uint32_t d_sampled_ms; uint32_t d_dwell_count; - uint32_t d_tong_count; uint32_t d_tong_init_val; uint32_t d_tong_max_val; uint32_t d_tong_max_dwells; + uint32_t d_tong_count; uint32_t d_fft_size; uint32_t d_num_doppler_bins; uint32_t d_code_phase;