mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-22 19:17:40 +00:00
add signal_source_interface
also adds a base implementation that most signal sources should inherit from. The gen_signal_source is inexplicably different (probably as a test fixture, commonality was not valued). Only the file_signal_source has been tested; all the sources are modified in the same way, but we all know the only proof of correctness is testing. The block factory was simplified a bit. Handling for legacy config files was pulled out of the flowgraph; now when the "0" instance of a component (Foo0) is created, if there is no config for it, then the legacy version (Foo) will be tried. This is different from passing -1 for the item number (which is still supported). Theoretically, all existing config files should still work.
This commit is contained in:
@@ -92,6 +92,7 @@ endif()
|
||||
|
||||
|
||||
set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
||||
signal_source_base.cc
|
||||
file_signal_source.cc
|
||||
multichannel_file_signal_source.cc
|
||||
gen_signal_source.cc
|
||||
@@ -106,6 +107,7 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
||||
)
|
||||
|
||||
set(SIGNAL_SOURCE_ADAPTER_HEADERS
|
||||
signal_source_base.h
|
||||
file_signal_source.h
|
||||
multichannel_file_signal_source.h
|
||||
gen_signal_source.h
|
||||
|
@@ -42,9 +42,12 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(const ConfigurationInterface *configuration,
|
||||
const std::string &role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t> *queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t> *queue __attribute__((unused)))
|
||||
: SignalSourceBase(configuration, role, "Ad9361_Fpga_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_gain_mode("slow_attack");
|
||||
const double default_tx_attenuation_db = -10.0;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "fpga_dynamic_bit_selection.h"
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
class Ad9361FpgaSignalSource : public SignalSourceInterface
|
||||
class Ad9361FpgaSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
Ad9361FpgaSignalSource(const ConfigurationInterface *configuration,
|
||||
@@ -51,17 +51,12 @@ public:
|
||||
|
||||
void start() override;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Ad9361_Fpga_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Ad9361_Fpga_Signal_Source";
|
||||
return ;
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
@@ -93,8 +88,6 @@ private:
|
||||
std::shared_ptr<Fpga_Switch> switch_fpga;
|
||||
std::shared_ptr<Fpga_dynamic_bit_selection> dynamic_bit_selection_fpga;
|
||||
|
||||
std::string role_;
|
||||
|
||||
// Front-end settings
|
||||
std::string gain_mode_rx1_;
|
||||
std::string gain_mode_rx2_;
|
||||
|
@@ -21,9 +21,13 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
CustomUDPSignalSource::CustomUDPSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused)))
|
||||
: SignalSourceBase(configuration, role, "Custom_UDP_Signal_Source"s)
|
||||
, in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
|
@@ -18,10 +18,9 @@
|
||||
#ifndef GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "gr_complex_ip_packet_source.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/blocks/null_sink.h>
|
||||
@@ -42,29 +41,15 @@ class ConfigurationInterface;
|
||||
* \brief This class reads from UDP packets, which streams interleaved
|
||||
* I/Q samples over a network.
|
||||
*/
|
||||
class CustomUDPSignalSource : public SignalSourceInterface
|
||||
class CustomUDPSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
CustomUDPSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~CustomUDPSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Custom_UDP_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Custom_UDP_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -81,7 +66,6 @@ private:
|
||||
std::vector<gnss_shared_ptr<gr::block>> null_sinks_;
|
||||
std::vector<gnss_shared_ptr<gr::block>> file_sink_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
|
||||
|
@@ -27,10 +27,13 @@
|
||||
#include <iostream> // for std::cerr
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
FileSignalSource::FileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
FileSignalSource::FileSignalSource(ConfigurationInterface const* configuration,
|
||||
std::string const& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "File_Signal_Source"s)
|
||||
, in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("./example_capture.dat");
|
||||
const std::string default_item_type("short");
|
||||
|
@@ -21,10 +21,9 @@
|
||||
#ifndef GNSS_SDR_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/blocks/file_source.h>
|
||||
#include <gnuradio/blocks/throttle.h>
|
||||
@@ -47,29 +46,15 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class FileSignalSource : public SignalSourceInterface
|
||||
class FileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
FileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
FileSignalSource(ConfigurationInterface const* configuration, std::string const& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~FileSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -111,7 +96,6 @@ private:
|
||||
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_;
|
||||
|
@@ -23,12 +23,15 @@
|
||||
#include <teleorbit/frontend.h>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
FlexibandSignalSource::FlexibandSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused)))
|
||||
: SignalSourceBase(configuration, role, "Flexiband_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("byte");
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
@@ -20,10 +20,9 @@
|
||||
#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/char_to_float.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/blocks/float_to_complex.h>
|
||||
@@ -47,7 +46,7 @@ class ConfigurationInterface;
|
||||
* \brief This class configures and reads samples from Teleorbit Flexiband front-end.
|
||||
* This software requires a Flexiband GNU Radio driver installed (not included with GNSS-SDR).
|
||||
*/
|
||||
class FlexibandSignalSource : public SignalSourceInterface
|
||||
class FlexibandSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
FlexibandSignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -56,19 +55,6 @@ public:
|
||||
|
||||
~FlexibandSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Flexiband_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Flexiband_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -87,7 +73,6 @@ private:
|
||||
std::vector<boost::shared_ptr<gr::block>> float_to_complex_;
|
||||
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string firmware_filename_;
|
||||
std::string signal_file;
|
||||
|
@@ -29,10 +29,12 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
Fmcomms2SignalSource::Fmcomms2SignalSource(const ConfigurationInterface *configuration,
|
||||
const std::string &role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t> *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t> *queue)
|
||||
: SignalSourceBase(configuration, role, "Fmcomms2_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
|
@@ -20,9 +20,8 @@
|
||||
#ifndef GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#if GRIIO_INCLUDE_HAS_GNURADIO
|
||||
#include <gnuradio/iio/fmcomms2_source.h>
|
||||
@@ -43,7 +42,7 @@
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
class Fmcomms2SignalSource : public SignalSourceInterface
|
||||
class Fmcomms2SignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
Fmcomms2SignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -52,19 +51,6 @@ public:
|
||||
|
||||
~Fmcomms2SignalSource();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Fmcomms2_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Fmcomms2_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -80,7 +66,6 @@ private:
|
||||
gnss_shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
|
||||
|
@@ -55,6 +55,8 @@ public:
|
||||
//! Returns "Signal Source"
|
||||
inline std::string implementation() override { return "Signal Source"; }
|
||||
inline size_t item_size() override { return 0; }
|
||||
inline size_t getRfChannels() const final { return 0; }
|
||||
|
||||
inline std::shared_ptr<GNSSBlockInterface> signal_generator() const { return signal_generator_; }
|
||||
|
||||
private:
|
||||
|
@@ -20,12 +20,15 @@
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gn3s/gn3s_source_cc.h>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
Gn3sSignalSource::Gn3sSignalSource(const ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Gn3s_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("short");
|
||||
const std::string default_dump_file("./data/gn3s_source.dat");
|
||||
|
@@ -18,10 +18,9 @@
|
||||
#ifndef GNSS_SDR_GN3S_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_GN3S_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <pmt/pmt.h>
|
||||
@@ -40,7 +39,7 @@ class ConfigurationInterface;
|
||||
/*!
|
||||
* \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler
|
||||
*/
|
||||
class Gn3sSignalSource : public SignalSourceInterface
|
||||
class Gn3sSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
Gn3sSignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -49,19 +48,6 @@ public:
|
||||
|
||||
~Gn3sSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Gn3s_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Gn3s_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -75,11 +61,10 @@ public:
|
||||
private:
|
||||
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_;
|
||||
[[maybe_unused]] int64_t samples_;
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
bool dump_;
|
||||
|
@@ -18,12 +18,13 @@
|
||||
#include "configuration_interface.h"
|
||||
#include "labsat23_source.h"
|
||||
#include <glog/logging.h>
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
LabsatSignalSource::LabsatSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Labsat_Signal_Source"s)
|
||||
, in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./labsat_output.dat");
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#ifndef GNSS_SDR_LABSAT_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_LABSAT_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
@@ -40,29 +40,15 @@ class ConfigurationInterface;
|
||||
/*!
|
||||
* \brief This class reads samples stored by a LabSat 2 or LabSat 3 device
|
||||
*/
|
||||
class LabsatSignalSource : public SignalSourceInterface
|
||||
class LabsatSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
LabsatSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~LabsatSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Labsat_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Labsat_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -78,7 +64,6 @@ private:
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string filename_;
|
||||
std::string dump_filename_;
|
||||
|
@@ -27,18 +27,22 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
MultichannelFileSignalSource::MultichannelFileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Multichannel_File_Signal_Source"s)
|
||||
, in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("./example_capture.dat");
|
||||
const std::string default_item_type("short");
|
||||
const std::string default_dump_filename("./my_capture.dat");
|
||||
const std::string default_filename("./example_capture.dat"s);
|
||||
const std::string default_item_type("short"s);
|
||||
const std::string default_dump_filename("./my_capture.dat"s);
|
||||
|
||||
const double default_seconds_to_skip = 0.0;
|
||||
samples_ = configuration->property(role + ".samples", static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency", static_cast<int64_t>(0));
|
||||
n_channels_ = configuration->property(role + ".total_channels", 1);
|
||||
samples_ = configuration->property(role + ".samples"s, static_cast<uint64_t>(0));
|
||||
sampling_frequency_ = configuration->property(role + ".sampling_frequency"s, static_cast<int64_t>(0));
|
||||
n_channels_ = configuration->property(role + ".total_channels"s, 1);
|
||||
|
||||
for (int32_t n = 0; n < n_channels_; n++)
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
@@ -47,29 +47,15 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from files at different frequency bands
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class MultichannelFileSignalSource : public SignalSourceInterface
|
||||
class MultichannelFileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
MultichannelFileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~MultichannelFileSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Multichannel_File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Multichannel_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -112,7 +98,6 @@ private:
|
||||
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
|
||||
std::vector<std::string> filename_vec_;
|
||||
std::string item_type_;
|
||||
std::string role_;
|
||||
uint64_t samples_;
|
||||
int64_t sampling_frequency_;
|
||||
size_t item_size_;
|
||||
|
@@ -27,10 +27,13 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Nsr_File_Signal_Source"s)
|
||||
, in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
@@ -76,14 +79,14 @@ NsrFileSignalSource::NsrFileSignalSource(const ConfigurationInterface* configura
|
||||
<< "The receiver was configured to work with a file signal source\n"
|
||||
<< "but the specified file is unreachable by GNSS-SDR.\n"
|
||||
<< "Please modify your configuration file\n"
|
||||
<< "and point SignalSource.filename to a valid raw data file. Then:\n"
|
||||
<< "and point " << role << ".filename to a valid raw data file. Then:\n"
|
||||
<< "$ gnss-sdr --config_file=/path/to/my_GNSS_SDR_configuration.conf\n"
|
||||
<< "Examples of configuration files available at:\n"
|
||||
<< GNSSSDR_INSTALL_DIR "/share/gnss-sdr/conf/\n";
|
||||
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
throw(e);
|
||||
LOG(WARNING) << "nsr_file_signal_source: Unable to open the samples file "
|
||||
<< filename_ << ", exiting the program.";
|
||||
throw;
|
||||
}
|
||||
|
||||
DLOG(INFO) << "file_source(" << file_source_->unique_id() << ")";
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
@@ -44,27 +44,14 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class NsrFileSignalSource : public SignalSourceInterface
|
||||
class NsrFileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
NsrFileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~NsrFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Nsr_File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Nsr_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
@@ -113,7 +100,6 @@ private:
|
||||
std::string filename_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
uint32_t in_streams_;
|
||||
uint32_t out_streams_;
|
||||
bool repeat_;
|
||||
|
@@ -25,9 +25,13 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
OsmosdrSignalSource::OsmosdrSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Osmosdr_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
const std::string empty;
|
||||
|
@@ -19,10 +19,9 @@
|
||||
#ifndef GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <cstdint>
|
||||
@@ -44,7 +43,7 @@ class ConfigurationInterface;
|
||||
* HackRF or Realtek's RTL2832U-based USB dongle DVB-T receivers
|
||||
* (see https://osmocom.org/projects/rtl-sdr/wiki)
|
||||
*/
|
||||
class OsmosdrSignalSource : public SignalSourceInterface
|
||||
class OsmosdrSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
OsmosdrSignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -53,19 +52,6 @@ public:
|
||||
|
||||
~OsmosdrSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Osmosdr_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Osmosdr_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -83,7 +69,6 @@ private:
|
||||
gnss_shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
std::string osmosdr_args_;
|
||||
|
@@ -24,9 +24,13 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
PlutosdrSignalSource::PlutosdrSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Plutosdr_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
|
@@ -19,9 +19,8 @@
|
||||
#ifndef GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#if GRIIO_INCLUDE_HAS_GNURADIO
|
||||
#include <gnuradio/iio/pluto_source.h>
|
||||
@@ -44,7 +43,7 @@ class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
*/
|
||||
class PlutosdrSignalSource : public SignalSourceInterface
|
||||
class PlutosdrSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
PlutosdrSignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -53,18 +52,6 @@ public:
|
||||
|
||||
~PlutosdrSignalSource() = default;
|
||||
|
||||
std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Plutosdr_Signal_Source"
|
||||
*/
|
||||
std::string implementation() override
|
||||
{
|
||||
return "Plutosdr_Signal_Source";
|
||||
}
|
||||
size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -81,7 +68,6 @@ private:
|
||||
gnss_shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
|
||||
std::string role_;
|
||||
std::string dump_filename_;
|
||||
|
||||
// Front-end settings
|
||||
|
@@ -23,8 +23,11 @@
|
||||
#include <dbfcttc/raw_array.h>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
RawArraySignalSource::RawArraySignalSource(const ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Raw_Array_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
const std::string default_item_type("gr_complex");
|
||||
const std::string default_dump_file("./data/raw_array_source.dat");
|
||||
|
@@ -18,10 +18,9 @@
|
||||
#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/hier_block2.h>
|
||||
#include <pmt/pmt.h>
|
||||
@@ -41,7 +40,7 @@ class ConfigurationInterface;
|
||||
/*!
|
||||
* \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler
|
||||
*/
|
||||
class RawArraySignalSource : public SignalSourceInterface
|
||||
class RawArraySignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
RawArraySignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -50,19 +49,6 @@ public:
|
||||
|
||||
~RawArraySignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "RawArraySignalSource".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Raw_Array_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -76,12 +62,11 @@ public:
|
||||
private:
|
||||
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_;
|
||||
[[maybe_unused]] int64_t samples_;
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
bool dump_;
|
||||
|
@@ -25,14 +25,15 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
RtlTcpSignalSource::RtlTcpSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_stream_(in_stream),
|
||||
out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "RtlTcp_Signal_Source"s)
|
||||
, in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
const std::string default_dump_file("./data/signal_source.dat");
|
||||
|
@@ -18,10 +18,9 @@
|
||||
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include "rtl_tcp_signal_source_c.h"
|
||||
#include <gnuradio/blocks/deinterleave.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
@@ -44,10 +43,9 @@ class ConfigurationInterface;
|
||||
* I/Q samples over TCP.
|
||||
* (see https://osmocom.org/projects/rtl-sdr/wiki)
|
||||
*/
|
||||
class RtlTcpSignalSource : public SignalSourceInterface
|
||||
class RtlTcpSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
RtlTcpSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
@@ -56,19 +54,6 @@ public:
|
||||
|
||||
~RtlTcpSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "RtlTcp_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "RtlTcp_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -87,7 +72,6 @@ private:
|
||||
gnss_shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
|
||||
|
46
src/algorithms/signal_source/adapters/signal_source_base.cc
Normal file
46
src/algorithms/signal_source/adapters/signal_source_base.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*!
|
||||
* \file signal_source_base.cc
|
||||
* \brief Base class for signal sources
|
||||
* \author Jim Melton, 2020. jim.melton(at)sncorp.com
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "configuration_interface.h"
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
std::string SignalSourceBase::role()
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
std::string SignalSourceBase::implementation()
|
||||
{
|
||||
return implementation_;
|
||||
}
|
||||
|
||||
size_t SignalSourceBase::getRfChannels() const
|
||||
{
|
||||
return rfChannels_;
|
||||
}
|
||||
|
||||
SignalSourceBase::SignalSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl)
|
||||
: SignalSourceInterface(), role_(role), implementation_(impl), connected_(false), rfChannels_(configuration->property(role + ".RF_channels"s, 1u))
|
||||
{
|
||||
}
|
||||
|
52
src/algorithms/signal_source/adapters/signal_source_base.h
Normal file
52
src/algorithms/signal_source/adapters/signal_source_base.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*!
|
||||
* \file signal_source_base.h
|
||||
* \brief Header file of the base class to signal_source GNSS blocks.
|
||||
* \author Jim Melton, 2020. jim.melton(at)sncorp.com
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_SIGNAL_SOURCE_BASE_H
|
||||
#define GNSS_SDR_SIGNAL_SOURCE_BASE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
class SignalSourceBase : public SignalSourceInterface
|
||||
{
|
||||
public:
|
||||
std::string role() final;
|
||||
std::string implementation() final;
|
||||
|
||||
size_t getRfChannels() const override;
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
SignalSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl);
|
||||
|
||||
private:
|
||||
std::string const role_;
|
||||
std::string const implementation_;
|
||||
bool connected_;
|
||||
size_t rfChannels_;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -28,9 +28,13 @@
|
||||
#include <utility>
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
SpirFileSignalSource::SpirFileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Spir_File_Signal_Source"s)
|
||||
, in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("int");
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
@@ -47,28 +47,15 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class SpirFileSignalSource : public SignalSourceInterface
|
||||
class SpirFileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
SpirFileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~SpirFileSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Spir_File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Spir_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
@@ -114,7 +101,6 @@ private:
|
||||
std::string filename_;
|
||||
std::string item_type_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
|
||||
uint64_t samples_;
|
||||
int64_t sampling_frequency_;
|
||||
|
@@ -25,9 +25,12 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
const std::string& role, uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Spir_GSS6450_File_Signal_Source"s)
|
||||
, in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_dump_filename("../data/my_capture_dump.dat");
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
@@ -51,23 +51,12 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class SpirGSS6450FileSignalSource : public SignalSourceInterface
|
||||
class SpirGSS6450FileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
SpirGSS6450FileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Spir_GSS6450_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -115,7 +104,6 @@ private:
|
||||
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
|
||||
std::string filename_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
std::string item_type_;
|
||||
uint64_t samples_;
|
||||
int64_t sampling_frequency_;
|
||||
|
@@ -26,15 +26,16 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Two_Bit_Cpx_File_Signal_Source"s), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#ifndef GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "unpack_byte_2bit_cpx_samples.h"
|
||||
@@ -45,10 +45,9 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class TwoBitCpxFileSignalSource : public SignalSourceInterface
|
||||
class TwoBitCpxFileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
TwoBitCpxFileSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
@@ -56,18 +55,6 @@ public:
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~TwoBitCpxFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Two_Bit_Cpx_File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Two_Bit_Cpx_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
@@ -114,7 +101,6 @@ private:
|
||||
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_;
|
||||
|
@@ -28,15 +28,17 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(
|
||||
const ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "Two_Bit_Packed_File_Signal_Source"s)
|
||||
, in_streams_(in_streams)
|
||||
, out_streams_(out_streams)
|
||||
{
|
||||
const std::string default_filename("../data/my_capture.dat");
|
||||
const std::string default_item_type("byte");
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#ifndef GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "unpack_2bit_samples.h"
|
||||
@@ -47,27 +47,14 @@ class ConfigurationInterface;
|
||||
* \brief Class that reads signals samples from a file
|
||||
* and adapts it to a SignalSourceInterface
|
||||
*/
|
||||
class TwoBitPackedFileSignalSource : public SignalSourceInterface
|
||||
class TwoBitPackedFileSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
void fixme() final {}
|
||||
TwoBitPackedFileSignalSource(const ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~TwoBitPackedFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "Two_Bit_Packed_File_Signal_Source".
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "Two_Bit_Packed_File_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
@@ -134,7 +121,6 @@ private:
|
||||
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_;
|
||||
|
@@ -25,10 +25,13 @@
|
||||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
UhdSignalSource::UhdSignalSource(const ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
: SignalSourceBase(configuration, role, "UHD_Signal_Source"s), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
const std::string empty;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#ifndef GNSS_SDR_UHD_SIGNAL_SOURCE_H
|
||||
#define GNSS_SDR_UHD_SIGNAL_SOURCE_H
|
||||
|
||||
#include "signal_source_interface.h"
|
||||
#include "signal_source_base.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
@@ -39,7 +39,7 @@ class ConfigurationInterface;
|
||||
/*!
|
||||
* \brief This class reads samples from a UHD device (see http://code.ettus.com/redmine/ettus/projects/uhd/wiki)
|
||||
*/
|
||||
class UhdSignalSource : public SignalSourceInterface
|
||||
class UhdSignalSource : public SignalSourceBase
|
||||
{
|
||||
public:
|
||||
UhdSignalSource(const ConfigurationInterface* configuration,
|
||||
@@ -48,19 +48,6 @@ public:
|
||||
|
||||
~UhdSignalSource() = default;
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "UHD_Signal_Source"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "UHD_Signal_Source";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
@@ -90,7 +77,6 @@ private:
|
||||
std::string item_type_;
|
||||
std::string subdevice_;
|
||||
std::string clock_source_;
|
||||
std::string role_;
|
||||
|
||||
double sample_rate_;
|
||||
size_t item_size_;
|
||||
|
Reference in New Issue
Block a user