diff --git a/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.cc b/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.cc index 067bf0e3d..796126e03 100644 --- a/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.cc +++ b/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.cc @@ -65,8 +65,6 @@ Ad936xCustomSignalSource::Ad936xCustomSignalSource(const ConfigurationInterface* high_side_lo_(configuration->property(role + ".high_side_lo", false)), tx_lo_channel_(configuration->property(role + ".tx_lo_channel", 1)), rx0_to_rx1_delay_ns_(configuration->property(role + ".rx0_to_rx1_delay_ns", 0.0)) - - { if (item_type_ == "gr_complex") { @@ -186,7 +184,6 @@ Ad936xCustomSignalSource::Ad936xCustomSignalSource(const ConfigurationInterface* exit(1); } - if (dump_) { for (int n = 0; n < n_channels; n++) @@ -388,7 +385,6 @@ void Ad936xCustomSignalSource::connect(gr::top_block_sptr top_block) else { if (dump_) - { top_block->connect(gr_interleaved_short_to_complex_.at(n), 0, sink_.at(n), 0); DLOG(INFO) << "connected source to file sink"; @@ -520,6 +516,7 @@ gr::basic_block_sptr Ad936xCustomSignalSource::get_right_block() return gr_interleaved_short_to_complex_.at(0); } + gr::basic_block_sptr Ad936xCustomSignalSource::get_right_block(int RF_channel) { if (delay_enabled == true) diff --git a/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.h b/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.h index 4d4ae813c..bb9e98763 100644 --- a/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.h +++ b/src/algorithms/signal_source/adapters/ad936x_custom_signal_source.h @@ -83,7 +83,6 @@ private: std::vector unpack_byte_fourbits; std::vector unpack_byte_twobits; - std::string item_type_; size_t item_size_; int64_t samples_; diff --git a/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.cc b/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.cc index 3ac128a05..fecf2d28f 100644 --- a/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.cc +++ b/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.cc @@ -30,10 +30,10 @@ FourBitCpxFileSignalSource::FourBitCpxFileSignalSource( unsigned int in_streams, unsigned int out_streams, Concurrent_Queue* queue) : FileSourceBase(configuration, role, "Four_Bit_Cpx_File_Signal_Source"s, queue, "byte"s), + sample_type_(configuration->property(role + ".sample_type", "iq"s)), timestamp_file_(configuration->property(role + ".timestamp_filename"s, ""s)), timestamp_clock_offset_ms_(configuration->property(role + ".timestamp_clock_offset_ms"s, 0.0)) { - sample_type_ = configuration->property(role + ".sample_type", "iq"s); // the complex-ness of the input is inferred from the output type if (sample_type_ == "iq") { @@ -48,7 +48,6 @@ FourBitCpxFileSignalSource::FourBitCpxFileSignalSource( LOG(WARNING) << sample_type_ << " unrecognized sample type. Assuming: "; } - if (in_streams > 0) { LOG(ERROR) << "A signal source does not have an input stream"; @@ -83,8 +82,11 @@ std::tuple FourBitCpxFileSignalSource::itemTypeToSize() return std::make_tuple(item_size, is_complex); } + // 1 byte -> 1 complex samples double FourBitCpxFileSignalSource::packetsPerSample() const { return 1.0; } + + gnss_shared_ptr FourBitCpxFileSignalSource::source() const { if (timestamp_file_.size() > 1) @@ -114,6 +116,7 @@ void FourBitCpxFileSignalSource::create_file_source_hook() } } + void FourBitCpxFileSignalSource::pre_connect_hook(gr::top_block_sptr top_block) { top_block->connect(file_source(), 0, unpack_byte_, 0); @@ -126,6 +129,7 @@ void FourBitCpxFileSignalSource::pre_connect_hook(gr::top_block_sptr top_block) } } + void FourBitCpxFileSignalSource::pre_disconnect_hook(gr::top_block_sptr top_block) { if (timestamp_file_.size() > 1) diff --git a/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.h b/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.h index a36776afb..cedbb0741 100644 --- a/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.h +++ b/src/algorithms/signal_source/adapters/four_bit_cpx_file_signal_source.h @@ -1,5 +1,5 @@ /*! - * \file FOUR_BIT_cpx_file_signal_source.h + * \file four_bit_cpx_file_signal_source.h * \brief Interface of a class that reads signals samples from a 2 bit complex sampler front-end file * and adapts it to a SignalSourceInterface. * \author Javier Arribas, 2015 jarribas(at)cttc.es @@ -62,12 +62,11 @@ protected: private: unpack_byte_4bit_samples_sptr unpack_byte_; gr::blocks::interleaved_short_to_complex::sptr inter_shorts_to_cpx_; - std::string sample_type_; - bool reverse_interleaving_; - gnss_shared_ptr timestamp_block_; + std::string sample_type_; std::string timestamp_file_; double timestamp_clock_offset_ms_; + bool reverse_interleaving_; };