1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-22 21:13:15 +00:00

Partial implementation of the new event queue and its dependencies. Still NOT usable

This commit is contained in:
Javier Arribas 2019-07-16 17:41:12 +02:00
parent cae1c5a73a
commit 1313edd716
112 changed files with 1219 additions and 1171 deletions

View File

@ -43,6 +43,7 @@
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <glog/logging.h>
#include <pmt/pmt.h>
#include <bitset>
#include <cstddef> // for size_t
#include <cstdint>

View File

@ -31,6 +31,7 @@ target_link_libraries(channel_adapters
Gnuradio::runtime
channel_libs
core_system_parameters
core_receiver
PRIVATE
Gflags::gflags
Glog::glog

View File

@ -42,7 +42,7 @@
Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue)
std::string role, std::string implementation, std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue)
{
acq_ = std::move(acq);
trk_ = std::move(trk);

View File

@ -38,10 +38,11 @@
#include "channel_fsm.h"
#include "channel_interface.h"
#include "channel_msg_receiver_cc.h"
#include "concurrent_queue.h"
#include "gnss_signal.h"
#include "gnss_synchro.h"
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstddef>
#include <cstdint>
#include <memory>
@ -66,7 +67,7 @@ public:
//! Constructor
Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
std::string role, std::string implementation, gr::msg_queue::sptr queue);
std::string role, std::string implementation, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Channel(); //!< Virtual destructor
@ -105,7 +106,7 @@ private:
bool connected_;
bool repeat_;
std::shared_ptr<ChannelFsm> channel_fsm_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
std::mutex mx;
};

View File

@ -38,6 +38,7 @@ target_link_libraries(channel_libs
Gnuradio::runtime
Gnuradio::pmt
core_system_parameters
core_receiver
PRIVATE
Boost::boost
Gflags::gflags

View File

@ -31,7 +31,7 @@
*/
#include "channel_fsm.h"
#include "control_message_factory.h"
#include "channel_event.h"
#include <glog/logging.h>
#include <utility>
@ -179,7 +179,7 @@ void ChannelFsm::set_telemetry(std::shared_ptr<TelemetryDecoderInterface> teleme
}
void ChannelFsm::set_queue(gr::msg_queue::sptr queue)
void ChannelFsm::set_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::lock_guard<std::mutex> lk(mx);
queue_ = std::move(queue);
@ -215,29 +215,17 @@ void ChannelFsm::start_acquisition()
void ChannelFsm::start_tracking()
{
trk_->start_tracking();
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 1));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 1)));
}
void ChannelFsm::request_satellite()
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 0));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 0)));
}
void ChannelFsm::notify_stop_tracking()
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (queue_ != gr::msg_queue::make())
{
queue_->handle(cmf->GetQueueMessage(channel_, 2));
}
queue_->push(pmt::make_any(channel_event_make(channel_, 2)));
}

View File

@ -34,9 +34,10 @@
#define GNSS_SDR_CHANNEL_FSM_H
#include "acquisition_interface.h"
#include "concurrent_queue.h"
#include "telemetry_decoder_interface.h"
#include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <memory>
#include <mutex>
@ -54,7 +55,7 @@ public:
void set_acquisition(std::shared_ptr<AcquisitionInterface> acquisition);
void set_tracking(std::shared_ptr<TrackingInterface> tracking);
void set_telemetry(std::shared_ptr<TelemetryDecoderInterface> telemetry);
void set_queue(gr::msg_queue::sptr queue);
void set_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
void set_channel(uint32_t channel);
void start_acquisition();
// FSM EVENTS
@ -76,7 +77,7 @@ private:
std::shared_ptr<AcquisitionInterface> acq_;
std::shared_ptr<TrackingInterface> trk_;
std::shared_ptr<TelemetryDecoderInterface> nav_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
uint32_t channel_;
uint32_t d_state;
std::mutex mx;

View File

@ -109,6 +109,12 @@ Pass_Through::Pass_Through(ConfigurationInterface* configuration, const std::str
}
kludge_copy_ = gr::blocks::copy::make(item_size_);
unsigned long int max_source_buffer_samples = configuration->property("GNSS-SDR.max_source_buffer_samples", 0);
if (max_source_buffer_samples > 0)
{
kludge_copy_->set_max_output_buffer(max_source_buffer_samples);
LOG(INFO) << "Set signal conditioner max output buffer to " << max_source_buffer_samples;
}
DLOG(INFO) << "kludge_copy(" << kludge_copy_->unique_id() << ")";
if (in_streams_ > 1)
{

View File

@ -34,6 +34,7 @@ target_link_libraries(signal_generator_adapters
Gflags::gflags
Glog::glog
algorithms_libs
core_receiver
)
target_include_directories(signal_generator_adapters

View File

@ -44,7 +44,7 @@
SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
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))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/gen_source.dat";

View File

@ -33,12 +33,13 @@
#ifndef GNSS_SDR_SIGNAL_GENERATOR_H_
#define GNSS_SDR_SIGNAL_GENERATOR_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "signal_generator_c.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/vector_to_stream.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
#include <vector>
@ -53,7 +54,7 @@ class SignalGenerator : public GNSSBlockInterface
public:
SignalGenerator(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue);
virtual ~SignalGenerator();
@ -91,6 +92,6 @@ private:
boost::shared_ptr<gr::block> gen_source_;
gr::blocks::vector_to_stream::sptr vector_to_stream_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t> > queue_;
};
#endif /*GNSS_SDR_SIGNAL_GENERATOR_H_*/

View File

@ -48,7 +48,7 @@
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_
#define GNSS_SDR_AD9361_FPGA_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "fpga_switch.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -46,7 +47,7 @@ class Ad9361FpgaSignalSource : public GNSSBlockInterface
public:
Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
~Ad9361FpgaSignalSource();
@ -112,7 +113,7 @@ private:
bool dump_;
std::string dump_filename_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
std::shared_ptr<Fpga_Switch> switch_fpga;
};

View File

@ -40,7 +40,7 @@
CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";

View File

@ -32,12 +32,13 @@
#ifndef GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
#define GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "gr_complex_ip_packet_source.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <stdexcept>
#include <string>
#include <vector>
@ -54,7 +55,7 @@ class CustomUDPSignalSource : public GNSSBlockInterface
public:
CustomUDPSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~CustomUDPSignalSource();
@ -98,7 +99,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> null_sinks_;
Gr_Complex_Ip_Packet_Source::sptr udp_gnss_rx_source_;
std::vector<boost::shared_ptr<gr::block>> file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_CUSTOM_UDP_SIGNAL_SOURCE_H */

View File

@ -44,7 +44,7 @@
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "./example_capture.dat";
std::string default_item_type = "short";

View File

@ -35,13 +35,15 @@
#ifndef GNSS_SDR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_FILE_SIGNAL_SOURCE_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>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <memory>
#include <string>
class ConfigurationInterface;
@ -55,7 +57,7 @@ class FileSignalSource : public GNSSBlockInterface
public:
FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~FileSignalSource();
@ -122,7 +124,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -34,7 +34,6 @@
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <teleorbit/frontend.h>
#include <utility>
@ -43,10 +42,10 @@ FlexibandSignalSource::FlexibandSignalSource(ConfigurationInterface* configurati
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
gr::msg_queue::sptr queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))
{
std::string default_item_type = "byte";
item_type_ = configuration->property(role + ".item_type", default_item_type);

View File

@ -34,13 +34,14 @@
#ifndef GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_
#define GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_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>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
#include <vector>
@ -56,7 +57,7 @@ class FlexibandSignalSource : public GNSSBlockInterface
public:
FlexibandSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~FlexibandSignalSource();
@ -109,7 +110,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> float_to_complex_;
std::vector<gr::blocks::null_sink::sptr> null_sinks_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif // GNSS_SDR_FLEXIBAND_SIGNAL_SOURCE_H_

View File

@ -43,7 +43,7 @@
Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -41,7 +41,8 @@
#else
#include <iio/fmcomms2_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -51,7 +52,7 @@ class Fmcomms2SignalSource : public GNSSBlockInterface
public:
Fmcomms2SignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Fmcomms2SignalSource();
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_FMCOMMS2_SIGNAL_SOURCE_H_*/

View File

@ -42,7 +42,7 @@
// Constructor
GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue) : signal_generator_(signal_generator),
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))

View File

@ -34,8 +34,9 @@
#define GNSS_SDR_GEN_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
/*!
@ -47,7 +48,7 @@ class GenSignalSource : public GNSSBlockInterface
public:
//! Constructor
GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter,
std::string role, boost::shared_ptr<gr::msg_queue> queue);
std::string role, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
//! Virtual destructor
virtual ~GenSignalSource();
@ -58,20 +59,17 @@ public:
gr::basic_block_sptr get_right_block() override;
inline std::string role() override { return role_; }
//! 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_; }
private:
GNSSBlockInterface *signal_generator_;
GNSSBlockInterface *filter_;
std::string role_;
std::string implementation_;
bool connected_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_GEN_SIGNAL_SOURCE_H*/

View File

@ -32,12 +32,11 @@
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <gn3s/gn3s_source_cc.h>
Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
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 default_item_type = "short";
std::string default_dump_file = "./data/gn3s_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
#define GNSS_SDR_GN3S_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
@ -49,7 +50,7 @@ class Gn3sSignalSource : public GNSSBlockInterface
public:
Gn3sSignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~Gn3sSignalSource();
@ -87,7 +88,7 @@ private:
std::string dump_filename_;
gr::block_sptr gn3s_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_GN3S_SIGNAL_SOURCE_H_*/

View File

@ -37,7 +37,7 @@
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr 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, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./labsat_output.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_
#define GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -48,7 +49,7 @@ class LabsatSignalSource : public GNSSBlockInterface
public:
LabsatSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~LabsatSignalSource();
@ -86,7 +87,7 @@ private:
std::string dump_filename_;
gr::block_sptr labsat23_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_LABSAT_SIGNAL_SOURCE_H_*/

View File

@ -43,7 +43,7 @@
MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "./example_capture.dat";
std::string default_item_type = "short";

View File

@ -35,12 +35,13 @@
#ifndef GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_MULTICHANNEL_FILE_SIGNAL_SOURCE_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>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -56,7 +57,7 @@ class MultichannelFileSignalSource : public GNSSBlockInterface
public:
MultichannelFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~MultichannelFileSignalSource();
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -44,7 +44,7 @@
NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "byte";

View File

@ -35,13 +35,14 @@
#ifndef GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_NSR_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_byte_2bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -55,7 +56,7 @@ class NsrFileSignalSource : public GNSSBlockInterface
public:
NsrFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~NsrFileSignalSource();
inline std::string role() override
@ -122,7 +123,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -42,7 +42,7 @@
OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";

View File

@ -33,10 +33,11 @@
#ifndef GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
#define GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <osmosdr/source.h>
#include <stdexcept>
@ -54,7 +55,7 @@ class OsmosdrSignalSource : public GNSSBlockInterface
public:
OsmosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~OsmosdrSignalSource();
@ -110,7 +111,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_OSMOSDR_SIGNAL_SOURCE_H_*/

View File

@ -39,7 +39,7 @@
PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
std::string default_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat";

View File

@ -40,7 +40,8 @@
#else
#include <iio/pluto_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <pmt/pmt.h>
#include <string>
@ -53,7 +54,7 @@ class PlutosdrSignalSource : public GNSSBlockInterface
public:
PlutosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~PlutosdrSignalSource();
@ -109,7 +110,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H_*/

View File

@ -29,15 +29,16 @@
*/
#include "raw_array_signal_source.h"
#include "concurrent_queue.h"
#include "configuration_interface.h"
#include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <dbfcttc/raw_array.h>
RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream, unsigned int out_stream, gr::msg_queue::sptr queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(queue)
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 default_item_type = "gr_complex";
std::string default_dump_file = "./data/raw_array_source.dat";

View File

@ -32,10 +32,11 @@
#ifndef GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#define GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <string>
class ConfigurationInterface;
@ -48,7 +49,7 @@ class RawArraySignalSource : public GNSSBlockInterface
public:
RawArraySignalSource(ConfigurationInterface* configuration,
std::string role, unsigned int in_stream,
unsigned int out_stream, gr::msg_queue::sptr queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~RawArraySignalSource();
@ -87,7 +88,7 @@ private:
std::string eth_device_;
gr::block_sptr raw_array_source_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_RAW_ARRAY_SIGNAL_SOURCE_H_*/

View File

@ -45,7 +45,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_stream_(in_stream),
out_stream_(out_stream),
queue_(std::move(queue))

View File

@ -32,13 +32,14 @@
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "rtl_tcp_signal_source_c.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/deinterleave.h>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/float_to_complex.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <stdexcept>
#include <string>
@ -57,7 +58,7 @@ public:
const std::string& role,
unsigned int in_stream,
unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~RtlTcpSignalSource();
@ -113,7 +114,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H */

View File

@ -43,7 +43,7 @@
SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_item_type = "int";

View File

@ -32,13 +32,14 @@
#ifndef GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_SPIR_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_intspir_1bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -53,7 +54,7 @@ class SpirFileSignalSource : public GNSSBlockInterface
public:
SpirFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~SpirFileSignalSource();
inline std::string role() override
@ -120,7 +121,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -40,7 +40,7 @@
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration,
const std::string& role, uint32_t in_streams, uint32_t out_streams, gr::msg_queue::sptr 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, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_streams_(in_streams), out_streams_(out_streams), queue_(std::move(queue))
{
std::string default_filename = "../data/my_capture.dat";
std::string default_dump_filename = "../data/my_capture_dump.dat";

View File

@ -32,6 +32,7 @@
#ifndef GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "gnss_sdr_valve.h"
#include "unpack_spir_gss6450_samples.h"
@ -42,7 +43,7 @@
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -58,7 +59,7 @@ class SpirGSS6450FileSignalSource : public GNSSBlockInterface
{
public:
SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role,
uint32_t in_streams, uint32_t out_streams, gr::msg_queue::sptr queue);
uint32_t in_streams, uint32_t out_streams, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~SpirGSS6450FileSignalSource();
inline std::string role() override
@ -131,7 +132,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> valve_vec_;
std::vector<gr::blocks::file_sink::sptr> sink_vec_;
std::vector<gr::blocks::throttle::sptr> throttle_vec_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
};

View File

@ -45,7 +45,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
queue_(std::move(queue))

View File

@ -34,6 +34,7 @@
#ifndef GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_TWO_BIT_CPX_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_byte_2bit_cpx_samples.h"
#include <gnuradio/blocks/file_sink.h>
@ -41,7 +42,7 @@
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -59,7 +60,7 @@ public:
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~TwoBitCpxFileSignalSource();
inline std::string role() override
@ -127,7 +128,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
// Throttle control
bool enable_throttle_control_;

View File

@ -47,7 +47,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
const std::string& role,
unsigned int in_streams,
unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue) : role_(role),
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role),
in_streams_(in_streams),
out_streams_(out_streams),
queue_(std::move(queue))

View File

@ -35,6 +35,7 @@
#ifndef GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H_
#define GNSS_SDR_TWO_BIT_PACKED_FILE_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include "unpack_2bit_samples.h"
#include <gnuradio/blocks/file_sink.h>
@ -42,7 +43,7 @@
#include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
@ -58,7 +59,7 @@ class TwoBitPackedFileSignalSource : public GNSSBlockInterface
public:
TwoBitPackedFileSignalSource(ConfigurationInterface* configuration, const std::string& role,
unsigned int in_streams, unsigned int out_streams,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~TwoBitPackedFileSignalSource();
inline std::string role() override
@ -146,7 +147,7 @@ private:
boost::shared_ptr<gr::block> valve_;
gr::blocks::file_sink::sptr sink_;
gr::blocks::throttle::sptr throttle_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
size_t item_size_;
bool big_endian_items_;
bool big_endian_bytes_;

View File

@ -42,7 +42,7 @@
UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream,
boost::shared_ptr<gr::msg_queue> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) : role_(role), in_stream_(in_stream), out_stream_(out_stream), queue_(std::move(queue))
{
// DUMP PARAMETERS
std::string empty = "";

View File

@ -31,12 +31,13 @@
#ifndef GNSS_SDR_UHD_SIGNAL_SOURCE_H_
#define GNSS_SDR_UHD_SIGNAL_SOURCE_H_
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/uhd/usrp_source.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <string>
#include <vector>
@ -52,7 +53,7 @@ class UhdSignalSource : public GNSSBlockInterface
public:
UhdSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream,
unsigned int out_stream, boost::shared_ptr<gr::msg_queue> queue);
unsigned int out_stream, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
virtual ~UhdSignalSource();
@ -107,7 +108,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> valve_;
std::vector<gr::blocks::file_sink::sptr> file_sink_;
boost::shared_ptr<gr::msg_queue> queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
};
#endif /*GNSS_SDR_UHD_SIGNAL_SOURCE_H_*/

View File

@ -30,7 +30,8 @@
#include "labsat23_source.h"
#include "control_message_factory.h"
#include "command_event.h"
#include <boost/any.hpp>
#include <gnuradio/io_signature.h>
#include <array>
#include <exception>
@ -39,7 +40,7 @@
#include <utility>
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, gr::msg_queue::sptr queue)
labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename, int channel_selector, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
return labsat23_source_sptr(new labsat23_source(signal_file_basename, channel_selector, std::move(queue)));
}
@ -47,10 +48,10 @@ labsat23_source_sptr labsat23_make_source_sptr(const char *signal_file_basename,
labsat23_source::labsat23_source(const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr 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))
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))
{
if (channel_selector < 1 or channel_selector > 2)
{
@ -467,9 +468,8 @@ int labsat23_source::general_work(int noutput_items,
{
std::cout << "End of file reached, LabSat source stop" << std::endl;
}
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
return -1;
}
}
@ -528,9 +528,7 @@ int labsat23_source::general_work(int noutput_items,
{
std::cout << "End of file reached, LabSat source stop" << std::endl;
}
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
return -1;
}
}

View File

@ -31,8 +31,9 @@
#ifndef GNSS_SDR_LABSAT23_SOURCE_H
#define GNSS_SDR_LABSAT23_SOURCE_H
#include "concurrent_queue.h"
#include <gnuradio/block.h>
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <pmt/pmt.h>
#include <cstdint>
#include <fstream>
#include <string>
@ -45,7 +46,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,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
/*!
* \brief This class implements conversion between Labsat2 and 3 format byte packet samples to gr_complex
@ -64,11 +65,11 @@ private:
friend labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
labsat23_source(const char *signal_file_basename,
int channel_selector,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::string generate_filename();
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
@ -82,7 +83,7 @@ private:
std::ifstream *binary_input_file;
uint8_t d_ref_clock;
uint8_t d_bits_per_sample;
gr::msg_queue::sptr d_queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
};
#endif

View File

@ -71,10 +71,10 @@ target_link_libraries(signal_source_libs
PUBLIC
Boost::boost
Gnuradio::runtime
core_receiver
PRIVATE
Gflags::gflags
Glog::glog
core_receiver
)
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)

View File

@ -32,17 +32,17 @@
*/
#include "gnss_sdr_valve.h"
#include "control_message_factory.h" // for ControlMessageFactory
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min
#include <cstring> // for memcpy
#include <unistd.h> // for usleep
#include "command_event.h"
#include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min
#include <cstring> // for memcpy
#include <unistd.h> // for usleep
#include <utility>
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue,
std::shared_ptr<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)),
@ -55,14 +55,14 @@ Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
}
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr queue, bool stop_flowgraph)
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> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
return valve_;
}
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(size_t sizeof_stream_item, uint64_t nitems, gr::msg_queue::sptr 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)
{
boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
return valve_;
@ -83,10 +83,8 @@ int Gnss_Sdr_Valve::work(int noutput_items,
{
if (d_ncopied_items >= d_nitems)
{
auto *cmf = new ControlMessageFactory();
d_queue->handle(cmf->GetQueueMessage(200, 0));
LOG(INFO) << "Stopping receiver, " << d_ncopied_items << " samples processed";
delete cmf;
d_queue->push(pmt::make_any(command_event_make(200, 0)));
if (d_stop_flowgraph)
{
return -1; // Done!

View File

@ -34,11 +34,12 @@
#ifndef GNSS_SDR_GNSS_SDR_VALVE_H_
#define GNSS_SDR_GNSS_SDR_VALVE_H_
#include "concurrent_queue.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <gnuradio/sync_block.h> // for sync_block
#include <gnuradio/types.h> // for gr_vector_const_void_star
#include <cstddef> // for size_t
#include <pmt/pmt.h>
#include <cstddef> // for size_t
#include <cstdint>
class Gnss_Sdr_Valve;
@ -46,12 +47,12 @@ class Gnss_Sdr_Valve;
boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue);
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,
gr::msg_queue::sptr queue,
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph);
/*!
@ -71,21 +72,21 @@ private:
friend boost::shared_ptr<Gnss_Sdr_Valve> gnss_sdr_make_valve(
size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue);
std::shared_ptr<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,
gr::msg_queue::sptr queue,
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph);
Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems,
gr::msg_queue::sptr queue, bool stop_flowgraph);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, bool stop_flowgraph);
uint64_t d_nitems;
uint64_t d_ncopied_items;
gr::msg_queue::sptr d_queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
bool d_stop_flowgraph;
bool d_open_valve;
};

View File

@ -19,17 +19,17 @@
set(GNSS_RECEIVER_SOURCES
control_thread.cc
control_message_factory.cc
file_configuration.cc
gnss_block_factory.cc
gnss_flowgraph.cc
in_memory_configuration.cc
tcp_cmd_interface.cc
channel_event.cc
command_event.cc
)
set(GNSS_RECEIVER_HEADERS
control_thread.h
control_message_factory.h
file_configuration.h
gnss_block_factory.h
gnss_flowgraph.h
@ -38,6 +38,8 @@ set(GNSS_RECEIVER_HEADERS
concurrent_map.h
concurrent_queue.h
control_message.h
channel_event.h
command_event.h
)
list(SORT GNSS_RECEIVER_HEADERS)

View File

@ -0,0 +1,42 @@
/*!
* \file channel_event.cc
* \brief Class that defines a channel event
* \author Javier Arribas, 2019. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "channel_event.h"
channel_event_sptr channel_event_make(int channel_id, int event_type)
{
return channel_event_sptr(new channel_event(channel_id, event_type));
}
channel_event::channel_event(int channel_id_, int event_type_)
{
channel_id = channel_id_;
event_type = event_type_;
}

View File

@ -0,0 +1,53 @@
/*!
* \file channel_event.h
* \brief Class that defines a channel event
* \author Javier Arribas, 2019. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_CHANNEL_EVENT_H
#define GNSS_SDR_CHANNEL_EVENT_H
#include <memory>
class channel_event;
using channel_event_sptr = std::shared_ptr<channel_event>;
channel_event_sptr channel_event_make(int channel_id, int event_type);
class channel_event
{
public:
int channel_id;
int event_type;
private:
friend channel_event_sptr channel_event_make(int channel_id, int event_type);
channel_event(int channel_id_, int event_type_);
};
#endif

View File

@ -0,0 +1,42 @@
/*!
* \file command_event.cc
* \brief Class that defines a receiver command event
* \author Javier Arribas, 2019. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "command_event.h"
command_event_sptr command_event_make(int command_id, int event_type)
{
return command_event_sptr(new command_event(command_id, event_type));
}
command_event::command_event(int command_id_, int event_type_)
{
command_id = command_id_;
event_type = event_type_;
}

View File

@ -0,0 +1,53 @@
/*!
* \file command_event.h
* \brief Class that defines a receiver command event
* \author Javier Arribas, 2019. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2019 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_command_EVENT_H
#define GNSS_SDR_command_EVENT_H
#include <memory>
class command_event;
using command_event_sptr = std::shared_ptr<command_event>;
command_event_sptr command_event_make(int command_id, int event_type);
class command_event
{
public:
int command_id;
int event_type;
private:
friend command_event_sptr command_event_make(int command_id, int event_type);
command_event(int command_id_, int event_type_);
};
#endif

View File

@ -1,72 +0,0 @@
/*!
* \file control_message_factory.cc
* \brief Implementation of a Control Message Factory
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#include "control_message_factory.h"
#include <glog/logging.h>
#include <cstring> // for memcpy
#include <ostream> // for operator<<, basic_ostream
// Constructor
ControlMessageFactory::ControlMessageFactory() = default;
// Destructor
ControlMessageFactory::~ControlMessageFactory() = default;
gr::message::sptr ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what)
{
std::shared_ptr<ControlMessage> control_message = std::make_shared<ControlMessage>();
control_message->who = who;
control_message->what = what;
gr::message::sptr queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
memcpy(queue_message->msg(), control_message.get(), sizeof(ControlMessage));
return queue_message;
}
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> ControlMessageFactory::GetControlMessages(const gr::message::sptr queue_message) // NOLINT(performance-unnecessary-value-param)
{
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = std::make_shared<std::vector<std::shared_ptr<ControlMessage>>>();
unsigned int control_messages_count = queue_message->length() / sizeof(ControlMessage);
if (queue_message->length() % sizeof(ControlMessage) != 0)
{
LOG(WARNING) << "Queue message has size " << queue_message->length() << ", which is not"
<< " multiple of control message size " << sizeof(ControlMessage);
LOG(WARNING) << "Ignoring this queue message to prevent unexpected results.";
return control_messages;
}
for (unsigned int i = 0; i < control_messages_count; i++)
{
control_messages->push_back(std::make_shared<ControlMessage>());
memcpy(control_messages->at(i).get(), queue_message->msg() + (i * sizeof(ControlMessage)), sizeof(ControlMessage));
}
return control_messages;
}

View File

@ -1,64 +0,0 @@
/*!
* \file control_message_factory.h
* \brief Interface of a factory for control messages.
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
*
* -------------------------------------------------------------------------
*
* Copyright (C) 2010-2018 (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.
*
* GNSS-SDR is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GNSS-SDR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
*
* -------------------------------------------------------------------------
*/
#ifndef GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_
#define GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_
#include <gnuradio/message.h>
#include <memory>
#include <vector>
//! Message described by who sent it and what it says
typedef struct control_message
{
unsigned int who;
unsigned int what;
} ControlMessage;
/*!
* \brief This class implements a factory for Control Messages.
*
* It encapsulates the complexity behind getting Queue Messages and associated Control Messages
*/
class ControlMessageFactory
{
public:
//! Constructor
ControlMessageFactory();
//! Virtual destructor
virtual ~ControlMessageFactory();
gr::message::sptr GetQueueMessage(unsigned int who, unsigned int what);
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> GetControlMessages(const gr::message::sptr queue_message); // NOLINT(performance-unnecessary-value-param)
};
#endif /*GNSS_SDR_CONTROL_MESSAGE_FACTORY_H_*/

View File

@ -34,9 +34,7 @@
#include "control_thread.h"
#include "concurrent_map.h"
#include "concurrent_queue.h"
#include "configuration_interface.h"
#include "control_message_factory.h"
#include "file_configuration.h"
#include "galileo_almanac.h"
#include "galileo_ephemeris.h"
@ -110,7 +108,7 @@ ControlThread::ControlThread(std::shared_ptr<ConfigurationInterface> configurati
void ControlThread::init()
{
// Instantiates a control queue, a GNSS flowgraph, and a control message factory
control_queue_ = gr::msg_queue::make(0);
control_queue_ = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread
try
{
@ -120,7 +118,6 @@ void ControlThread::init()
{
std::cout << "Caught bad lexical cast with error " << e.what() << std::endl;
}
control_message_factory_ = std::make_shared<ControlMessageFactory>();
stop_ = false;
processed_control_messages_ = 0;
applied_actions_ = 0;
@ -287,12 +284,13 @@ int ControlThread::run()
// Main loop to read and process the control messages
while (flowgraph_->running() && !stop_)
{
//TODO re-enable the blocking read messages functions and fork the process
read_control_messages();
if (control_messages_ != nullptr)
{
process_control_messages();
}
//TODO call here the new sat dispatcher and receiver controller
// read_control_messages();
// if (control_messages_ != nullptr)
// {
// process_control_messages();
// }
std::cout << "tick\n";
}
std::cout << "Stopping GNSS-SDR, please wait!" << std::endl;
flowgraph_->stop();
@ -325,7 +323,7 @@ int ControlThread::run()
}
void ControlThread::set_control_queue(const gr::msg_queue::sptr control_queue) // NOLINT(performance-unnecessary-value-param)
void ControlThread::set_control_queue(const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue) // NOLINT(performance-unnecessary-value-param)
{
if (flowgraph_->running())
{
@ -794,42 +792,42 @@ void ControlThread::assist_GNSS()
void ControlThread::read_control_messages()
{
DLOG(INFO) << "Reading control messages from queue";
gr::message::sptr queue_message = control_queue_->delete_head();
if (queue_message != nullptr)
{
control_messages_ = control_message_factory_->GetControlMessages(queue_message);
}
else
{
control_messages_->clear();
}
// gr::message::sptr queue_message = control_queue_->delete_head();
// if (queue_message != nullptr)
// {
// control_messages_ = control_message_factory_->GetControlMessages(queue_message);
// }
// else
// {
// control_messages_->clear();
// }
}
// Apply the corresponding control actions
void ControlThread::process_control_messages()
{
for (auto &i : *control_messages_)
{
if (stop_)
{
break;
}
if (i->who == 200)
{
apply_action(i->what);
}
else
{
if (i->who == 300) // some TC commands require also actions from control_thread
{
apply_action(i->what);
}
flowgraph_->apply_action(i->who, i->what);
}
processed_control_messages_++;
}
control_messages_->clear();
// for (auto &i : *control_messages_)
// {
// if (stop_)
// {
// break;
// }
// if (i->who == 200)
// {
// apply_action(i->what);
// }
// else
// {
// if (i->who == 300) // some TC commands require also actions from control_thread
// {
// apply_action(i->what);
// }
// flowgraph_->apply_action(i->who, i->what);
// }
// processed_control_messages_++;
// }
// control_messages_->clear();
DLOG(INFO) << "Processed all control messages";
}
@ -1092,11 +1090,12 @@ void ControlThread::sysv_queue_listener()
if ((std::abs(received_message - (-200.0)) < 10 * std::numeric_limits<double>::epsilon()))
{
std::cout << "Quit order received, stopping GNSS-SDR !!" << std::endl;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != gr::msg_queue::sptr())
{
control_queue_->handle(cmf->GetQueueMessage(200, 0));
}
//todo: remplace old shutdown mechanism
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// if (control_queue_ != std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>())
// {
// control_queue_->handle(cmf->GetQueueMessage(200, 0));
// }
read_queue = false;
}
}
@ -1114,11 +1113,12 @@ void ControlThread::keyboard_listener()
if (c == 'q')
{
std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != gr::msg_queue::sptr())
{
control_queue_->handle(cmf->GetQueueMessage(200, 0));
}
//todo: remplace old shutdown mechanism
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// if (control_queue_ != std::shared_ptr<Concurrent_Queue<pmt::pmt_t>>())
// {
// control_queue_->handle(cmf->GetQueueMessage(200, 0));
// }
read_keys = false;
}
std::this_thread::sleep_for(std::chrono::milliseconds(100));

View File

@ -35,20 +35,20 @@
#ifndef GNSS_SDR_CONTROL_THREAD_H_
#define GNSS_SDR_CONTROL_THREAD_H_
#include "agnss_ref_location.h" // for Agnss_Ref_Location
#include "agnss_ref_time.h" // for Agnss_Ref_Time
#include "control_message_factory.h" // for ControlMessage
#include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client
#include "tcp_cmd_interface.h" // for TcpCmdInterface
#include <armadillo> // for arma::vec
#include <boost/thread.hpp> // for boost::thread
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <ctime> // for time_t
#include <memory> // for shared_ptr
#include <string> // for string
#include <thread> // for std::thread
#include <utility> // for pair
#include <vector> // for vector
#include "agnss_ref_location.h" // for Agnss_Ref_Location
#include "agnss_ref_time.h" // for Agnss_Ref_Time
#include "concurrent_queue.h"
#include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client
#include "tcp_cmd_interface.h" // for TcpCmdInterface
#include <armadillo> // for arma::vec
#include <boost/thread.hpp> // for boost::thread
#include <pmt/pmt.h>
#include <ctime> // for time_t
#include <memory> // for shared_ptr
#include <string> // for string
#include <thread> // for std::thread
#include <utility> // for pair
#include <vector> // for vector
class ConfigurationInterface;
class GNSSFlowgraph;
@ -97,7 +97,7 @@ public:
*
* \param[in] boost::shared_ptr<gr::msg_queue> control_queue
*/
void set_control_queue(const gr::msg_queue::sptr control_queue); // NOLINT(performance-unnecessary-value-param)
void set_control_queue(const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue); // NOLINT(performance-unnecessary-value-param)
unsigned int processed_control_messages()
{
@ -163,9 +163,7 @@ private:
void apply_action(unsigned int what);
std::shared_ptr<GNSSFlowgraph> flowgraph_;
std::shared_ptr<ConfigurationInterface> configuration_;
gr::msg_queue::sptr control_queue_;
std::shared_ptr<ControlMessageFactory> control_message_factory_;
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_;
bool stop_;
bool restart_;
bool delete_configuration_;

View File

@ -182,7 +182,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default;
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource(
const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr queue, int ID) // NOLINT(performance-unnecessary-value-param)
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, int ID) // NOLINT(performance-unnecessary-value-param)
{
std::string default_implementation = "File_Signal_Source";
std::string role = "SignalSource"; //backwards compatibility for old conf files
@ -321,7 +321,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetPVT(const std::shared_p
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
//"appendix" is added to the "role" with the aim of Acquisition, Tracking and Telemetry Decoder adapters
//can find their specific configurations when they read the config
@ -389,7 +389,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: "
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
@ -453,7 +453,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -520,7 +520,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -587,7 +587,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -655,7 +655,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -723,7 +723,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -790,7 +790,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -857,7 +857,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B3(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue)
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue)
{
std::stringstream stream;
stream << channel;
@ -921,7 +921,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B3(
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFactory::GetChannels(
const std::shared_ptr<ConfigurationInterface>& configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) // NOLINT(performance-unnecessary-value-param)
{
std::string default_implementation = "Pass_Through";
std::string tracking_implementation;
@ -1241,7 +1241,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role,
const std::string& implementation, unsigned int in_streams,
unsigned int out_streams, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
unsigned int out_streams, const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) // NOLINT(performance-unnecessary-value-param)
{
std::unique_ptr<GNSSBlockInterface> block;

View File

@ -37,10 +37,11 @@
#ifndef GNSS_SDR_BLOCK_FACTORY_H_
#define GNSS_SDR_BLOCK_FACTORY_H_
#include <gnuradio/msg_queue.h> // for msg_queue::sptr
#include <memory> // for unique_ptr, shared_ptr
#include <string> // for string
#include <vector> // for vector
#include "concurrent_queue.h"
#include <pmt/pmt.h>
#include <memory> // for unique_ptr, shared_ptr
#include <string> // for string
#include <vector> // for vector
class ConfigurationInterface;
@ -59,12 +60,12 @@ public:
virtual ~GNSSBlockFactory();
std::unique_ptr<GNSSBlockInterface> GetSignalSource(const std::shared_ptr<ConfigurationInterface>& configuration,
const gr::msg_queue::sptr queue, int ID = -1); // NOLINT(performance-unnecessary-value-param)
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue, int ID = -1); // NOLINT(performance-unnecessary-value-param)
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const std::shared_ptr<ConfigurationInterface>& configuration, int ID = -1);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const std::shared_ptr<ConfigurationInterface>& configuration,
const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param)
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue); // NOLINT(performance-unnecessary-value-param)
std::unique_ptr<GNSSBlockInterface> GetObservables(const std::shared_ptr<ConfigurationInterface>& configuration);
@ -76,44 +77,44 @@ public:
std::unique_ptr<GNSSBlockInterface> GetBlock(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role, const std::string& implementation,
unsigned int in_streams, unsigned int out_streams,
const gr::msg_queue::sptr queue = nullptr); // NOLINT(performance-unnecessary-value-param)
const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = nullptr); // NOLINT(performance-unnecessary-value-param)
private:
std::unique_ptr<GNSSBlockInterface> GetChannel_1C(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_2S(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_1B(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_5X(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_L5(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_1G(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_2G(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_B1(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
gr::msg_queue::sptr queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_B3(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
boost::shared_ptr<gr::msg_queue> queue);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::unique_ptr<AcquisitionInterface> GetAcqBlock(
const std::shared_ptr<ConfigurationInterface>& configuration,

View File

@ -75,7 +75,7 @@
#define GNSS_SDR_ARRAY_SIGNAL_CONDITIONER_CHANNELS 8
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr queue) // NOLINT(performance-unnecessary-value-param)
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue) // NOLINT(performance-unnecessary-value-param)
{
connected_ = false;
running_ = false;
@ -1061,7 +1061,106 @@ bool GNSSFlowgraph::send_telemetry_msg(const pmt::pmt_t& msg)
return true;
}
void GNSSFlowgraph::push_back_signal(Gnss_Signal gs)
{
switch (mapStringValues_[gs.get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(gs);
available_GPS_1C_signals_.push_back(gs);
break;
case evGPS_2S:
available_GPS_2S_signals_.remove(gs);
available_GPS_2S_signals_.push_back(gs);
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(gs);
available_GPS_L5_signals_.push_back(gs);
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(gs);
available_GAL_1B_signals_.push_back(gs);
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(gs);
available_GAL_5X_signals_.push_back(gs);
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(gs);
available_GLO_1G_signals_.push_back(gs);
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(gs);
available_GLO_2G_signals_.push_back(gs);
break;
case evBDS_B1:
available_BDS_B1_signals_.remove(gs);
available_BDS_B1_signals_.push_back(gs);
break;
case evBDS_B3:
available_BDS_B3_signals_.remove(gs);
available_BDS_B3_signals_.push_back(gs);
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
}
void GNSSFlowgraph::remove_signal(Gnss_Signal gs)
{
switch (mapStringValues_[gs.get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(gs);
break;
case evGPS_2S:
available_GPS_2S_signals_.remove(gs);
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(gs);
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(gs);
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(gs);
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(gs);
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(gs);
break;
case evBDS_B1:
available_BDS_B1_signals_.remove(gs);
break;
case evBDS_B3:
available_BDS_B3_signals_.remove(gs);
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
}
/*
* Applies an action to the flow graph
*
@ -1089,6 +1188,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
//todo: the acquisition events are initiated from the acquisition success or failure queued msg. If the acquisition is disabled for non-assisted secondary freq channels, the engine stops..
std::lock_guard<std::mutex> lock(signal_list_mutex);
std::cout << "Received " << what << " from " << who << ". acq_channels_count_ = " << acq_channels_count_ << "\n";
DLOG(INFO) << "Received " << what << " from " << who << ". Number of applied actions = " << applied_actions_;
unsigned int sat = 0;
if (who < 200)
@ -1109,60 +1209,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
if (sat == 0)
{
Gnss_Signal gs = channels_[who]->get_signal();
switch (mapStringValues_[gs.get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(gs);
available_GPS_1C_signals_.push_back(gs);
break;
case evGPS_2S:
available_GPS_2S_signals_.remove(gs);
available_GPS_2S_signals_.push_back(gs);
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(gs);
available_GPS_L5_signals_.push_back(gs);
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(gs);
available_GAL_1B_signals_.push_back(gs);
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(gs);
available_GAL_5X_signals_.push_back(gs);
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(gs);
available_GLO_1G_signals_.push_back(gs);
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(gs);
available_GLO_2G_signals_.push_back(gs);
break;
case evBDS_B1:
available_BDS_B1_signals_.remove(gs);
available_BDS_B1_signals_.push_back(gs);
break;
case evBDS_B3:
available_BDS_B3_signals_.remove(gs);
available_BDS_B3_signals_.push_back(gs);
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
push_back_signal(gs);
}
channels_state_[who] = 0;
acq_channels_count_--;
if (acq_channels_count_ > 0) acq_channels_count_--;
for (unsigned int i = 0; i < channels_count_; i++)
{
unsigned int ch_index = (who + i + 1) % channels_count_;
@ -1179,19 +1229,27 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
bool is_primary_freq = true;
bool assistance_available = false;
bool start_acquisition = false;
Gnss_Signal gnss_signal;
if (sat_ == 0)
{
float estimated_doppler;
double RX_time;
Gnss_Signal gnss_signal;
gnss_signal = search_next_signal(channels_[ch_index]->get_signal().get_signal_str(), false, is_primary_freq, assistance_available, estimated_doppler, RX_time);
channels_[ch_index]->set_signal(gnss_signal);
start_acquisition = is_primary_freq or assistance_available;
}
else
{
start_acquisition = true;
}
//todo: add configuration parameter to enable the mandatory acquisition assistance in secondary freq
if (is_primary_freq == true or assistance_available == true)
if (start_acquisition == true)
{
channels_state_[ch_index] = 1;
acq_channels_count_++;
std::cout << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
DLOG(INFO) << "Channel " << ch_index << " Starting acquisition " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
#ifndef ENABLE_FPGA
channels_[ch_index]->start_acquisition();
@ -1203,6 +1261,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
}
else
{
push_back_signal(gnss_signal);
//todo: rewrite all
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// queue_->handle(cmf->GetQueueMessage(i, 0));
DLOG(INFO) << "Channel " << ch_index << " secondary frequency acquisition assistance not available in " << channels_[ch_index]->get_signal().get_satellite() << ", Signal " << channels_[ch_index]->get_signal().get_signal_str();
}
}
@ -1214,51 +1276,10 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
LOG(INFO) << "Channel " << who << " ACQ SUCCESS satellite " << channels_[who]->get_signal().get_satellite();
// If the satellite is in the list of available ones, remove it.
switch (mapStringValues_[channels_[who]->get_signal().get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(channels_[who]->get_signal());
break;
case evGPS_2S:
available_GPS_2S_signals_.remove(channels_[who]->get_signal());
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(channels_[who]->get_signal());
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(channels_[who]->get_signal());
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(channels_[who]->get_signal());
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(channels_[who]->get_signal());
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(channels_[who]->get_signal());
break;
case evBDS_B1:
available_BDS_B1_signals_.remove(channels_[who]->get_signal());
break;
case evBDS_B3:
available_BDS_B3_signals_.remove(channels_[who]->get_signal());
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
remove_signal(channels_[who]->get_signal());
channels_state_[who] = 2;
acq_channels_count_--;
if (acq_channels_count_ > 0) acq_channels_count_--;
for (unsigned int i = 0; i < channels_count_; i++)
{
unsigned int sat_ = 0;
@ -1274,16 +1295,22 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
bool is_primary_freq = true;
bool assistance_available = false;
bool start_acquisition = false;
Gnss_Signal gnss_signal;
if (sat_ == 0)
{
float estimated_doppler;
double RX_time;
Gnss_Signal gnss_signal;
gnss_signal = search_next_signal(channels_[i]->get_signal().get_signal_str(), true, is_primary_freq, assistance_available, estimated_doppler, RX_time);
channels_[i]->set_signal(gnss_signal);
}
else
{
start_acquisition = true;
}
//todo: add configuration parameter to enable the mandatory acquisition assistance in secondary freq
if (is_primary_freq == true or assistance_available == true)
if (start_acquisition == true)
{
channels_state_[i] = 1;
acq_channels_count_++;
@ -1294,11 +1321,17 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
// create a task for the FPGA such that it doesn't stop the flow
std::thread tmp_thread(&ChannelInterface::start_acquisition, channels_[i]);
tmp_thread.detach();
start_acquisition = is_primary_freq or assistance_available;
#endif
}
else
{
push_back_signal(gnss_signal);
//todo: rewrite all
// std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
// queue_->handle(cmf->GetQueueMessage(i, 0));
DLOG(INFO) << "Channel " << i << " secondary frequency acquisition assistance not available in " << channels_[i]->get_signal().get_satellite() << ", Signal " << channels_[i]->get_signal().get_signal_str();
std::cout << "Channel " << i << " secondary frequency acquisition assistance not available in " << channels_[i]->get_signal().get_satellite() << ", Signal " << channels_[i]->get_signal().get_signal_str();
}
}
DLOG(INFO) << "Channel " << i << " in state " << channels_state_[i];
@ -1328,48 +1361,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
LOG(INFO) << "Channel " << who << " Idle state";
if (sat == 0)
{
switch (mapStringValues_[channels_[who]->get_signal().get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.push_back(channels_[who]->get_signal());
break;
case evGPS_2S:
available_GPS_2S_signals_.push_back(channels_[who]->get_signal());
break;
case evGPS_L5:
available_GPS_L5_signals_.push_back(channels_[who]->get_signal());
break;
case evGAL_1B:
available_GAL_1B_signals_.push_back(channels_[who]->get_signal());
break;
case evGAL_5X:
available_GAL_5X_signals_.push_back(channels_[who]->get_signal());
break;
case evGLO_1G:
available_GLO_1G_signals_.push_back(channels_[who]->get_signal());
break;
case evGLO_2G:
available_GLO_2G_signals_.push_back(channels_[who]->get_signal());
break;
case evBDS_B1:
available_BDS_B1_signals_.push_back(channels_[who]->get_signal());
break;
case evBDS_B3:
available_BDS_B3_signals_.push_back(channels_[who]->get_signal());
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
push_back_signal(channels_[who]->get_signal());
}
}
break;
@ -1381,57 +1373,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
{
//recover the satellite assigned
Gnss_Signal gs = channels_[n]->get_signal();
switch (mapStringValues_[gs.get_signal_str()])
{
case evGPS_1C:
available_GPS_1C_signals_.remove(gs);
available_GPS_1C_signals_.push_back(gs);
break;
push_back_signal(gs);
case evGPS_2S:
available_GPS_2S_signals_.remove(gs);
available_GPS_2S_signals_.push_back(gs);
break;
case evGPS_L5:
available_GPS_L5_signals_.remove(gs);
available_GPS_L5_signals_.push_back(gs);
break;
case evGAL_1B:
available_GAL_1B_signals_.remove(gs);
available_GAL_1B_signals_.push_back(gs);
break;
case evGAL_5X:
available_GAL_5X_signals_.remove(gs);
available_GAL_5X_signals_.push_back(gs);
break;
case evGLO_1G:
available_GLO_1G_signals_.remove(gs);
available_GLO_1G_signals_.push_back(gs);
break;
case evGLO_2G:
available_GLO_2G_signals_.remove(gs);
available_GLO_2G_signals_.push_back(gs);
break;
case evBDS_B1:
available_BDS_B1_signals_.remove(gs);
available_BDS_B1_signals_.push_back(gs);
break;
case evBDS_B3:
available_BDS_B3_signals_.remove(gs);
available_BDS_B3_signals_.push_back(gs);
break;
default:
LOG(ERROR) << "This should not happen :-(";
break;
}
channels_[n]->stop_channel(); // stop the acquisition or tracking operation
channels_state_[n] = 0;
}
@ -2071,6 +2014,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal
{
is_primary_frequency = false;
Gnss_Signal result;
bool found_signal = false;
switch (mapStringValues_[searched_signal])
{
case evGPS_1C:
@ -2090,6 +2034,7 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal
//1. Get the current channel status map
std::map<int, std::shared_ptr<Gnss_Synchro>> current_channels_status = channels_status_->get_current_status_map();
//2. search the currently tracked GPS L1 satellites and assist the GPS L2 acquisition if the satellite is not tracked on L2
bool found_signal = false;
for (std::map<int, std::shared_ptr<Gnss_Synchro>>::iterator it = current_channels_status.begin(); it != current_channels_status.end(); ++it)
{
if (std::string(it->second->Signal) == "1C")
@ -2107,16 +2052,21 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal
{
available_GPS_2S_signals_.erase(it2);
}
found_signal = true;
break;
}
}
}
//fallback: pick the front satellite because there is no tracked satellites in L1 to assist L2
result = available_GPS_2S_signals_.front();
available_GPS_2S_signals_.pop_front();
if (!pop)
if (found_signal == false)
{
available_GPS_2S_signals_.push_back(result);
result = available_GPS_2S_signals_.front();
available_GPS_2S_signals_.pop_front();
if (!pop)
{
available_GPS_2S_signals_.push_back(result);
}
}
}
else
@ -2153,19 +2103,14 @@ Gnss_Signal GNSSFlowgraph::search_next_signal(const std::string& searched_signal
{
available_GPS_L5_signals_.erase(it2);
}
found_signal = true;
break;
}
}
}
//fallback: pick the front satellite because there is no tracked satellites in L1 to assist L5
result = available_GPS_L5_signals_.front();
available_GPS_L5_signals_.pop_front();
if (!pop)
{
available_GPS_L5_signals_.push_back(result);
}
}
else
//fallback: pick the front satellite because there is no tracked satellites in L1 to assist L5
if (found_signal == false)
{
result = available_GPS_L5_signals_.front();
available_GPS_L5_signals_.pop_front();

View File

@ -38,11 +38,11 @@
#define GNSS_SDR_GNSS_FLOWGRAPH_H_
#include "channel_status_msg_receiver.h"
#include "concurrent_queue.h"
#include "gnss_sdr_sample_counter.h"
#include "gnss_signal.h"
#include "pvt_interface.h"
#include <gnuradio/blocks/null_sink.h> //for null_sink
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr
#include <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <pmt/pmt.h> // for pmt_t
#include <list> // for list
@ -72,7 +72,7 @@ public:
/*!
* \brief Constructor that initializes the receiver flow graph
*/
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const gr::msg_queue::sptr queue); // NOLINT(performance-unnecessary-value-param)
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration, const std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue); // NOLINT(performance-unnecessary-value-param)
/*!
* \brief Destructor
@ -108,6 +108,10 @@ public:
*/
void apply_action(unsigned int who, unsigned int what);
void push_back_signal(Gnss_Signal gs);
void remove_signal(Gnss_Signal gs);
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
unsigned int applied_actions() const
@ -181,7 +185,7 @@ private:
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter;
#endif
gr::top_block_sptr top_block_;
gr::msg_queue::sptr queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue_;
std::list<Gnss_Signal> available_GPS_1C_signals_;
std::list<Gnss_Signal> available_GPS_2S_signals_;

View File

@ -30,7 +30,7 @@
*/
#include "tcp_cmd_interface.h"
#include "control_message_factory.h"
#include "command_event.h"
#include "pvt_interface.h"
#include <boost/asio.hpp>
#include <array>
@ -94,17 +94,16 @@ arma::vec TcpCmdInterface::get_LLH()
std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine __attribute__((unused)))
{
std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(200, 1)); //send the restart message (who=200,what=1)
command_event_sptr new_evnt = command_event_make(200, 1); //send the restart message (who=200,what=1)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
@ -112,10 +111,10 @@ std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine _
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine __attribute__((unused)))
{
std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 10)); //send the standby message (who=300,what=10)
command_event_sptr new_evnt = command_event_make(300, 10); //send the standby message (who=300,what=10)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
else
@ -203,10 +202,10 @@ std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLin
}
else
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 12)); //send the standby message (who=300,what=12)
command_event_sptr new_evnt = command_event_make(300, 12); //send the standby message (who=300,what=12)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
else
@ -250,10 +249,10 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
}
else
{
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 13)); // send the warmstart message (who=300,what=13)
command_event_sptr new_evnt = command_event_make(300, 13); // send the warmstart message (who=300,what=13)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
else
@ -273,16 +272,17 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine __attribute__((unused)))
{
std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr)
{
control_queue_->handle(cmf->GetQueueMessage(300, 11)); // send the coldstart message (who=300,what=11)
command_event_sptr new_evnt = command_event_make(300, 11); // send the coldstart message (who=300,what=11)
control_queue_->push(pmt::make_any(new_evnt));
response = "OK\n";
}
else
{
response = "ERROR\n";
}
return response;
}
@ -296,7 +296,7 @@ std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &co
}
void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue)
void TcpCmdInterface::set_msg_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue)
{
control_queue_ = std::move(control_queue);
}

View File

@ -32,8 +32,9 @@
#define GNSS_SDR_TCP_CMD_INTERFACE_H_
#include "concurrent_queue.h"
#include <armadillo>
#include <gnuradio/msg_queue.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <ctime>
#include <functional>
@ -50,7 +51,7 @@ public:
TcpCmdInterface();
virtual ~TcpCmdInterface();
void run_cmd_server(int tcp_port);
void set_msg_queue(gr::msg_queue::sptr control_queue);
void set_msg_queue(std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue);
/*!
* \brief gets the UTC time parsed from the last TC command issued
@ -77,7 +78,7 @@ private:
void register_functions();
gr::msg_queue::sptr control_queue_;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_;
bool keep_running_;
time_t receiver_utc_time_;

Binary file not shown.

Binary file not shown.

View File

@ -31,7 +31,6 @@
*/
#include "control_message_factory.h"
#include <gtest/gtest.h>
#include <string>

View File

@ -32,7 +32,7 @@
#include "control_thread.h"
#include "control_message_factory.h"
#include "concurrent_queue.h"
#include "in_memory_configuration.h"
#include <boost/exception/diagnostic_information.hpp>
#include <boost/exception_ptr.hpp>
@ -40,7 +40,6 @@
#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gnuradio/message.h>
#include <gnuradio/msg_queue.h>
#include <gtest/gtest.h>
#include <chrono>
#include <exception>
@ -121,7 +120,7 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages /*unused*/)
std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config);
gr::msg_queue::sptr control_queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue = gr::msg_queue::make(0);
std::unique_ptr<ControlMessageFactory> control_msg_factory(new ControlMessageFactory());
@ -182,7 +181,7 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages2 /*unused*/)
std::unique_ptr<ControlThread> control_thread2(new ControlThread(config));
gr::msg_queue::sptr control_queue2 = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue2 = gr::msg_queue::make(0);
std::unique_ptr<ControlMessageFactory> control_msg_factory2(new ControlMessageFactory());
@ -245,7 +244,7 @@ TEST_F(ControlThreadTest /*unused*/, StopReceiverProgrammatically /*unused*/)
config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config);
gr::msg_queue::sptr control_queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue = gr::msg_queue::make(0);
control_thread->set_control_queue(control_queue);
std::thread stop_receiver_thread(stop_receiver);

View File

@ -42,7 +42,7 @@
#include "pvt_interface.h"
#include "telemetry_decoder_interface.h"
#include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>
#include <vector>
@ -53,7 +53,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource)
std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
configuration->set_property("SignalSource.filename", filename);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
// Example of a factory as a shared_ptr
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
// Example of a block as a shared_ptr
@ -67,7 +67,7 @@ TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("SignalSource.implementation", "Pepito");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
// Example of a factory as a unique_ptr
std::unique_ptr<GNSSBlockFactory> factory;
// Example of a block as a unique_ptr
@ -90,7 +90,7 @@ TEST(GNSSBlockFactoryTest, InstantiateSignalConditioner)
TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
configuration->set_property("InputFilter.implementation", "Fir_Filter");
@ -123,7 +123,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
@ -158,7 +158,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
configuration->set_property("InputFilter.implementation", "Pulse_Blanking_Filter");
std::unique_ptr<GNSSBlockFactory> factory;
@ -171,7 +171,7 @@ TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter)
TEST(GNSSBlockFactoryTest, InstantiateNotchFilter)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
configuration->set_property("InputFilter.implementation", "Notch_Filter");
std::unique_ptr<GNSSBlockFactory> factory;
@ -184,7 +184,7 @@ TEST(GNSSBlockFactoryTest, InstantiateNotchFilter)
TEST(GNSSBlockFactoryTest, InstantiateNotchFilterLite)
{
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
configuration->set_property("InputFilter.implementation", "Notch_Filter_Lite");
std::unique_ptr<GNSSBlockFactory> factory;
@ -309,7 +309,7 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels)
configuration->set_property("Channel0.item_type", "gr_complex");
configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
configuration->set_property("Channel1.item_type", "gr_complex");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration, queue);
EXPECT_EQ(static_cast<unsigned int>(2), channels->size());

View File

@ -40,7 +40,7 @@
#include "in_memory_configuration.h"
#include "pass_through.h"
#include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>

View File

@ -342,7 +342,7 @@ protected:
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<AcquisitionInterface> acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -46,7 +46,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -261,7 +261,7 @@ TEST_F(BeidouB1iPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 25000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
init();

View File

@ -46,7 +46,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -260,7 +260,7 @@ TEST_F(BeidouB3iPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 50000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
init();

View File

@ -43,7 +43,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <thread>
@ -134,7 +134,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory;

View File

@ -43,7 +43,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <utility>
@ -134,7 +134,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory;

View File

@ -52,7 +52,7 @@
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/skiphead.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <utility>
@ -140,7 +140,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -47,7 +47,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -265,7 +265,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Acquisition test");
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0);
std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);

View File

@ -44,7 +44,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <thread>
@ -135,7 +135,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory;

View File

@ -142,7 +142,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory;

View File

@ -44,7 +44,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -135,7 +135,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory;

View File

@ -42,7 +42,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <utility>
@ -131,7 +131,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GalileoE5aNoncoherentIQAcquisitionCaf> acquisition;

View File

@ -46,7 +46,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -140,7 +140,7 @@ protected:
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
GlonassL1CaPcpsAcquisition* acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -41,7 +41,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -184,7 +184,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 62314;
std::chrono::time_point<std::chrono::system_clock> begin, end;
std::chrono::duration<double> elapsed_seconds(0);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
init();

View File

@ -45,7 +45,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -142,7 +142,7 @@ protected:
concurrent_queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
GlonassL2CaPcpsAcquisition* acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -46,7 +46,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -140,7 +140,7 @@ protected:
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
GpsL1CaPcpsAcquisition* acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -46,7 +46,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -262,7 +262,7 @@ TEST_F(GpsL1CaPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 4000;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = gr::msg_queue::make(0);
top_block = gr::make_top_block("Acquisition test");
init();

View File

@ -41,7 +41,7 @@
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/throttle.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>

View File

@ -45,7 +45,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <chrono>
#include <thread>
@ -140,7 +140,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GpsL1CaPcpsOpenClAcquisition> acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -43,7 +43,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -141,7 +141,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<GpsL1CaPcpsQuickSyncAcquisition> acquisition;

View File

@ -45,7 +45,7 @@
#include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -135,7 +135,7 @@ protected:
void stop_queue();
Concurrent_Queue<int> channel_internal_queue;
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GpsL1CaPcpsTongAcquisition> acquisition;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -47,7 +47,7 @@
#include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/interleaved_short_to_complex.h>
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gnuradio/top_block.h>
#include <gtest/gtest.h>
#include <chrono>
@ -143,7 +143,7 @@ protected:
void init();
void plot_grid();
gr::msg_queue::sptr queue;
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue;
gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config;

View File

@ -48,7 +48,7 @@
#include "interleaved_byte_to_complex_byte.h"
#include "interleaved_short_to_complex_short.h"
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>

View File

@ -46,7 +46,7 @@
#include "in_memory_configuration.h"
#include "notch_filter_lite.h"
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>

View File

@ -46,7 +46,7 @@
#include "in_memory_configuration.h"
#include "notch_filter.h"
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>

View File

@ -46,7 +46,7 @@
#include "in_memory_configuration.h"
#include "pulse_blanking_filter.h"
#include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include "concurrent_queue.h"
#include <gtest/gtest.h>

Some files were not shown because too many files have changed in this diff Show More