From 03d350551f51ab8c4b382ee304548fbcf91fd64d Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 26 Jun 2020 22:07:41 +0200 Subject: [PATCH] Sort private members in headers --- .../input_filter/adapters/fir_filter.cc | 21 ++++--- .../input_filter/adapters/fir_filter.h | 1 + .../adapters/freq_xlating_fir_filter.h | 2 +- .../input_filter/adapters/notch_filter.h | 3 +- .../adapters/notch_filter_lite.cc | 1 - .../input_filter/adapters/notch_filter_lite.h | 3 +- .../adapters/pulse_blanking_filter.h | 2 +- src/algorithms/libs/byte_x2_to_complex_byte.h | 8 +-- .../libs/complex_byte_to_float_x2.h | 8 +-- .../libs/complex_float_to_complex_byte.h | 8 +-- src/algorithms/libs/conjugate_cc.h | 8 +-- src/algorithms/libs/conjugate_ic.h | 8 +-- src/algorithms/libs/conjugate_sc.h | 8 +-- src/algorithms/libs/cshort_to_float_x2.h | 8 +-- src/algorithms/libs/short_x2_to_cshort.h | 8 +-- .../adapters/custom_udp_signal_source.h | 29 +++++----- .../adapters/gn3s_signal_source.h | 17 +++--- .../multichannel_file_signal_source.h | 28 ++++----- .../adapters/nsr_file_signal_source.h | 20 +++---- .../adapters/plutosdr_signal_source.h | 57 +++++++++---------- .../adapters/raw_array_signal_source.h | 19 ++++--- .../adapters/rtl_tcp_signal_source.h | 42 +++++++------- .../adapters/spir_file_signal_source.h | 24 ++++---- .../spir_gss6450_file_signal_source.h | 38 ++++++------- .../adapters/two_bit_cpx_file_signal_source.h | 22 +++---- .../two_bit_packed_file_signal_source.h | 22 +++---- .../gr_complex_ip_packet_source.h | 41 +++++++------ .../rtl_tcp_signal_source_c.cc | 6 +- .../gnuradio_blocks/rtl_tcp_signal_source_c.h | 38 ++++++------- .../gnuradio_blocks/unpack_2bit_samples.cc | 2 +- .../gnuradio_blocks/unpack_2bit_samples.h | 4 +- .../unpack_spir_gss6450_samples.h | 8 +-- .../signal_source/libs/fpga_switch.h | 6 +- .../telemetry_decoder/libs/viterbi_decoder.h | 50 ++++++++-------- .../tracking/libs/bayesian_estimation.h | 3 +- .../tracking/libs/cuda_multicorrelator.h | 7 ++- 36 files changed, 291 insertions(+), 289 deletions(-) diff --git a/src/algorithms/input_filter/adapters/fir_filter.cc b/src/algorithms/input_filter/adapters/fir_filter.cc index d47196fce..d085eebc3 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.cc +++ b/src/algorithms/input_filter/adapters/fir_filter.cc @@ -29,22 +29,21 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, unsigned int in_streams, unsigned int out_streams) : config_(configuration), role_(std::move(role)), in_streams_(in_streams), out_streams_(out_streams) { - size_t item_size; (*this).init(); if ((taps_item_type_ == "float") && (input_item_type_ == "gr_complex") && (output_item_type_ == "gr_complex")) { - item_size = sizeof(gr_complex); + item_size_ = sizeof(gr_complex); fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps_); DLOG(INFO) << "input_filter(" << fir_filter_ccf_->unique_id() << ")"; if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); + file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); } } else if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "cshort")) { - item_size = sizeof(lv_16sc_t); + item_size_ = sizeof(lv_16sc_t); cshort_to_float_x2_ = make_cshort_to_float_x2(); fir_filter_fff_1_ = gr::filter::fir_filter_fff::make(1, taps_); fir_filter_fff_2_ = gr::filter::fir_filter_fff::make(1, taps_); @@ -56,12 +55,12 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); + file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); } } else if ((taps_item_type_ == "float") && (input_item_type_ == "cshort") && (output_item_type_ == "gr_complex")) { - item_size = sizeof(gr_complex); + item_size_ = sizeof(gr_complex); cshort_to_float_x2_ = make_cshort_to_float_x2(); fir_filter_fff_1_ = gr::filter::fir_filter_fff::make(1, taps_); fir_filter_fff_2_ = gr::filter::fir_filter_fff::make(1, taps_); @@ -71,13 +70,13 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); + file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); } } else if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "gr_complex")) { - item_size = sizeof(gr_complex); + item_size_ = sizeof(gr_complex); cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); fir_filter_fff_1_ = gr::filter::fir_filter_fff::make(1, taps_); @@ -90,12 +89,12 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); + file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); } } else if ((taps_item_type_ == "float") && (input_item_type_ == "cbyte") && (output_item_type_ == "cbyte")) { - item_size = sizeof(lv_8sc_t); + item_size_ = sizeof(lv_8sc_t); cbyte_to_float_x2_ = make_complex_byte_to_float_x2(); fir_filter_fff_1_ = gr::filter::fir_filter_fff::make(1, taps_); @@ -111,7 +110,7 @@ FirFilter::FirFilter(ConfigurationInterface* configuration, std::string role, if (dump_) { DLOG(INFO) << "Dumping output into file " << dump_filename_; - file_sink_ = gr::blocks::file_sink::make(item_size, dump_filename_.c_str()); + file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str()); } } else diff --git a/src/algorithms/input_filter/adapters/fir_filter.h b/src/algorithms/input_filter/adapters/fir_filter.h index 4cbbe2c35..8361d7839 100644 --- a/src/algorithms/input_filter/adapters/fir_filter.h +++ b/src/algorithms/input_filter/adapters/fir_filter.h @@ -108,6 +108,7 @@ private: std::string output_item_type_; std::string taps_item_type_; std::string role_; + size_t item_size_; unsigned int in_streams_; unsigned int out_streams_; bool dump_; diff --git a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h index c2b41933d..33466a4ba 100644 --- a/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h +++ b/src/algorithms/input_filter/adapters/freq_xlating_fir_filter.h @@ -75,7 +75,7 @@ public: inline size_t item_size() override { - return 0; + return input_size_; } void connect(gr::top_block_sptr top_block) override; diff --git a/src/algorithms/input_filter/adapters/notch_filter.h b/src/algorithms/input_filter/adapters/notch_filter.h index 5d817fc9c..2bb38a951 100644 --- a/src/algorithms/input_filter/adapters/notch_filter.h +++ b/src/algorithms/input_filter/adapters/notch_filter.h @@ -52,7 +52,7 @@ public: size_t item_size() { - return 0; + return item_size_; } void connect(gr::top_block_sptr top_block); @@ -66,6 +66,7 @@ private: std::string dump_filename_; std::string role_; std::string item_type_; + size_t item_size_; unsigned int in_streams_; unsigned int out_streams_; bool dump_; diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.cc b/src/algorithms/input_filter/adapters/notch_filter_lite.cc index 2bd3dcf27..c132fc99c 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.cc +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.cc @@ -29,7 +29,6 @@ NotchFilterLite::NotchFilterLite(ConfigurationInterface* configuration, const std::string& role, unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams) { - size_t item_size_; float p_c_factor; float default_p_c_factor = 0.9; float pfa; diff --git a/src/algorithms/input_filter/adapters/notch_filter_lite.h b/src/algorithms/input_filter/adapters/notch_filter_lite.h index f66b6c1e6..e93c3e51c 100644 --- a/src/algorithms/input_filter/adapters/notch_filter_lite.h +++ b/src/algorithms/input_filter/adapters/notch_filter_lite.h @@ -52,7 +52,7 @@ public: size_t item_size() { - return 0; + return item_size_; } void connect(gr::top_block_sptr top_block); @@ -66,6 +66,7 @@ private: std::string dump_filename_; std::string role_; std::string item_type_; + size_t item_size_; unsigned int in_streams_; unsigned int out_streams_; bool dump_; diff --git a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h index 5b181c35a..c4e25c35d 100644 --- a/src/algorithms/input_filter/adapters/pulse_blanking_filter.h +++ b/src/algorithms/input_filter/adapters/pulse_blanking_filter.h @@ -55,7 +55,7 @@ public: inline size_t item_size() override { - return 0; + return input_size_; } void connect(gr::top_block_sptr top_block) override; diff --git a/src/algorithms/libs/byte_x2_to_complex_byte.h b/src/algorithms/libs/byte_x2_to_complex_byte.h index 17adb7e0b..9ebbd5f67 100644 --- a/src/algorithms/libs/byte_x2_to_complex_byte.h +++ b/src/algorithms/libs/byte_x2_to_complex_byte.h @@ -45,14 +45,14 @@ byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); */ class byte_x2_to_complex_byte : public gr::sync_block { -private: - friend byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); - byte_x2_to_complex_byte(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend byte_x2_to_complex_byte_sptr make_byte_x2_to_complex_byte(); + byte_x2_to_complex_byte(); }; #endif diff --git a/src/algorithms/libs/complex_byte_to_float_x2.h b/src/algorithms/libs/complex_byte_to_float_x2.h index b2fdd52b7..01bc87c25 100644 --- a/src/algorithms/libs/complex_byte_to_float_x2.h +++ b/src/algorithms/libs/complex_byte_to_float_x2.h @@ -45,14 +45,14 @@ complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); */ class complex_byte_to_float_x2 : public gr::sync_block { -private: - friend complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); - complex_byte_to_float_x2(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend complex_byte_to_float_x2_sptr make_complex_byte_to_float_x2(); + complex_byte_to_float_x2(); }; #endif diff --git a/src/algorithms/libs/complex_float_to_complex_byte.h b/src/algorithms/libs/complex_float_to_complex_byte.h index 8939f6bcd..7238fe9f8 100644 --- a/src/algorithms/libs/complex_float_to_complex_byte.h +++ b/src/algorithms/libs/complex_float_to_complex_byte.h @@ -44,14 +44,14 @@ complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); */ class complex_float_to_complex_byte : public gr::sync_block { -private: - friend complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); - complex_float_to_complex_byte(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend complex_float_to_complex_byte_sptr make_complex_float_to_complex_byte(); + complex_float_to_complex_byte(); }; #endif diff --git a/src/algorithms/libs/conjugate_cc.h b/src/algorithms/libs/conjugate_cc.h index fdeef3c54..c2e8e208a 100644 --- a/src/algorithms/libs/conjugate_cc.h +++ b/src/algorithms/libs/conjugate_cc.h @@ -44,14 +44,14 @@ conjugate_cc_sptr make_conjugate_cc(); */ class conjugate_cc : public gr::sync_block { -private: - friend conjugate_cc_sptr make_conjugate_cc(); - conjugate_cc(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend conjugate_cc_sptr make_conjugate_cc(); + conjugate_cc(); }; #endif diff --git a/src/algorithms/libs/conjugate_ic.h b/src/algorithms/libs/conjugate_ic.h index 5b1cb209c..be61c44ec 100644 --- a/src/algorithms/libs/conjugate_ic.h +++ b/src/algorithms/libs/conjugate_ic.h @@ -44,14 +44,14 @@ conjugate_ic_sptr make_conjugate_ic(); */ class conjugate_ic : public gr::sync_block { -private: - friend conjugate_ic_sptr make_conjugate_ic(); - conjugate_ic(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend conjugate_ic_sptr make_conjugate_ic(); + conjugate_ic(); }; #endif diff --git a/src/algorithms/libs/conjugate_sc.h b/src/algorithms/libs/conjugate_sc.h index b02d2f215..c6e86a35d 100644 --- a/src/algorithms/libs/conjugate_sc.h +++ b/src/algorithms/libs/conjugate_sc.h @@ -44,14 +44,14 @@ conjugate_sc_sptr make_conjugate_sc(); */ class conjugate_sc : public gr::sync_block { -private: - friend conjugate_sc_sptr make_conjugate_sc(); - conjugate_sc(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend conjugate_sc_sptr make_conjugate_sc(); + conjugate_sc(); }; #endif diff --git a/src/algorithms/libs/cshort_to_float_x2.h b/src/algorithms/libs/cshort_to_float_x2.h index 2d33ced1e..43db33b06 100644 --- a/src/algorithms/libs/cshort_to_float_x2.h +++ b/src/algorithms/libs/cshort_to_float_x2.h @@ -45,14 +45,14 @@ cshort_to_float_x2_sptr make_cshort_to_float_x2(); */ class cshort_to_float_x2 : public gr::sync_block { -private: - friend cshort_to_float_x2_sptr make_cshort_to_float_x2(); - cshort_to_float_x2(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend cshort_to_float_x2_sptr make_cshort_to_float_x2(); + cshort_to_float_x2(); }; #endif diff --git a/src/algorithms/libs/short_x2_to_cshort.h b/src/algorithms/libs/short_x2_to_cshort.h index ee531d880..770f776f3 100644 --- a/src/algorithms/libs/short_x2_to_cshort.h +++ b/src/algorithms/libs/short_x2_to_cshort.h @@ -44,14 +44,14 @@ short_x2_to_cshort_sptr make_short_x2_to_cshort(); */ class short_x2_to_cshort : public gr::sync_block { -private: - friend short_x2_to_cshort_sptr make_short_x2_to_cshort(); - short_x2_to_cshort(); - public: int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + +private: + friend short_x2_to_cshort_sptr make_short_x2_to_cshort(); + short_x2_to_cshort(); }; #endif diff --git a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h index 2c5a490b0..f0c39c9ca 100644 --- a/src/algorithms/signal_source/adapters/custom_udp_signal_source.h +++ b/src/algorithms/signal_source/adapters/custom_udp_signal_source.h @@ -77,27 +77,28 @@ public: gr::basic_block_sptr get_right_block(int RF_channel) override; private: - std::string role_; + Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; + #if GNURADIO_USES_STD_POINTERS + std::vector> null_sinks_; + std::vector> file_sink_; + #else + std::vector> null_sinks_; + std::vector> file_sink_; + #endif + + std::string role_; + std::string item_type_; + std::string dump_filename_; + + size_t item_size_; - bool IQ_swap_; int RF_channels_; int channels_in_udp_; unsigned int in_stream_; unsigned int out_stream_; - std::string item_type_; - size_t item_size_; bool dump_; - std::string dump_filename_; -#if GNURADIO_USES_STD_POINTERS - std::vector> null_sinks_; - std::vector> file_sink_; -#else - std::vector> null_sinks_; - std::vector> file_sink_; -#endif - - Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_; + bool IQ_swap_; }; #endif // GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/gn3s_signal_source.h b/src/algorithms/signal_source/adapters/gn3s_signal_source.h index 1eeea5ec4..7635f9077 100644 --- a/src/algorithms/signal_source/adapters/gn3s_signal_source.h +++ b/src/algorithms/signal_source/adapters/gn3s_signal_source.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -68,16 +69,16 @@ public: gr::basic_block_sptr get_right_block() override; private: - std::string role_; - unsigned int in_stream_; - unsigned int out_stream_; - std::string item_type_; - size_t item_size_; - long samples_; - bool dump_; - std::string dump_filename_; gr::block_sptr gn3s_source_; gr::blocks::file_sink::sptr file_sink_; + std::string role_; + std::string item_type_; + std::string dump_filename_; + size_t item_size_; + int64_t samples_; + unsigned int in_stream_; + unsigned int out_stream_; + bool dump_; }; #endif // GNSS_SDR_GN3S_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h index e4f1f1ffd..2170577ff 100644 --- a/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/multichannel_file_signal_source.h @@ -104,24 +104,24 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; - uint32_t n_channels_; - std::vector filename_vec_; - std::string item_type_; - bool repeat_; - std::string role_; - uint32_t in_streams_; - uint32_t out_streams_; std::vector file_source_vec_; -#if GNURADIO_USES_STD_POINTERS - std::shared_ptr valve_; -#else - boost::shared_ptr valve_; -#endif + #if GNURADIO_USES_STD_POINTERS + std::shared_ptr valve_; + #else + boost::shared_ptr valve_; + #endif gr::blocks::file_sink::sptr sink_; std::vector throttle_vec_; + std::vector filename_vec_; + std::string item_type_; + std::string role_; + uint64_t samples_; + int64_t sampling_frequency_; size_t item_size_; + uint32_t n_channels_; + uint32_t in_streams_; + uint32_t out_streams_; + bool repeat_; // Throttle control bool enable_throttle_control_; }; diff --git a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h index 171b4f343..63841b2fe 100644 --- a/src/algorithms/signal_source/adapters/nsr_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/nsr_file_signal_source.h @@ -102,16 +102,6 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; - std::string filename_; - std::string item_type_; - bool repeat_; - bool dump_; - std::string dump_filename_; - std::string role_; - uint32_t in_streams_; - uint32_t out_streams_; gr::blocks::file_source::sptr file_source_; unpack_byte_2bit_samples_sptr unpack_byte_; #if GNURADIO_USES_STD_POINTERS @@ -121,7 +111,17 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; + uint64_t samples_; + int64_t sampling_frequency_; size_t item_size_; + std::string filename_; + std::string item_type_; + std::string dump_filename_; + std::string role_; + uint32_t in_streams_; + uint32_t out_streams_; + bool repeat_; + bool dump_; // Throttle control bool enable_throttle_control_; }; diff --git a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h index edb54fe37..c537516f0 100644 --- a/src/algorithms/signal_source/adapters/plutosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/plutosdr_signal_source.h @@ -75,35 +75,6 @@ public: gr::basic_block_sptr get_right_block() override; private: - std::string role_; - - // Front-end settings - std::string uri_; // device direction - uint64_t freq_; // frequency of local oscilator - uint64_t sample_rate_; - uint64_t bandwidth_; - uint64_t buffer_size_; // reception buffer - bool quadrature_; - bool rf_dc_; - bool bb_dc_; - std::string gain_mode_; - double rf_gain_; - std::string filter_file_; - bool filter_auto_; - std::string filter_source_; - std::string filter_filename_; - float Fpass_; - float Fstop_; - - unsigned int in_stream_; - unsigned int out_stream_; - - std::string item_type_; - size_t item_size_; - int64_t samples_; - bool dump_; - std::string dump_filename_; - gr::iio::pluto_source::sptr plutosdr_source_; #if GNURADIO_USES_STD_POINTERS @@ -112,6 +83,34 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; + + std::string role_; + std::string dump_filename_; + + // Front-end settings + std::string uri_; // device direction + std::string gain_mode_; + std::string filter_file_; + std::string filter_source_; + std::string filter_filename_; + std::string item_type_; + double rf_gain_; + int64_t samples_; + uint64_t freq_; // frequency of local oscilator + uint64_t sample_rate_; + uint64_t bandwidth_; + uint64_t buffer_size_; // reception buffer + size_t item_size_; + float Fpass_; + float Fstop_; + unsigned int in_stream_; + unsigned int out_stream_; + + bool quadrature_; + bool rf_dc_; + bool bb_dc_; + bool filter_auto_; + bool dump_; }; #endif // GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/raw_array_signal_source.h b/src/algorithms/signal_source/adapters/raw_array_signal_source.h index fd3272b72..6d4fd9da5 100644 --- a/src/algorithms/signal_source/adapters/raw_array_signal_source.h +++ b/src/algorithms/signal_source/adapters/raw_array_signal_source.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -67,17 +68,17 @@ public: gr::basic_block_sptr get_right_block() override; private: - std::string role_; - unsigned int in_stream_; - unsigned int out_stream_; - std::string item_type_; - size_t item_size_; - long samples_; - bool dump_; - std::string dump_filename_; - std::string eth_device_; gr::block_sptr raw_array_source_; gr::blocks::file_sink::sptr file_sink_; + std::string role_; + std::string item_type_; + std::string dump_filename_; + std::string eth_device_; + size_t item_size_; + int64_t samples_; + unsigned int in_stream_; + unsigned int out_stream_; + bool dump_; }; #endif // GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h index 56ae6975e..2daa4d1c4 100644 --- a/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h +++ b/src/algorithms/signal_source/adapters/rtl_tcp_signal_source.h @@ -80,28 +80,6 @@ public: private: void MakeBlock(); - std::string role_; - - // rtl_tcp settings - std::string address_; - int16_t port_; - bool AGC_enabled_; - double sample_rate_; - bool flip_iq_; - - unsigned int in_stream_; - unsigned int out_stream_; - - double freq_; - double gain_; - double if_gain_; - double rf_gain_; - - std::string item_type_; - size_t item_size_; - uint64_t samples_; - bool dump_; - std::string dump_filename_; rtl_tcp_signal_source_c_sptr signal_source_; @@ -111,6 +89,26 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; + + std::string role_; + std::string item_type_; + std::string dump_filename_; + + // rtl_tcp settings + std::string address_; + size_t item_size_; + uint64_t samples_; + double sample_rate_; + double freq_; + double gain_; + double if_gain_; + double rf_gain_; + unsigned int in_stream_; + unsigned int out_stream_; + int16_t port_; + bool AGC_enabled_; + bool flip_iq_; + bool dump_; }; #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/spir_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_file_signal_source.h index d4d35f826..d66136518 100644 --- a/src/algorithms/signal_source/adapters/spir_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_file_signal_source.h @@ -100,16 +100,6 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; - std::string filename_; - std::string item_type_; - bool repeat_; - bool dump_; - std::string dump_filename_; - std::string role_; - unsigned int in_streams_; - unsigned int out_streams_; gr::blocks::file_source::sptr file_source_; unpack_intspir_1bit_samples_sptr unpack_intspir_; #if GNURADIO_USES_STD_POINTERS @@ -119,7 +109,21 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; + std::string filename_; + std::string item_type_; + std::string dump_filename_; + std::string role_; + + uint64_t samples_; + int64_t sampling_frequency_; size_t item_size_; + + unsigned int in_streams_; + unsigned int out_streams_; + + bool repeat_; + bool dump_; + // Throttle control bool enable_throttle_control_; }; diff --git a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h index bfda945a2..3ffa35d21 100644 --- a/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/spir_gss6450_file_signal_source.h @@ -103,34 +103,34 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; + gr::blocks::file_source::sptr file_source_; + gr::blocks::deinterleave::sptr deint_; + #if GNURADIO_USES_STD_POINTERS + std::vector> valve_vec_; + #else + std::vector> valve_vec_; + #endif + std::vector endian_vec_; + std::vector null_sinks_; + std::vector unpack_spir_vec_; + std::vector sink_vec_; + std::vector throttle_vec_; std::string filename_; - bool repeat_; - bool dump_; // Enables dumping the gr_complex sample output - bool enable_throttle_control_; - bool endian_swap_; std::string dump_filename_; std::string role_; std::string item_type_; + uint64_t samples_; + int64_t sampling_frequency_; + size_t item_size_; uint32_t in_streams_; uint32_t out_streams_; uint32_t adc_bits_; uint32_t n_channels_; uint32_t sel_ch_; - gr::blocks::file_source::sptr file_source_; - gr::blocks::deinterleave::sptr deint_; - std::vector endian_vec_; - std::vector null_sinks_; - std::vector unpack_spir_vec_; -#if GNURADIO_USES_STD_POINTERS - std::vector> valve_vec_; -#else - std::vector> valve_vec_; -#endif - std::vector sink_vec_; - std::vector throttle_vec_; - size_t item_size_; + bool repeat_; + bool dump_; // Enables dumping the gr_complex sample output + bool enable_throttle_control_; + bool endian_swap_; }; #endif // GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h index bfb997d44..e0cb939ed 100644 --- a/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_cpx_file_signal_source.h @@ -106,19 +106,9 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; - std::string filename_; - std::string item_type_; - bool repeat_; - bool dump_; - std::string dump_filename_; - std::string role_; - unsigned int in_streams_; - unsigned int out_streams_; gr::blocks::file_source::sptr file_source_; - unpack_byte_2bit_cpx_samples_sptr unpack_byte_; gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_; + unpack_byte_2bit_cpx_samples_sptr unpack_byte_; #if GNURADIO_USES_STD_POINTERS std::shared_ptr valve_; #else @@ -126,7 +116,17 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; + std::string filename_; + std::string item_type_; + std::string dump_filename_; + std::string role_; size_t item_size_; + uint64_t samples_; + int64_t sampling_frequency_; + unsigned int in_streams_; + unsigned int out_streams_; + bool repeat_; + bool dump_; // Throttle control bool enable_throttle_control_; }; diff --git a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h index 21ace2c68..67e46ad9f 100644 --- a/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/two_bit_packed_file_signal_source.h @@ -125,16 +125,6 @@ public: } private: - uint64_t samples_; - int64_t sampling_frequency_; - std::string filename_; - std::string item_type_; - bool repeat_; - bool dump_; - std::string dump_filename_; - std::string role_; - unsigned int in_streams_; - unsigned int out_streams_; gr::blocks::file_source::sptr file_source_; unpack_2bit_samples_sptr unpack_samples_; gr::basic_block_sptr char_to_float_; @@ -145,12 +135,22 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; + std::string filename_; + std::string item_type_; + std::string dump_filename_; + std::string role_; + std::string sample_type_; + uint64_t samples_; + int64_t sampling_frequency_; size_t item_size_; + unsigned int in_streams_; + unsigned int out_streams_; bool big_endian_items_; bool big_endian_bytes_; bool is_complex_; bool reverse_interleaving_; - std::string sample_type_; + bool repeat_; + bool dump_; // Throttle control bool enable_throttle_control_; }; diff --git a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h index 57d11db3d..c740b8be7 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/gr_complex_ip_packet_source.h @@ -75,27 +75,6 @@ public: gr_vector_void_star &output_items); private: - boost::mutex d_mutex; - pcap_t *descr; // ethernet pcap device descriptor - char *fifo_buff; - int fifo_read_ptr; - int fifo_write_ptr; - int fifo_items; - int d_sock_raw; - int d_udp_port; - // clang-format off - struct sockaddr_in si_me{}; - // clang-format on - std::string d_src_device; - std::string d_origin_address; - int d_udp_payload_size; - bool d_fifo_full; - int d_n_baseband_channels; - int d_wire_sample_type; - int d_bytes_per_sample; - size_t d_item_size; - bool d_IQ_swap; - boost::thread *d_pcap_thread; void demux_samples(const gr_vector_void_star &output_items, int num_samples_readed); void my_pcap_loop_thread(pcap_t *pcap_handle); void pcap_callback(u_char *args, const struct pcap_pkthdr *pkthdr, const u_char *packet); @@ -105,6 +84,26 @@ private: * If any of these fail, the function returns the error and exits. */ bool open(); + + boost::thread *d_pcap_thread; + boost::mutex d_mutex; + struct sockaddr_in si_me{}; + std::string d_src_device; + std::string d_origin_address; + pcap_t *descr; // ethernet pcap device descriptor + size_t d_item_size; + char *fifo_buff; + int fifo_read_ptr; + int fifo_write_ptr; + int fifo_items; + int d_sock_raw; + int d_udp_port; + int d_udp_payload_size; + int d_n_baseband_channels; + int d_wire_sample_type; + int d_bytes_per_sample; + bool d_IQ_swap; + bool d_fifo_full; }; #endif // GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc index d3485f525..c69f71fba 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.cc @@ -55,11 +55,11 @@ rtl_tcp_signal_source_c::rtl_tcp_signal_source_c(const std::string &address, : gr::sync_block("rtl_tcp_signal_source_c", gr::io_signature::make(0, 0, 0), gr::io_signature::make(1, 1, sizeof(gr_complex))), + buffer_(RTL_TCP_BUFFER_SIZE), socket_(io_context_), data_(RTL_TCP_PAYLOAD_SIZE), - flip_iq_(flip_iq), - buffer_(RTL_TCP_BUFFER_SIZE), - unread_(0) + unread_(0), + flip_iq_(flip_iq) { boost::system::error_code ec; diff --git a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h index ee33591f6..508f330b9 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h +++ b/src/algorithms/signal_source/gnuradio_blocks/rtl_tcp_signal_source_c.h @@ -82,8 +82,6 @@ public: void set_if_gain(int gain); private: - using buffer_type = boost::circular_buffer_space_optimized; - friend rtl_tcp_signal_source_c_sptr rtl_tcp_make_signal_source_c(const std::string &address, int16_t port, @@ -93,24 +91,6 @@ private: int16_t port, bool flip_iq); - Rtl_Tcp_Dongle_Info info_; - - // IO members - b_io_context io_context_; - boost::asio::ip::tcp::socket socket_; - std::vector data_; - bool flip_iq_; - - // producer-consumer helpers - boost::mutex mutex_; - boost::condition not_full_; - boost::condition not_empty_; - buffer_type buffer_; - size_t unread_; - - // lookup for scaling data - boost::array lookup_{}; - // async read callback void handle_read(const boost::system::error_code &ec, size_t bytes_transferred); @@ -124,6 +104,24 @@ private: { return unread_ > 0 || io_context_.stopped(); } + + boost::circular_buffer_space_optimized buffer_; + // producer-consumer helpers + boost::mutex mutex_; + boost::condition not_full_; + boost::condition not_empty_; + + // lookup for scaling data + boost::array lookup_{}; + + // IO members + b_io_context io_context_; + boost::asio::ip::tcp::socket socket_; + std::vector data_; + + Rtl_Tcp_Dongle_Info info_; + size_t unread_; + bool flip_iq_; }; #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index fb7db95fc..cc48d3341 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -103,8 +103,8 @@ unpack_2bit_samples::unpack_2bit_samples(bool big_endian_bytes, gr::io_signature::make(1, 1, item_size), gr::io_signature::make(1, 1, sizeof(char)), 4 * item_size), // we make 4 bytes out for every byte in - big_endian_bytes_(big_endian_bytes), item_size_(item_size), + big_endian_bytes_(big_endian_bytes), big_endian_items_(big_endian_items), swap_endian_items_(false), reverse_interleaving_(reverse_interleaving) diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h index 85b4d6675..4c1f18417 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.h @@ -106,13 +106,13 @@ private: bool big_endian_items, bool reverse_interleaving); - bool big_endian_bytes_; + std::vector work_buffer_; size_t item_size_; + bool big_endian_bytes_; bool big_endian_items_; bool swap_endian_items_; bool swap_endian_bytes_; bool reverse_interleaving_; - std::vector work_buffer_; }; #endif // GNSS_SDR_UNPACK_2BIT_SAMPLES_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h index 398b22b71..6933d595a 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_spir_gss6450_samples.h @@ -42,14 +42,14 @@ unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(unsigned int a class unpack_spir_gss6450_samples : public gr::sync_interpolator { public: - int work(int noutput_items, - gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); - void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits_); explicit unpack_spir_gss6450_samples(unsigned int adc_nbit); ~unpack_spir_gss6450_samples() = default; + void decode_4bits_word(uint32_t input_uint32, gr_complex *out, int adc_bits_); + int work(int noutput_items, + gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); private: + friend unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples_sptr(unsigned int adc_nbit); unsigned int adc_bits; unsigned int samples_per_int; }; diff --git a/src/algorithms/signal_source/libs/fpga_switch.h b/src/algorithms/signal_source/libs/fpga_switch.h index 11c2a4803..ddcb90a95 100644 --- a/src/algorithms/signal_source/libs/fpga_switch.h +++ b/src/algorithms/signal_source/libs/fpga_switch.h @@ -55,12 +55,12 @@ private: static const uint32_t TEST_REGISTER_TRACK_WRITEVAL = 0x55AA; static const uint32_t MAX_LENGTH_DEVICEIO_NAME = 50; - int d_device_descriptor; // driver descriptor - volatile unsigned* d_map_base; // driver memory map - // private functions unsigned fpga_switch_test_register(unsigned writeval); void close_device(void); + + volatile unsigned* d_map_base; // driver memory map + int d_device_descriptor; // driver descriptor }; #endif // GNSS_SDR_FPGA_SWITCH_H diff --git a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h index 498e734a8..9ccb6e479 100644 --- a/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h +++ b/src/algorithms/telemetry_decoder/libs/viterbi_decoder.h @@ -74,31 +74,6 @@ private: int refcount; }; - // code properties - int d_KK; - int d_nn; - - // derived code properties - int d_mm; - int d_states; - int d_number_symbols; - - // trellis definition - std::vector d_out0; - std::vector d_state0; - std::vector d_out1; - std::vector d_state1; - - // trellis state - std::vector d_pm_t; - std::deque d_trellis_paths; - std::vector d_metric_c; /* Set of all possible branch metrics */ - std::vector d_rec_array; /* Received values for one trellis section */ - bool d_trellis_state_is_initialised; - - // measures - float d_indicator_metric; - // operations on the trellis (change decoder state) void init_trellis_state(); int do_acs(const double sym[], int nbits); @@ -112,6 +87,31 @@ private: void nsc_transit(int output_p[], int trans_p[], int input, const int g[], int KK, int nn); int nsc_enc_bit(int state_out_p[], int input, int state_in, const int g[], int KK, int nn); int parity_counter(int symbol, int length); + + // trellis state + std::deque d_trellis_paths; + std::vector d_pm_t; + std::vector d_metric_c; /* Set of all possible branch metrics */ + std::vector d_rec_array; /* Received values for one trellis section */ + + // trellis definition + std::vector d_out0; + std::vector d_state0; + std::vector d_out1; + std::vector d_state1; + + // measures + float d_indicator_metric; + + // code properties + int d_KK; + int d_nn; + + // derived code properties + int d_mm; + int d_states; + int d_number_symbols; + bool d_trellis_state_is_initialised; }; #endif // GNSS_SDR_VITERBI_DECODER_H diff --git a/src/algorithms/tracking/libs/bayesian_estimation.h b/src/algorithms/tracking/libs/bayesian_estimation.h index fa708de3f..1ea4cf6c8 100644 --- a/src/algorithms/tracking/libs/bayesian_estimation.h +++ b/src/algorithms/tracking/libs/bayesian_estimation.h @@ -73,11 +73,10 @@ public: private: arma::vec mu_est; arma::mat Psi_est; - arma::vec mu_prior; + arma::mat Psi_prior; int kappa_prior; int nu_prior; - arma::mat Psi_prior; }; #endif diff --git a/src/algorithms/tracking/libs/cuda_multicorrelator.h b/src/algorithms/tracking/libs/cuda_multicorrelator.h index c5284043d..89f643370 100644 --- a/src/algorithms/tracking/libs/cuda_multicorrelator.h +++ b/src/algorithms/tracking/libs/cuda_multicorrelator.h @@ -132,6 +132,9 @@ public: int n_correlators); private: + cudaStream_t stream1; + // cudaStream_t stream2; + // Allocate the device input vectors GPU_Complex* d_sig_in; GPU_Complex* d_nco_in; @@ -142,16 +145,14 @@ private: std::complex* d_sig_in_cpu; std::complex* d_corr_out_cpu; - int* d_shifts_samples; float* d_shifts_chips; + int* d_shifts_samples; int d_code_length_chips; int selected_gps_device; int threadsPerBlock; int blocksPerGrid; - cudaStream_t stream1; - // cudaStream_t stream2; int num_gpu_devices; int selected_device; };