diff --git a/src/algorithms/observables/adapters/hybrid_observables.h b/src/algorithms/observables/adapters/hybrid_observables.h index 5633e8ff1..da491131a 100644 --- a/src/algorithms/observables/adapters/hybrid_observables.h +++ b/src/algorithms/observables/adapters/hybrid_observables.h @@ -74,12 +74,12 @@ public: private: hybrid_observables_gs_sptr observables_; - bool dump_; - bool dump_mat_; std::string dump_filename_; std::string role_; unsigned int in_streams_; unsigned int out_streams_; + bool dump_; + bool dump_mat_; }; #endif diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc index f909c43c0..557e3a670 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.cc @@ -336,7 +336,7 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource() } -void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA) +void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, bool enable_DMA) { const int MAX_INPUT_SAMPLES_TOTAL = 16384; int max_value = 0; diff --git a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h index a861ac844..db3262c43 100644 --- a/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad9361_fpga_signal_source.h @@ -65,54 +65,57 @@ public: gr::basic_block_sptr get_right_block() override; private: + void run_DMA_process(const std::string &FreqBand, + const std::string &Filename1, + const std::string &Filename2, + bool enable_DMA); + + std::thread thread_file_to_dma; + + std::shared_ptr switch_fpga; + std::string role_; // Front-end settings - uint64_t freq_; // frequency of local oscillator - uint64_t sample_rate_; - uint64_t bandwidth_; - bool quadrature_; - bool rf_dc_; - bool bb_dc_; - bool rx1_enable_; - bool rx2_enable_; std::string gain_mode_rx1_; std::string gain_mode_rx2_; - double rf_gain_rx1_; - double rf_gain_rx2_; std::string rf_port_select_; std::string filter_file_; - bool filter_auto_; std::string filter_source_; std::string filter_filename_; - float Fpass_; - float Fstop_; - - // DDS configuration for LO generation for external mixer - bool enable_dds_lo_; - uint64_t freq_rf_tx_hz_; - uint64_t freq_dds_tx_hz_; - uint64_t tx_bandwidth_; - double scale_dds_dbfs_; - double phase_dds_deg_; - double tx_attenuation_db_; - - uint32_t in_stream_; - uint32_t out_stream_; - - size_t item_size_; - - std::shared_ptr switch_fpga; - int32_t switch_position; - - std::thread thread_file_to_dma; std::string filename_rx1; std::string filename_rx2; std::string freq_band; + double rf_gain_rx1_; + double rf_gain_rx2_; + uint64_t freq_; // frequency of local oscillator + uint64_t sample_rate_; + uint64_t bandwidth_; + float Fpass_; + float Fstop_; + + // DDS configuration for LO generation for external mixer + double scale_dds_dbfs_; + double phase_dds_deg_; + double tx_attenuation_db_; + uint64_t freq_rf_tx_hz_; + uint64_t freq_dds_tx_hz_; + uint64_t tx_bandwidth_; + size_t item_size_; + uint32_t in_stream_; + uint32_t out_stream_; + int32_t switch_position; + bool enable_dds_lo_; + + bool filter_auto_; + bool quadrature_; + bool rf_dc_; + bool bb_dc_; + bool rx1_enable_; + bool rx2_enable_; bool enable_DMA_; bool rf_shutdown_; - void run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA); }; #endif // GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/file_signal_source.h b/src/algorithms/signal_source/adapters/file_signal_source.h index 7624bd4a1..07c0e34b4 100644 --- a/src/algorithms/signal_source/adapters/file_signal_source.h +++ b/src/algorithms/signal_source/adapters/file_signal_source.h @@ -103,16 +103,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_; #if GNURADIO_USES_STD_POINTERS std::shared_ptr valve_; @@ -121,9 +111,22 @@ private: #endif gr::blocks::file_sink::sptr sink_; gr::blocks::throttle::sptr throttle_; + + std::string role_; + std::string item_type_; + std::string filename_; + std::string dump_filename_; + + uint64_t samples_; + int64_t sampling_frequency_; size_t item_size_; - // Throttle control + + uint32_t in_streams_; + uint32_t out_streams_; + bool enable_throttle_control_; + bool repeat_; + bool dump_; }; #endif // GNSS_SDR_FILE_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/flexiband_signal_source.h b/src/algorithms/signal_source/adapters/flexiband_signal_source.h index 3f8be56f6..f0d1d5239 100644 --- a/src/algorithms/signal_source/adapters/flexiband_signal_source.h +++ b/src/algorithms/signal_source/adapters/flexiband_signal_source.h @@ -76,29 +76,30 @@ public: gr::basic_block_sptr get_right_block(int RF_channel) override; private: - std::string role_; - unsigned int in_stream_; - unsigned int out_stream_; - std::string item_type_; - size_t item_size_; - - std::string firmware_filename_; - int gain1_; - int gain2_; - int gain3_; - int usb_packet_buffer_size_; - bool AGC_; - std::string signal_file; - bool flag_read_file; - - int n_channels_; - int sel_ch_; - boost::shared_ptr flexiband_source_; std::vector> char_to_float; std::vector> float_to_complex_; std::vector null_sinks_; + + std::string role_; + std::string item_type_; + std::string firmware_filename_; + std::string signal_file; + + size_t item_size_; + unsigned int in_stream_; + unsigned int out_stream_; + + int gain1_; + int gain2_; + int gain3_; + int usb_packet_buffer_size_; + int n_channels_; + int sel_ch_; + + bool AGC_; + bool flag_read_file; }; #endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h index 0e30fc0d1..dafe00b32 100644 --- a/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h +++ b/src/algorithms/signal_source/adapters/fmcomms2_signal_source.h @@ -74,51 +74,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 rx1_en_; - bool rx2_en_; - bool quadrature_; - bool rf_dc_; - bool bb_dc_; - int RF_channels_; - std::string gain_mode_rx1_; - std::string gain_mode_rx2_; - double rf_gain_rx1_; - double rf_gain_rx2_; - std::string rf_port_select_; - std::string filter_file_; - bool filter_auto_; - std::string filter_source_; - std::string filter_filename_; - float Fpass_; - float Fstop_; - bool rf_shutdown_; - - // DDS configuration for LO generation for external mixer - bool enable_dds_lo_; - uint64_t freq_rf_tx_hz_; - uint64_t freq_dds_tx_hz_; - double scale_dds_dbfs_; - double phase_dds_deg_; - double tx_attenuation_db_; - uint64_t tx_bandwidth_; - - 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::fmcomms2_source_f32c::sptr fmcomms2_source_f32c_; #if GNURADIO_USES_STD_POINTERS @@ -127,6 +82,53 @@ private: boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; + + std::string role_; + std::string item_type_; + std::string dump_filename_; + + // Front-end settings + std::string uri_; // device direction + std::string gain_mode_rx1_; + std::string gain_mode_rx2_; + std::string rf_port_select_; + std::string filter_file_; + std::string filter_source_; + std::string filter_filename_; + + int64_t samples_; + size_t item_size_; + + unsigned int in_stream_; + unsigned int out_stream_; + + double rf_gain_rx1_; + double rf_gain_rx2_; + uint64_t freq_; // frequency of local oscilator + uint64_t sample_rate_; + uint64_t bandwidth_; + uint64_t buffer_size_; // reception buffer + float Fpass_; + float Fstop_; + int RF_channels_; + + // DDS configuration for LO generation for external mixer + double scale_dds_dbfs_; + double phase_dds_deg_; + double tx_attenuation_db_; + uint64_t freq_rf_tx_hz_; + uint64_t freq_dds_tx_hz_; + uint64_t tx_bandwidth_; + bool enable_dds_lo_; + + bool rx1_en_; + bool rx2_en_; + bool quadrature_; + bool rf_dc_; + bool bb_dc_; + bool filter_auto_; + bool rf_shutdown_; + bool dump_; }; #endif // GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/labsat_signal_source.h b/src/algorithms/signal_source/adapters/labsat_signal_source.h index 67e170b8f..a52dbf16c 100644 --- a/src/algorithms/signal_source/adapters/labsat_signal_source.h +++ b/src/algorithms/signal_source/adapters/labsat_signal_source.h @@ -67,16 +67,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_; - std::string filename_; - bool dump_; - std::string dump_filename_; gr::block_sptr labsat23_source_; gr::blocks::file_sink::sptr file_sink_; + std::string role_; + std::string item_type_; + std::string filename_; + std::string dump_filename_; + unsigned int in_stream_; + unsigned int out_stream_; + size_t item_size_; + bool dump_; }; #endif // GNSS_SDR_LABSAT_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h index d514562e1..771e66acf 100644 --- a/src/algorithms/signal_source/adapters/osmosdr_signal_source.h +++ b/src/algorithms/signal_source/adapters/osmosdr_signal_source.h @@ -77,37 +77,36 @@ public: private: void driver_instance(); - std::string role_; - - // Front-end settings - bool AGC_enabled_; - double sample_rate_; - - 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_; - int64_t samples_; - bool dump_; - std::string dump_filename_; osmosdr::source::sptr osmosdr_source_; - std::string osmosdr_args_; - - std::string antenna_; - #if GNURADIO_USES_STD_POINTERS std::shared_ptr valve_; #else boost::shared_ptr valve_; #endif gr::blocks::file_sink::sptr file_sink_; + + std::string role_; + std::string item_type_; + std::string dump_filename_; + std::string osmosdr_args_; + std::string antenna_; + + // Front-end settings + double sample_rate_; + double freq_; + double gain_; + double if_gain_; + double rf_gain_; + + size_t item_size_; + int64_t samples_; + + unsigned int in_stream_; + unsigned int out_stream_; + + bool AGC_enabled_; + bool dump_; }; #endif // GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/adapters/uhd_signal_source.h b/src/algorithms/signal_source/adapters/uhd_signal_source.h index 91cfcb8c9..876ada0f2 100644 --- a/src/algorithms/signal_source/adapters/uhd_signal_source.h +++ b/src/algorithms/signal_source/adapters/uhd_signal_source.h @@ -75,34 +75,33 @@ public: gr::basic_block_sptr get_right_block(int RF_channel) override; private: - std::string role_; - unsigned int in_stream_; - unsigned int out_stream_; gr::uhd::usrp_source::sptr uhd_source_; - - // UHD SETTINGS - uhd::stream_args_t uhd_stream_args_; - std::string device_address_; - double sample_rate_; - int RF_channels_; - std::string item_type_; - size_t item_size_; - - std::string subdevice_; - std::string clock_source_; - - std::vector freq_; - std::vector gain_; - std::vector IF_bandwidth_hz_; - std::vector samples_; - std::vector dump_; - std::vector dump_filename_; #if GNURADIO_USES_STD_POINTERS std::vector> valve_; #else std::vector> valve_; #endif std::vector file_sink_; + std::vector freq_; + std::vector gain_; + std::vector IF_bandwidth_hz_; + std::vector samples_; + std::vector dump_filename_; + std::vector dump_; + + uhd::stream_args_t uhd_stream_args_; // UHD SETTINGS + + std::string device_address_; + std::string item_type_; + std::string subdevice_; + std::string clock_source_; + std::string role_; + + double sample_rate_; + size_t item_size_; + int RF_channels_; + unsigned int in_stream_; + unsigned int out_stream_; }; #endif // GNSS_SDR_UHD_SIGNAL_SOURCE_H diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h index 40bbee142..89f958aca 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.h @@ -71,16 +71,17 @@ private: std::string generate_filename(); void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type); int getBit(uint8_t byte, int position); - bool d_header_parsed; - uint8_t d_channel_selector; + + std::ifstream binary_input_file; + std::string d_signal_file_basename; + Concurrent_Queue *d_queue; int d_channel_selector_config; int d_current_file_number; uint8_t d_labsat_version; - std::string d_signal_file_basename; - std::ifstream binary_input_file; + uint8_t d_channel_selector; uint8_t d_ref_clock; uint8_t d_bits_per_sample; - Concurrent_Queue *d_queue; + bool d_header_parsed; }; #endif // GNSS_SDR_LABSAT23_SOURCE_H diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index 09bd27ad3..9f353a7fc 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -33,6 +33,10 @@ class Gnss_Synchro { public: + Gnss_Synchro() = default; //!< Default constructor + + ~Gnss_Synchro() = default; //!< Default destructor + // Satellite and signal info char System{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) char Signal[3]{}; //!< Set by Channel::set_signal(Gnss_Signal gnss_signal) @@ -44,7 +48,6 @@ public: double Acq_doppler_hz{}; //!< Set by Acquisition processing block uint64_t Acq_samplestamp_samples{}; //!< Set by Acquisition processing block uint32_t Acq_doppler_step{}; //!< Set by Acquisition processing block - bool Flag_valid_acquisition{}; //!< Set by Acquisition processing block // Tracking int64_t fs{}; //!< Set by Tracking processing block @@ -55,22 +58,21 @@ public: double Carrier_phase_rads{}; //!< Set by Tracking processing block double Code_phase_samples{}; //!< Set by Tracking processing block uint64_t Tracking_sample_counter{}; //!< Set by Tracking processing block - bool Flag_valid_symbol_output{}; //!< Set by Tracking processing block int32_t correlation_length_ms{}; //!< Set by Tracking processing block // Telemetry Decoder - bool Flag_valid_word{}; //!< Set by Telemetry Decoder processing block uint32_t TOW_at_current_symbol_ms{}; //!< Set by Telemetry Decoder processing block // Observables - double Pseudorange_m{}; //!< Set by Observables processing block - double RX_time{}; //!< Set by Observables processing block - bool Flag_valid_pseudorange{}; //!< Set by Observables processing block - double interp_TOW_ms{}; //!< Set by Observables processing block + double Pseudorange_m{}; //!< Set by Observables processing block + double RX_time{}; //!< Set by Observables processing block + double interp_TOW_ms{}; //!< Set by Observables processing block - Gnss_Synchro() = default; //!< Default constructor - - ~Gnss_Synchro() = default; //!< Default destructor + // Flags + bool Flag_valid_acquisition{}; //!< Set by Acquisition processing block + bool Flag_valid_symbol_output{}; //!< Set by Tracking processing block + bool Flag_valid_word{}; //!< Set by Telemetry Decoder processing block + bool Flag_valid_pseudorange{}; //!< Set by Observables processing block /// Copy constructor Gnss_Synchro(const Gnss_Synchro& other) noexcept @@ -94,7 +96,6 @@ public: this->Acq_doppler_hz = rhs.Acq_doppler_hz; this->Acq_samplestamp_samples = rhs.Acq_samplestamp_samples; this->Acq_doppler_step = rhs.Acq_doppler_step; - this->Flag_valid_acquisition = rhs.Flag_valid_acquisition; this->fs = rhs.fs; this->Prompt_I = rhs.Prompt_I; this->Prompt_Q = rhs.Prompt_Q; @@ -103,14 +104,15 @@ public: this->Carrier_phase_rads = rhs.Carrier_phase_rads; this->Code_phase_samples = rhs.Code_phase_samples; this->Tracking_sample_counter = rhs.Tracking_sample_counter; - this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output; this->correlation_length_ms = rhs.correlation_length_ms; - this->Flag_valid_word = rhs.Flag_valid_word; this->TOW_at_current_symbol_ms = rhs.TOW_at_current_symbol_ms; this->Pseudorange_m = rhs.Pseudorange_m; this->RX_time = rhs.RX_time; - this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange; this->interp_TOW_ms = rhs.interp_TOW_ms; + this->Flag_valid_acquisition = rhs.Flag_valid_acquisition; + this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output; + this->Flag_valid_word = rhs.Flag_valid_word; + this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange; } return *this; }; @@ -136,7 +138,6 @@ public: this->Acq_doppler_hz = other.Acq_doppler_hz; this->Acq_samplestamp_samples = other.Acq_samplestamp_samples; this->Acq_doppler_step = other.Acq_doppler_step; - this->Flag_valid_acquisition = other.Flag_valid_acquisition; this->fs = other.fs; this->Prompt_I = other.Prompt_I; this->Prompt_Q = other.Prompt_Q; @@ -145,14 +146,15 @@ public: this->Carrier_phase_rads = other.Carrier_phase_rads; this->Code_phase_samples = other.Code_phase_samples; this->Tracking_sample_counter = other.Tracking_sample_counter; - this->Flag_valid_symbol_output = other.Flag_valid_symbol_output; this->correlation_length_ms = other.correlation_length_ms; - this->Flag_valid_word = other.Flag_valid_word; this->TOW_at_current_symbol_ms = other.TOW_at_current_symbol_ms; this->Pseudorange_m = other.Pseudorange_m; this->RX_time = other.RX_time; - this->Flag_valid_pseudorange = other.Flag_valid_pseudorange; this->interp_TOW_ms = other.interp_TOW_ms; + this->Flag_valid_acquisition = other.Flag_valid_acquisition; + this->Flag_valid_symbol_output = other.Flag_valid_symbol_output; + this->Flag_valid_word = other.Flag_valid_word; + this->Flag_valid_pseudorange = other.Flag_valid_pseudorange; } return *this; }; @@ -178,7 +180,6 @@ public: ar& BOOST_SERIALIZATION_NVP(Acq_doppler_hz); ar& BOOST_SERIALIZATION_NVP(Acq_samplestamp_samples); ar& BOOST_SERIALIZATION_NVP(Acq_doppler_step); - ar& BOOST_SERIALIZATION_NVP(Flag_valid_acquisition); // Tracking ar& BOOST_SERIALIZATION_NVP(fs); ar& BOOST_SERIALIZATION_NVP(Prompt_I); @@ -188,16 +189,18 @@ public: ar& BOOST_SERIALIZATION_NVP(Carrier_phase_rads); ar& BOOST_SERIALIZATION_NVP(Code_phase_samples); ar& BOOST_SERIALIZATION_NVP(Tracking_sample_counter); - ar& BOOST_SERIALIZATION_NVP(Flag_valid_symbol_output); ar& BOOST_SERIALIZATION_NVP(correlation_length_ms); // Telemetry Decoder - ar& BOOST_SERIALIZATION_NVP(Flag_valid_word); ar& BOOST_SERIALIZATION_NVP(TOW_at_current_symbol_ms); // Observables ar& BOOST_SERIALIZATION_NVP(Pseudorange_m); ar& BOOST_SERIALIZATION_NVP(RX_time); - ar& BOOST_SERIALIZATION_NVP(Flag_valid_pseudorange); ar& BOOST_SERIALIZATION_NVP(interp_TOW_ms); + // Flags + ar& BOOST_SERIALIZATION_NVP(Flag_valid_acquisition); + ar& BOOST_SERIALIZATION_NVP(Flag_valid_symbol_output); + ar& BOOST_SERIALIZATION_NVP(Flag_valid_word); + ar& BOOST_SERIALIZATION_NVP(Flag_valid_pseudorange); } };