mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-30 14:53:03 +00:00
Redesign of pointer management
Avoid indirection caused by passing shared_ptr by reference The block factory does not have responsability on the lifetime of their inputs Define std::make_unique when using C++11 and make use of it Printers are turned into unique_ptr to express ownership Printers do not participate on the lifelime of the data, so they take const raw pointers Modernize tests code
This commit is contained in:
@@ -40,238 +40,10 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
void run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA)
|
||||
{
|
||||
const int MAX_INPUT_SAMPLES_TOTAL = 16384;
|
||||
int max_value = 0;
|
||||
int tx_fd; // DMA descriptor
|
||||
std::ifstream infile1;
|
||||
infile1.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
|
||||
try
|
||||
{
|
||||
infile1.open(Filename1, std::ios::binary);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception opening file " << Filename1 << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream infile2;
|
||||
infile2.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
try
|
||||
{
|
||||
infile2.open(Filename2, std::ios::binary);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
// could not exist
|
||||
}
|
||||
|
||||
// rx signal
|
||||
std::vector<int8_t> input_samples(MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
std::vector<int8_t> input_samples2(MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
std::vector<int8_t> input_samples_dma(MAX_INPUT_SAMPLES_TOTAL * 2 * 2);
|
||||
|
||||
int nread_elements;
|
||||
int nread_elements2;
|
||||
int file_completed = 0;
|
||||
int num_transferred_bytes;
|
||||
|
||||
//**************************************************************************
|
||||
// Open DMA device
|
||||
//**************************************************************************
|
||||
tx_fd = open("/dev/loop_tx", O_WRONLY);
|
||||
if (tx_fd < 0)
|
||||
{
|
||||
std::cout << "Cannot open loop device" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// Open input file
|
||||
//**************************************************************************
|
||||
int nsamples = 0;
|
||||
|
||||
while ((file_completed == 0) && (enable_DMA == true))
|
||||
{
|
||||
unsigned int dma_index = 0;
|
||||
|
||||
if (FreqBand == "L1")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = 0;
|
||||
input_samples_dma[dma_index + 1] = 0;
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 3] = input_samples[index0 + 1];
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
else if (FreqBand == "L2")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 1] = input_samples[index0 + 1];
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = 0;
|
||||
input_samples_dma[dma_index + 3] = 0;
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
else if (FreqBand == "L1L2")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
try
|
||||
{
|
||||
infile2.read(reinterpret_cast<char *>(input_samples2.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile2)
|
||||
{
|
||||
nread_elements2 = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements2 = 0;
|
||||
}
|
||||
|
||||
if (nread_elements > nread_elements2)
|
||||
{
|
||||
nread_elements = nread_elements2; // take the smallest
|
||||
}
|
||||
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
input_samples[index0] = input_samples[index0];
|
||||
input_samples[index0 + 1] = input_samples[index0 + 1];
|
||||
|
||||
if (input_samples[index0] > max_value)
|
||||
{
|
||||
max_value = input_samples[index0];
|
||||
}
|
||||
else if (-input_samples[index0] > max_value)
|
||||
{
|
||||
max_value = -input_samples[index0];
|
||||
}
|
||||
|
||||
if (input_samples[index0 + 1] > max_value)
|
||||
{
|
||||
max_value = input_samples[index0 + 1];
|
||||
}
|
||||
else if (-input_samples[index0 + 1] > max_value)
|
||||
{
|
||||
max_value = -input_samples[index0 + 1];
|
||||
}
|
||||
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = input_samples2[index0];
|
||||
input_samples_dma[dma_index + 1] = input_samples2[index0 + 1];
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 3] = input_samples[index0 + 1];
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (nread_elements > 0)
|
||||
{
|
||||
num_transferred_bytes = nread_elements * 2;
|
||||
int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2);
|
||||
if (num_bytes_sent != num_transferred_bytes)
|
||||
{
|
||||
std::cerr << "Error: DMA could not send all the required samples " << std::endl;
|
||||
}
|
||||
|
||||
// Throttle the DMA
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
if (nread_elements != MAX_INPUT_SAMPLES_TOTAL * 2)
|
||||
{
|
||||
file_completed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
infile1.close();
|
||||
infile2.close();
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface *configuration,
|
||||
const std::string &role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t> *queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_gain_mode("slow_attack");
|
||||
double default_tx_attenuation_db = -10.0;
|
||||
@@ -564,6 +336,235 @@ Ad9361FpgaSignalSource::~Ad9361FpgaSignalSource()
|
||||
}
|
||||
|
||||
|
||||
void Ad9361FpgaSignalSource::run_DMA_process(const std::string &FreqBand, const std::string &Filename1, const std::string &Filename2, const bool &enable_DMA)
|
||||
{
|
||||
const int MAX_INPUT_SAMPLES_TOTAL = 16384;
|
||||
int max_value = 0;
|
||||
int tx_fd; // DMA descriptor
|
||||
std::ifstream infile1;
|
||||
infile1.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
|
||||
try
|
||||
{
|
||||
infile1.open(Filename1, std::ios::binary);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception opening file " << Filename1 << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream infile2;
|
||||
infile2.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
try
|
||||
{
|
||||
infile2.open(Filename2, std::ios::binary);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
// could not exist
|
||||
}
|
||||
|
||||
// rx signal
|
||||
std::vector<int8_t> input_samples(MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
std::vector<int8_t> input_samples2(MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
std::vector<int8_t> input_samples_dma(MAX_INPUT_SAMPLES_TOTAL * 2 * 2);
|
||||
|
||||
int nread_elements;
|
||||
int nread_elements2;
|
||||
int file_completed = 0;
|
||||
int num_transferred_bytes;
|
||||
|
||||
//**************************************************************************
|
||||
// Open DMA device
|
||||
//**************************************************************************
|
||||
tx_fd = open("/dev/loop_tx", O_WRONLY);
|
||||
if (tx_fd < 0)
|
||||
{
|
||||
std::cout << "Cannot open loop device" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// Open input file
|
||||
//**************************************************************************
|
||||
int nsamples = 0;
|
||||
|
||||
while ((file_completed == 0) && (enable_DMA == true))
|
||||
{
|
||||
unsigned int dma_index = 0;
|
||||
|
||||
if (FreqBand == "L1")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = 0;
|
||||
input_samples_dma[dma_index + 1] = 0;
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 3] = input_samples[index0 + 1];
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
else if (FreqBand == "L2")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 1] = input_samples[index0 + 1];
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = 0;
|
||||
input_samples_dma[dma_index + 3] = 0;
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
else if (FreqBand == "L1L2")
|
||||
{
|
||||
try
|
||||
{
|
||||
infile1.read(reinterpret_cast<char *>(input_samples.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile1)
|
||||
{
|
||||
nread_elements = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements = 0;
|
||||
}
|
||||
try
|
||||
{
|
||||
infile2.read(reinterpret_cast<char *>(input_samples2.data()), MAX_INPUT_SAMPLES_TOTAL * 2);
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception reading file " << Filename1 << std::endl;
|
||||
}
|
||||
if (infile2)
|
||||
{
|
||||
nread_elements2 = MAX_INPUT_SAMPLES_TOTAL * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
nread_elements2 = 0;
|
||||
}
|
||||
|
||||
if (nread_elements > nread_elements2)
|
||||
{
|
||||
nread_elements = nread_elements2; // take the smallest
|
||||
}
|
||||
|
||||
nsamples += (nread_elements / 2);
|
||||
|
||||
for (int index0 = 0; index0 < (nread_elements); index0 += 2)
|
||||
{
|
||||
input_samples[index0] = input_samples[index0];
|
||||
input_samples[index0 + 1] = input_samples[index0 + 1];
|
||||
|
||||
if (input_samples[index0] > max_value)
|
||||
{
|
||||
max_value = input_samples[index0];
|
||||
}
|
||||
else if (-input_samples[index0] > max_value)
|
||||
{
|
||||
max_value = -input_samples[index0];
|
||||
}
|
||||
|
||||
if (input_samples[index0 + 1] > max_value)
|
||||
{
|
||||
max_value = input_samples[index0 + 1];
|
||||
}
|
||||
else if (-input_samples[index0 + 1] > max_value)
|
||||
{
|
||||
max_value = -input_samples[index0 + 1];
|
||||
}
|
||||
|
||||
// channel 1 (queue 1)
|
||||
input_samples_dma[dma_index] = input_samples2[index0];
|
||||
input_samples_dma[dma_index + 1] = input_samples2[index0 + 1];
|
||||
// channel 0 (queue 0)
|
||||
input_samples_dma[dma_index + 2] = input_samples[index0];
|
||||
input_samples_dma[dma_index + 3] = input_samples[index0 + 1];
|
||||
|
||||
dma_index += 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (nread_elements > 0)
|
||||
{
|
||||
num_transferred_bytes = nread_elements * 2;
|
||||
int num_bytes_sent = write(tx_fd, input_samples_dma.data(), nread_elements * 2);
|
||||
if (num_bytes_sent != num_transferred_bytes)
|
||||
{
|
||||
std::cerr << "Error: DMA could not send all the required samples " << std::endl;
|
||||
}
|
||||
|
||||
// Throttle the DMA
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
|
||||
if (nread_elements != MAX_INPUT_SAMPLES_TOTAL * 2)
|
||||
{
|
||||
file_completed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
infile1.close();
|
||||
infile2.close();
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
std::cerr << "Exception closing files " << Filename1 << " and " << Filename2 << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Ad9361FpgaSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
|
||||
@@ -35,9 +35,9 @@ class ConfigurationInterface;
|
||||
class Ad9361FpgaSignalSource : public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Ad9361FpgaSignalSource(ConfigurationInterface *configuration,
|
||||
const std::string &role, unsigned int in_stream,
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t> *queue);
|
||||
|
||||
~Ad9361FpgaSignalSource();
|
||||
|
||||
@@ -102,8 +102,6 @@ private:
|
||||
|
||||
size_t item_size_;
|
||||
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
|
||||
std::shared_ptr<Fpga_Switch> switch_fpga;
|
||||
int32_t switch_position;
|
||||
|
||||
@@ -114,6 +112,7 @@ private:
|
||||
|
||||
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
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty = "";
|
||||
|
||||
@@ -48,7 +48,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
CustomUDPSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~CustomUDPSignalSource() = default;
|
||||
|
||||
@@ -98,8 +98,6 @@ private:
|
||||
#endif
|
||||
|
||||
Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_;
|
||||
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
@@ -211,7 +211,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
|
||||
@@ -50,7 +50,7 @@ class FileSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~FileSignalSource() = default;
|
||||
|
||||
@@ -121,7 +121,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
// Throttle control
|
||||
bool enable_throttle_control_;
|
||||
|
||||
@@ -31,10 +31,7 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
|
||||
in_stream_(in_stream),
|
||||
out_stream_(out_stream),
|
||||
queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue __attribute__((unused))) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "byte";
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
|
||||
@@ -47,7 +47,7 @@ class FlexibandSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
FlexibandSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~FlexibandSignalSource() = default;
|
||||
|
||||
@@ -94,13 +94,11 @@ private:
|
||||
int n_channels_;
|
||||
int sel_ch_;
|
||||
|
||||
gr::block_sptr flexiband_source_;
|
||||
boost::shared_ptr<gr::block> flexiband_source_;
|
||||
|
||||
std::vector<std::shared_ptr<gr::block>> char_to_float;
|
||||
std::vector<std::shared_ptr<gr::block>> float_to_complex_;
|
||||
std::vector<boost::shared_ptr<gr::block>> char_to_float;
|
||||
std::vector<boost::shared_ptr<gr::block>> float_to_complex_;
|
||||
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
|
||||
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface *configuration,
|
||||
const std::string &role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t> *queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
@@ -320,7 +320,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface *configuration
|
||||
if (samples_ != 0)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
Fmcomms2SignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~Fmcomms2SignalSource();
|
||||
|
||||
@@ -127,7 +127,6 @@ private:
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -29,24 +29,17 @@
|
||||
|
||||
|
||||
// Constructor
|
||||
GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
|
||||
std::string role, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : signal_generator_(signal_generator),
|
||||
filter_(filter),
|
||||
role_(std::move(role)),
|
||||
queue_(std::move(queue))
|
||||
GenSignalSource::GenSignalSource(std::shared_ptr<GNSSBlockInterface> signal_generator,
|
||||
std::shared_ptr<GNSSBlockInterface> filter,
|
||||
std::string role,
|
||||
Concurrent_Queue<pmt::pmt_t> *queue __attribute__((unused))) : signal_generator_(std::move(signal_generator)),
|
||||
filter_(std::move(filter)),
|
||||
role_(std::move(role))
|
||||
{
|
||||
connected_ = false;
|
||||
}
|
||||
|
||||
|
||||
// Destructor
|
||||
GenSignalSource::~GenSignalSource()
|
||||
{
|
||||
delete signal_generator_;
|
||||
delete filter_;
|
||||
}
|
||||
|
||||
|
||||
void GenSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (connected_)
|
||||
|
||||
@@ -37,11 +37,11 @@ class GenSignalSource : public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
|
||||
std::string role, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
GenSignalSource(std::shared_ptr<GNSSBlockInterface> signal_generator, std::shared_ptr<GNSSBlockInterface> filter,
|
||||
std::string role, Concurrent_Queue<pmt::pmt_t> *queue);
|
||||
|
||||
//! Virtual destructor
|
||||
virtual ~GenSignalSource();
|
||||
virtual ~GenSignalSource() = default;
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
@@ -52,15 +52,14 @@ public:
|
||||
//! Returns "Signal Source"
|
||||
inline std::string implementation() override { return "Signal Source"; }
|
||||
inline size_t item_size() override { return 0; }
|
||||
inline GNSSBlockInterface *signal_generator() const { return signal_generator_; }
|
||||
inline std::shared_ptr<GNSSBlockInterface> signal_generator() const { return signal_generator_; }
|
||||
|
||||
private:
|
||||
GNSSBlockInterface *signal_generator_;
|
||||
GNSSBlockInterface *filter_;
|
||||
std::shared_ptr<GNSSBlockInterface> signal_generator_;
|
||||
std::shared_ptr<GNSSBlockInterface> filter_;
|
||||
std::string role_;
|
||||
std::string implementation_;
|
||||
bool connected_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GEN_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -25,7 +25,10 @@
|
||||
|
||||
|
||||
Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
|
||||
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 default_item_type = "short";
|
||||
std::string default_dump_file = "./data/gn3s_source.dat";
|
||||
|
||||
@@ -40,7 +40,7 @@ class Gn3sSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
Gn3sSignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~Gn3sSignalSource() = default;
|
||||
|
||||
@@ -78,7 +78,6 @@ private:
|
||||
std::string dump_filename_;
|
||||
gr::block_sptr gn3s_source_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GN3S_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
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)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./labsat_output.dat";
|
||||
@@ -42,7 +42,7 @@ LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
if (item_type_ == "gr_complex")
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
labsat23_source_ = labsat23_make_source_sptr(filename_.c_str(), channel_selector, queue_);
|
||||
labsat23_source_ = labsat23_make_source_sptr(filename_.c_str(), channel_selector, queue);
|
||||
DLOG(INFO) << "Item size " << item_size_;
|
||||
DLOG(INFO) << "labsat23_source_(" << labsat23_source_->unique_id() << ")";
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class LabsatSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
LabsatSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~LabsatSignalSource() = default;
|
||||
|
||||
@@ -77,7 +77,6 @@ private:
|
||||
std::string dump_filename_;
|
||||
gr::block_sptr labsat23_source_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_LABSAT_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "./example_capture.dat";
|
||||
std::string default_item_type = "short";
|
||||
@@ -205,7 +205,7 @@ MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterfac
|
||||
DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (enable_throttle_control_)
|
||||
|
||||
@@ -51,7 +51,7 @@ class MultichannelFileSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
MultichannelFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~MultichannelFileSignalSource() = default;
|
||||
|
||||
@@ -121,7 +121,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
// Throttle control
|
||||
bool enable_throttle_control_;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
@@ -137,7 +137,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
|
||||
@@ -50,7 +50,7 @@ class NsrFileSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~NsrFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
@@ -121,7 +121,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
// Throttle control
|
||||
bool enable_throttle_control_;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty = "";
|
||||
@@ -123,7 +123,7 @@ OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
|
||||
if (samples_ != 0)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
OsmosdrSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~OsmosdrSignalSource() = default;
|
||||
|
||||
@@ -108,7 +108,6 @@ private:
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/signal_source.dat";
|
||||
@@ -135,7 +135,7 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
||||
if (samples_ != 0)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
PlutosdrSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~PlutosdrSignalSource() = default;
|
||||
|
||||
@@ -112,7 +112,6 @@ private:
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
|
||||
RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream, unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
|
||||
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 default_item_type = "gr_complex";
|
||||
std::string default_dump_file = "./data/raw_array_source.dat";
|
||||
|
||||
@@ -39,7 +39,7 @@ class RawArraySignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
RawArraySignalSource(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~RawArraySignalSource() = default;
|
||||
|
||||
@@ -78,7 +78,6 @@ private:
|
||||
std::string eth_device_;
|
||||
gr::block_sptr raw_array_source_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -34,10 +34,9 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
|
||||
in_stream_(in_stream),
|
||||
out_stream_(out_stream),
|
||||
queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_stream_(in_stream),
|
||||
out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty = "";
|
||||
@@ -111,7 +110,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
|
||||
if (samples_ != 0ULL)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
const std::string& role,
|
||||
unsigned int in_stream,
|
||||
unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~RtlTcpSignalSource() = default;
|
||||
|
||||
@@ -111,7 +111,6 @@ private:
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "int";
|
||||
@@ -136,7 +136,7 @@ SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
|
||||
@@ -48,7 +48,7 @@ class SpirFileSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~SpirFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
@@ -119,7 +119,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
// Throttle control
|
||||
bool enable_throttle_control_;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, uint32_t in_streams, uint32_t out_streams, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
|
||||
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)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_dump_filename = "../data/my_capture_dump.dat";
|
||||
@@ -137,7 +137,7 @@ SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface*
|
||||
|
||||
for (uint32_t i = 0; i < (n_channels_); i++)
|
||||
{
|
||||
valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_));
|
||||
valve_vec_.emplace_back(gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue));
|
||||
if (dump_)
|
||||
{
|
||||
std::string tmp_str = dump_filename_ + "_ch" + std::to_string(i);
|
||||
|
||||
@@ -53,7 +53,7 @@ class SpirGSS6450FileSignalSource : public GNSSBlockInterface
|
||||
{
|
||||
public:
|
||||
SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
uint32_t in_streams, uint32_t out_streams, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
uint32_t in_streams, uint32_t out_streams, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~SpirGSS6450FileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
@@ -130,7 +130,6 @@ private:
|
||||
#endif
|
||||
std::vector<gr::blocks::file_sink::sptr> sink_vec_;
|
||||
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,10 +34,9 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams),
|
||||
queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
@@ -142,7 +141,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(sizeof(gr_complex), samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~TwoBitCpxFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
@@ -126,7 +126,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
// Throttle control
|
||||
bool enable_throttle_control_;
|
||||
|
||||
@@ -36,10 +36,9 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
|
||||
const std::string& role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams),
|
||||
queue_(queue)
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_filename = "../data/my_capture.dat";
|
||||
std::string default_item_type = "byte";
|
||||
@@ -206,7 +205,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue_);
|
||||
valve_ = gnss_sdr_make_valve(output_item_size, samples_, queue);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
|
||||
if (dump_)
|
||||
|
||||
@@ -53,7 +53,7 @@ class TwoBitPackedFileSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>& queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~TwoBitPackedFileSignalSource() = default;
|
||||
inline std::string role() override
|
||||
@@ -145,7 +145,6 @@ private:
|
||||
#endif
|
||||
gr::blocks::file_sink::sptr sink_;
|
||||
gr::blocks::throttle::sptr throttle_;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
size_t item_size_;
|
||||
bool big_endian_items_;
|
||||
bool big_endian_bytes_;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream, unsigned int out_stream,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t>* queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream)
|
||||
{
|
||||
// DUMP PARAMETERS
|
||||
std::string empty = "";
|
||||
@@ -204,7 +204,7 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
||||
if (samples_.at(i) != 0ULL)
|
||||
{
|
||||
LOG(INFO) << "RF_channel " << i << " Send STOP signal after " << samples_.at(i) << " samples";
|
||||
valve_.emplace_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue_));
|
||||
valve_.emplace_back(gnss_sdr_make_valve(item_size_, samples_.at(i), queue));
|
||||
DLOG(INFO) << "valve(" << valve_.at(i)->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class UhdSignalSource : public GNSSBlockInterface
|
||||
public:
|
||||
UhdSignalSource(ConfigurationInterface* configuration,
|
||||
const std::string& role, unsigned int in_stream,
|
||||
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
~UhdSignalSource() = default;
|
||||
|
||||
@@ -103,8 +103,6 @@ private:
|
||||
std::vector<boost::shared_ptr<gr::block>> valve_;
|
||||
#endif
|
||||
std::vector<gr::blocks::file_sink::sptr> file_sink_;
|
||||
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_UHD_SIGNAL_SOURCE_H
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
#include <vector>
|
||||
|
||||
|
||||
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
|
||||
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, Concurrent_Queue<pmt::pmt_t> *queue)
|
||||
{
|
||||
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, std::move(queue)));
|
||||
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, queue));
|
||||
}
|
||||
|
||||
|
||||
labsat23_source::labsat23_source(const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : gr::block("labsat23_source",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex))),
|
||||
d_queue(std::move(queue))
|
||||
Concurrent_Queue<pmt::pmt_t> *queue) : gr::block("labsat23_source",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 1, sizeof(gr_complex))),
|
||||
d_queue(queue)
|
||||
{
|
||||
if (channel_selector < 1 or channel_selector > 2)
|
||||
{
|
||||
@@ -60,16 +60,15 @@ labsat23_source::labsat23_source(const char *signal_file_basename,
|
||||
std::string signal_file;
|
||||
this->set_output_multiple(8);
|
||||
signal_file = generate_filename();
|
||||
binary_input_file = new std::ifstream(signal_file.c_str(), std::ios::in | std::ios::binary);
|
||||
binary_input_file.open(signal_file.c_str(), std::ios::in | std::ios::binary);
|
||||
|
||||
if (binary_input_file->is_open())
|
||||
if (binary_input_file.is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << signal_file << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Labsat file " << signal_file << " could not be opened!" << std::endl;
|
||||
delete binary_input_file;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -79,9 +78,9 @@ labsat23_source::~labsat23_source()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (binary_input_file->is_open())
|
||||
if (binary_input_file.is_open())
|
||||
{
|
||||
binary_input_file->close();
|
||||
binary_input_file.close();
|
||||
}
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
@@ -92,7 +91,6 @@ labsat23_source::~labsat23_source()
|
||||
{
|
||||
std::cerr << e.what() << '\n';
|
||||
}
|
||||
delete binary_input_file;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,10 +200,10 @@ int labsat23_source::general_work(int noutput_items,
|
||||
|
||||
if (d_header_parsed == false)
|
||||
{
|
||||
if (binary_input_file->eof() == false)
|
||||
if (binary_input_file.eof() == false)
|
||||
{
|
||||
std::array<char, 1024> memblock{};
|
||||
binary_input_file->read(memblock.data(), 1024);
|
||||
binary_input_file.read(memblock.data(), 1024);
|
||||
// parse Labsat header
|
||||
// check preamble
|
||||
int byte_counter = 0;
|
||||
@@ -392,8 +390,8 @@ int labsat23_source::general_work(int noutput_items,
|
||||
// end of header
|
||||
d_header_parsed = true;
|
||||
// seek file to the first signal sample
|
||||
binary_input_file->clear();
|
||||
binary_input_file->seekg(header_bytes, binary_input_file->beg);
|
||||
binary_input_file.clear();
|
||||
binary_input_file.seekg(header_bytes, binary_input_file.beg);
|
||||
return 0;
|
||||
}
|
||||
std::cout << "Labsat file header error: section 2 is not available." << std::endl;
|
||||
@@ -419,8 +417,8 @@ int labsat23_source::general_work(int noutput_items,
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
std::vector<int16_t> memblock(n_int16_to_read);
|
||||
binary_input_file->read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file->gcount() / 2; // from bytes to int16
|
||||
binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int output_pointer = 0;
|
||||
@@ -438,9 +436,9 @@ int labsat23_source::general_work(int noutput_items,
|
||||
{
|
||||
std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl;
|
||||
}
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
binary_input_file.close();
|
||||
binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary);
|
||||
if (binary_input_file.is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl;
|
||||
return 0;
|
||||
@@ -477,8 +475,8 @@ int labsat23_source::general_work(int noutput_items,
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
std::vector<int16_t> memblock(n_int16_to_read);
|
||||
binary_input_file->read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file->gcount() / 2; // from bytes to int16
|
||||
binary_input_file.read(reinterpret_cast<char *>(memblock.data()), n_int16_to_read * 2);
|
||||
n_int16_to_read = binary_input_file.gcount() / 2; // from bytes to int16
|
||||
if (n_int16_to_read > 0)
|
||||
{
|
||||
int output_pointer = 0;
|
||||
@@ -496,9 +494,9 @@ int labsat23_source::general_work(int noutput_items,
|
||||
{
|
||||
std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl;
|
||||
}
|
||||
binary_input_file->close();
|
||||
binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary);
|
||||
if (binary_input_file->is_open())
|
||||
binary_input_file.close();
|
||||
binary_input_file.open(generate_filename().c_str(), std::ios::in | std::ios::binary);
|
||||
if (binary_input_file.is_open())
|
||||
{
|
||||
std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl;
|
||||
return 0;
|
||||
|
||||
@@ -43,7 +43,7 @@ using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
|
||||
labsat23_source_sptr labsat23_make_source_sptr(
|
||||
const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t> *queue);
|
||||
|
||||
/*!
|
||||
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
|
||||
@@ -62,11 +62,11 @@ private:
|
||||
friend labsat23_source_sptr labsat23_make_source_sptr(
|
||||
const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t> *queue);
|
||||
|
||||
labsat23_source(const char *signal_file_basename,
|
||||
int channel_selector,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t> *queue);
|
||||
|
||||
std::string generate_filename();
|
||||
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
|
||||
@@ -77,10 +77,10 @@ private:
|
||||
int d_current_file_number;
|
||||
uint8_t d_labsat_version;
|
||||
std::string d_signal_file_basename;
|
||||
std::ifstream *binary_input_file;
|
||||
std::ifstream binary_input_file;
|
||||
uint8_t d_ref_clock;
|
||||
uint8_t d_bits_per_sample;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
|
||||
Concurrent_Queue<pmt::pmt_t> *d_queue;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_LABSAT23_SOURCE_H
|
||||
|
||||
@@ -180,8 +180,8 @@ bool config_ad9361_rx_local(uint64_t bandwidth_,
|
||||
bool quadrature_,
|
||||
bool rfdc_,
|
||||
bool bbdc_,
|
||||
std::string filter_source_,
|
||||
std::string filter_filename_,
|
||||
std::string filter_source_, // NOLINT(performance-unnecessary-value-param)
|
||||
std::string filter_filename_, // NOLINT(performance-unnecessary-value-param)
|
||||
float Fpass_,
|
||||
float Fstop_)
|
||||
|
||||
|
||||
@@ -31,42 +31,43 @@
|
||||
|
||||
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||
bool stop_flowgraph) : gr::sync_block("valve",
|
||||
gr::io_signature::make(1, 20, sizeof_stream_item),
|
||||
gr::io_signature::make(1, 20, sizeof_stream_item)),
|
||||
d_nitems(nitems),
|
||||
d_ncopied_items(0),
|
||||
d_queue(std::move(queue)),
|
||||
d_queue(queue),
|
||||
d_stop_flowgraph(stop_flowgraph)
|
||||
{
|
||||
d_open_valve = false;
|
||||
}
|
||||
|
||||
|
||||
#if GNURADIO_USES_STD_POINTERS
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph)
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue<pmt::pmt_t>* queue, bool stop_flowgraph)
|
||||
{
|
||||
std::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
|
||||
std::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph));
|
||||
return valve_;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
{
|
||||
std::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
|
||||
std::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true));
|
||||
return valve_;
|
||||
}
|
||||
#else
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph)
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue<pmt::pmt_t>* queue, bool stop_flowgraph)
|
||||
{
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, stop_flowgraph));
|
||||
return valve_;
|
||||
}
|
||||
|
||||
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, Concurrent_Queue<pmt::pmt_t>* queue)
|
||||
{
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, queue, true));
|
||||
return valve_;
|
||||
}
|
||||
#endif
|
||||
@@ -79,8 +80,8 @@ void Gnss_Sdr_Valve::open_valve()
|
||||
|
||||
|
||||
int Gnss_Sdr_Valve::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items)
|
||||
{
|
||||
if (d_open_valve == false)
|
||||
{
|
||||
|
||||
@@ -41,23 +41,23 @@ class Gnss_Sdr_Valve;
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||
bool stop_flowgraph);
|
||||
#else
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||
bool stop_flowgraph);
|
||||
#endif
|
||||
|
||||
@@ -71,40 +71,40 @@ public:
|
||||
void open_valve();
|
||||
|
||||
int work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
gr_vector_const_void_star& input_items,
|
||||
gr_vector_void_star& output_items);
|
||||
|
||||
private:
|
||||
#if GNURADIO_USES_STD_POINTERS
|
||||
friend std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
friend std::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||
bool stop_flowgraph);
|
||||
#else
|
||||
friend boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue);
|
||||
|
||||
friend boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
|
||||
size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
|
||||
Concurrent_Queue<pmt::pmt_t>* queue,
|
||||
bool stop_flowgraph);
|
||||
#endif
|
||||
Gnss_Sdr_Valve(size_t sizeof_stream_item,
|
||||
uint64_t nitems,
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph);
|
||||
Concurrent_Queue<pmt::pmt_t>* queue, bool stop_flowgraph);
|
||||
|
||||
uint64_t d_nitems;
|
||||
uint64_t d_ncopied_items;
|
||||
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
|
||||
Concurrent_Queue<pmt::pmt_t>* d_queue;
|
||||
bool d_stop_flowgraph;
|
||||
bool d_open_valve;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user