1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-08-07 22:43:52 +00:00

Merge branch 'newsatdispatcher' of https://github.com/gnss-sdr/gnss-sdr into telemetry

This commit is contained in:
Carles Fernandez 2019-07-19 23:12:38 +02:00
commit 739c008f49
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
125 changed files with 1813 additions and 1790 deletions

View File

@ -126,9 +126,12 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
{ {
// Send feedback message to observables block with the receiver clock offset // Send feedback message to observables block with the receiver clock offset
this->message_port_register_out(pmt::mp("pvt_to_observables")); this->message_port_register_out(pmt::mp("pvt_to_observables"));
// Send PVT status to gnss_flowgraph
this->message_port_register_out(pmt::mp("status"));
d_output_rate_ms = conf_.output_rate_ms; d_output_rate_ms = conf_.output_rate_ms;
d_display_rate_ms = conf_.display_rate_ms; d_display_rate_ms = conf_.display_rate_ms;
d_report_rate_ms = 1000; //report every second PVT to gnss_synchro
d_dump = conf_.dump; d_dump = conf_.dump;
d_dump_mat = conf_.dump_mat and d_dump; d_dump_mat = conf_.dump_mat and d_dump;
d_dump_filename = conf_.dump_filename; d_dump_filename = conf_.dump_filename;
@ -3729,10 +3732,19 @@ int rtklib_pvt_gs::work(int noutput_items, gr_vector_const_void_star& input_item
} }
// PVT MONITOR // PVT MONITOR
if (d_pvt_solver->is_valid_position() and flag_monitor_pvt_enabled) if (d_pvt_solver->is_valid_position())
{ {
Monitor_Pvt monitor_pvt = d_pvt_solver->get_monitor_pvt(); std::shared_ptr<Monitor_Pvt> monitor_pvt = std::make_shared<Monitor_Pvt>(d_pvt_solver->get_monitor_pvt());
udp_sink_ptr->write_monitor_pvt(monitor_pvt);
//publish new position to the gnss_flowgraph channel status monitor
if (current_RX_time_ms % d_report_rate_ms == 0)
{
this->message_port_pub(pmt::mp("status"), pmt::make_any(monitor_pvt));
}
if (flag_monitor_pvt_enabled)
{
udp_sink_ptr->write_monitor_pvt(monitor_pvt);
}
} }
} }
} }

View File

@ -169,6 +169,7 @@ private:
int32_t d_output_rate_ms; int32_t d_output_rate_ms;
int32_t d_display_rate_ms; int32_t d_display_rate_ms;
int32_t d_report_rate_ms;
std::shared_ptr<Rinex_Printer> rp; std::shared_ptr<Rinex_Printer> rp;
std::shared_ptr<Kml_Printer> d_kml_dump; std::shared_ptr<Kml_Printer> d_kml_dump;

View File

@ -51,14 +51,14 @@ Monitor_Pvt_Udp_Sink::Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addre
} }
bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(const Monitor_Pvt& monitor_pvt) bool Monitor_Pvt_Udp_Sink::write_monitor_pvt(std::shared_ptr<Monitor_Pvt> monitor_pvt)
{ {
std::string outbound_data; std::string outbound_data;
if (use_protobuf == false) if (use_protobuf == false)
{ {
std::ostringstream archive_stream; std::ostringstream archive_stream;
boost::archive::binary_oarchive oa{archive_stream}; boost::archive::binary_oarchive oa{archive_stream};
oa << monitor_pvt; oa << *monitor_pvt.get();
outbound_data = archive_stream.str(); outbound_data = archive_stream.str();
} }
else else

View File

@ -45,8 +45,8 @@ using b_io_context = boost::asio::io_service;
class Monitor_Pvt_Udp_Sink class Monitor_Pvt_Udp_Sink
{ {
public: public:
Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t &port, bool protobuf_enabled); Monitor_Pvt_Udp_Sink(const std::vector<std::string>& addresses, const uint16_t& port, bool protobuf_enabled);
bool write_monitor_pvt(const Monitor_Pvt &monitor_pvt); bool write_monitor_pvt(std::shared_ptr<Monitor_Pvt> monitor_pvt);
private: private:
b_io_context io_context; b_io_context io_context;

View File

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

View File

@ -34,7 +34,7 @@
#include "monitor_pvt.h" #include "monitor_pvt.h"
#include "monitor_pvt.pb.h" // file created by Protocol Buffers at compile time #include "monitor_pvt.pb.h" // file created by Protocol Buffers at compile time
#include <memory>
/*! /*!
* \brief This class implements serialization and deserialization of * \brief This class implements serialization and deserialization of
@ -80,40 +80,40 @@ public:
return *this; return *this;
} }
inline std::string createProtobuffer(const Monitor_Pvt& monitor) //!< Serialization into a string inline std::string createProtobuffer(std::shared_ptr<Monitor_Pvt> monitor) //!< Serialization into a string
{ {
monitor_.Clear(); monitor_.Clear();
std::string data; std::string data;
monitor_.set_tow_at_current_symbol_ms(monitor.TOW_at_current_symbol_ms); monitor_.set_tow_at_current_symbol_ms(monitor->TOW_at_current_symbol_ms);
monitor_.set_week(monitor.week); monitor_.set_week(monitor->week);
monitor_.set_rx_time(monitor.RX_time); monitor_.set_rx_time(monitor->RX_time);
monitor_.set_user_clk_offset(monitor.user_clk_offset); monitor_.set_user_clk_offset(monitor->user_clk_offset);
monitor_.set_pos_x(monitor.pos_x); monitor_.set_pos_x(monitor->pos_x);
monitor_.set_pos_y(monitor.pos_y); monitor_.set_pos_y(monitor->pos_y);
monitor_.set_pos_z(monitor.pos_z); monitor_.set_pos_z(monitor->pos_z);
monitor_.set_vel_x(monitor.vel_x); monitor_.set_vel_x(monitor->vel_x);
monitor_.set_vel_y(monitor.vel_y); monitor_.set_vel_y(monitor->vel_y);
monitor_.set_vel_z(monitor.vel_z); monitor_.set_vel_z(monitor->vel_z);
monitor_.set_cov_xx(monitor.cov_xx); monitor_.set_cov_xx(monitor->cov_xx);
monitor_.set_cov_yy(monitor.cov_yy); monitor_.set_cov_yy(monitor->cov_yy);
monitor_.set_cov_zz(monitor.cov_zz); monitor_.set_cov_zz(monitor->cov_zz);
monitor_.set_cov_xy(monitor.cov_xy); monitor_.set_cov_xy(monitor->cov_xy);
monitor_.set_cov_yz(monitor.cov_yz); monitor_.set_cov_yz(monitor->cov_yz);
monitor_.set_cov_zx(monitor.cov_zx); monitor_.set_cov_zx(monitor->cov_zx);
monitor_.set_latitude(monitor.latitude); monitor_.set_latitude(monitor->latitude);
monitor_.set_longitude(monitor.longitude); monitor_.set_longitude(monitor->longitude);
monitor_.set_height(monitor.height); monitor_.set_height(monitor->height);
monitor_.set_valid_sats(monitor.valid_sats); monitor_.set_valid_sats(monitor->valid_sats);
monitor_.set_solution_status(monitor.solution_status); monitor_.set_solution_status(monitor->solution_status);
monitor_.set_solution_type(monitor.solution_type); monitor_.set_solution_type(monitor->solution_type);
monitor_.set_ar_ratio_factor(monitor.AR_ratio_factor); monitor_.set_ar_ratio_factor(monitor->AR_ratio_factor);
monitor_.set_ar_ratio_threshold(monitor.AR_ratio_threshold); monitor_.set_ar_ratio_threshold(monitor->AR_ratio_threshold);
monitor_.set_gdop(monitor.gdop); monitor_.set_gdop(monitor->gdop);
monitor_.set_pdop(monitor.pdop); monitor_.set_pdop(monitor->pdop);
monitor_.set_hdop(monitor.hdop); monitor_.set_hdop(monitor->hdop);
monitor_.set_vdop(monitor.vdop); monitor_.set_vdop(monitor->vdop);
monitor_.SerializeToString(&data); monitor_.SerializeToString(&data);
return data; return data;

View File

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

View File

@ -42,7 +42,7 @@
Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq, Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav, 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); acq_ = std::move(acq);
trk_ = std::move(trk); trk_ = std::move(trk);

View File

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

View File

@ -24,7 +24,7 @@ set(CHANNEL_FSM_SOURCES
set(CHANNEL_FSM_HEADERS set(CHANNEL_FSM_HEADERS
channel_fsm.h channel_fsm.h
channel_msg_receiver_cc.h channel_msg_receiver_cc.h
) )
list(SORT CHANNEL_FSM_HEADERS) list(SORT CHANNEL_FSM_HEADERS)
list(SORT CHANNEL_FSM_SOURCES) list(SORT CHANNEL_FSM_SOURCES)
@ -35,14 +35,14 @@ add_library(channel_libs ${CHANNEL_FSM_SOURCES} ${CHANNEL_FSM_HEADERS})
target_link_libraries(channel_libs target_link_libraries(channel_libs
PUBLIC PUBLIC
core_libs
core_system_parameters
Gnuradio::runtime Gnuradio::runtime
Gnuradio::pmt Gnuradio::pmt
core_system_parameters
PRIVATE PRIVATE
Boost::boost Boost::boost
Gflags::gflags Gflags::gflags
Glog::glog Glog::glog
core_receiver
) )
if(ENABLE_CLANG_TIDY) if(ENABLE_CLANG_TIDY)

View File

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

View File

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

View File

@ -84,6 +84,9 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
this->message_port_register_in(pmt::mp("pvt_to_observables")); this->message_port_register_in(pmt::mp("pvt_to_observables"));
this->set_msg_handler(pmt::mp("pvt_to_observables"), boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, _1)); this->set_msg_handler(pmt::mp("pvt_to_observables"), boost::bind(&hybrid_observables_gs::msg_handler_pvt_to_observables, this, _1));
// Send Channel status to gnss_flowgraph
this->message_port_register_out(pmt::mp("status"));
d_dump = dump; d_dump = dump;
d_dump_mat = dump_mat and d_dump; d_dump_mat = dump_mat and d_dump;
d_dump_filename = std::move(dump_filename); d_dump_filename = std::move(dump_filename);
@ -140,7 +143,7 @@ hybrid_observables_gs::hybrid_observables_gs(uint32_t nchannels_in,
T_rx_remnant_to_20ms = 0; T_rx_remnant_to_20ms = 0;
T_rx_step_ms = 20; //read from config at the adapter GNSS-SDR.observable_interval_ms!! T_rx_step_ms = 20; //read from config at the adapter GNSS-SDR.observable_interval_ms!!
T_rx_TOW_set = false; T_rx_TOW_set = false;
T_status_report_timer_ms = 0;
// rework // rework
d_Rx_clock_buffer.set_capacity(10); // 10*20 ms = 200 ms of data in buffer d_Rx_clock_buffer.set_capacity(10); // 10*20 ms = 200 ms of data in buffer
d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer d_Rx_clock_buffer.clear(); // Clear all the elements in the buffer
@ -618,6 +621,20 @@ int hybrid_observables_gs::general_work(int noutput_items __attribute__((unused)
{ {
out[n][0] = epoch_data.at(n); out[n][0] = epoch_data.at(n);
} }
//report channel status every second
T_status_report_timer_ms += T_rx_step_ms;
if (T_status_report_timer_ms >= 1000)
{
for (uint32_t n = 0; n < d_nchannels_out; n++)
{
std::shared_ptr<Gnss_Synchro> gnss_synchro_sptr = std::make_shared<Gnss_Synchro>(epoch_data.at(n));
//publish valid gnss_synchro to the gnss_flowgraph channel status monitor
this->message_port_pub(pmt::mp("status"), pmt::make_any(gnss_synchro_sptr));
}
T_status_report_timer_ms = 0;
}
if (d_dump) if (d_dump)
{ {
// MULTIPLEXED FILE RECORDING - Record results to file // MULTIPLEXED FILE RECORDING - Record results to file

View File

@ -90,6 +90,7 @@ private:
uint32_t T_rx_TOW_ms; uint32_t T_rx_TOW_ms;
uint32_t T_rx_remnant_to_20ms; uint32_t T_rx_remnant_to_20ms;
uint32_t T_rx_step_ms; uint32_t T_rx_step_ms;
uint32_t T_status_report_timer_ms;
uint32_t d_nchannels_in; uint32_t d_nchannels_in;
uint32_t d_nchannels_out; uint32_t d_nchannels_out;
double T_rx_offset_ms; double T_rx_offset_ms;

View File

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

View File

@ -44,7 +44,7 @@
SignalGenerator::SignalGenerator(ConfigurationInterface* configuration, SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, 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_item_type = "gr_complex";
std::string default_dump_file = "./data/gen_source.dat"; std::string default_dump_file = "./data/gen_source.dat";

View File

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

View File

@ -48,7 +48,7 @@
Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration, Ad9361FpgaSignalSource::Ad9361FpgaSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat"; std::string default_dump_file = "./data/signal_source.dat";

View File

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

View File

@ -40,7 +40,7 @@
CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration, CustomUDPSignalSource::CustomUDPSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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 // DUMP PARAMETERS
std::string empty = ""; std::string empty = "";

View File

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

View File

@ -44,7 +44,7 @@
FileSignalSource::FileSignalSource(ConfigurationInterface* configuration, FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams, 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_filename = "./example_capture.dat";
std::string default_item_type = "short"; std::string default_item_type = "short";

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@
Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration, Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat"; std::string default_dump_file = "./data/signal_source.dat";

View File

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

View File

@ -42,7 +42,7 @@
// Constructor // Constructor
GenSignalSource::GenSignalSource(GNSSBlockInterface *signal_generator, GNSSBlockInterface *filter, 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), filter_(filter),
role_(std::move(role)), role_(std::move(role)),
queue_(std::move(queue)) queue_(std::move(queue))

View File

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

View File

@ -32,12 +32,11 @@
#include "configuration_interface.h" #include "configuration_interface.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h>
#include <gn3s/gn3s_source_cc.h> #include <gn3s/gn3s_source_cc.h>
Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration, 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_item_type = "short";
std::string default_dump_file = "./data/gn3s_source.dat"; std::string default_dump_file = "./data/gn3s_source.dat";

View File

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

View File

@ -37,7 +37,7 @@
LabsatSignalSource::LabsatSignalSource(ConfigurationInterface* configuration, 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_item_type = "gr_complex";
std::string default_dump_file = "./labsat_output.dat"; std::string default_dump_file = "./labsat_output.dat";

View File

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

View File

@ -43,7 +43,7 @@
MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration, MultichannelFileSignalSource::MultichannelFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams, 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_filename = "./example_capture.dat";
std::string default_item_type = "short"; std::string default_item_type = "short";

View File

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

View File

@ -44,7 +44,7 @@
NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration, NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams, 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_filename = "../data/my_capture.dat";
std::string default_item_type = "byte"; std::string default_item_type = "byte";

View File

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

View File

@ -42,7 +42,7 @@
OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration, OsmosdrSignalSource::OsmosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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 // DUMP PARAMETERS
std::string empty = ""; std::string empty = "";

View File

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

View File

@ -39,7 +39,7 @@
PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration, PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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_item_type = "gr_complex";
std::string default_dump_file = "./data/signal_source.dat"; std::string default_dump_file = "./data/signal_source.dat";

View File

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

View File

@ -29,15 +29,16 @@
*/ */
#include "raw_array_signal_source.h" #include "raw_array_signal_source.h"
#include "concurrent_queue.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/blocks/file_sink.h> #include <gnuradio/blocks/file_sink.h>
#include <gnuradio/msg_queue.h> #include <pmt/pmt.h>
#include <dbfcttc/raw_array.h> #include <dbfcttc/raw_array.h>
RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration, 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_item_type = "gr_complex";
std::string default_dump_file = "./data/raw_array_source.dat"; std::string default_dump_file = "./data/raw_array_source.dat";

View File

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

View File

@ -45,7 +45,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
const std::string& role, const std::string& role,
unsigned int in_stream, unsigned int in_stream,
unsigned int out_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), in_stream_(in_stream),
out_stream_(out_stream), out_stream_(out_stream),
queue_(std::move(queue)) queue_(std::move(queue))

View File

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

View File

@ -43,7 +43,7 @@
SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration, SpirFileSignalSource::SpirFileSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_streams, unsigned int out_streams, 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_filename = "../data/my_capture.dat";
std::string default_item_type = "int"; std::string default_item_type = "int";

View File

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

View File

@ -40,7 +40,7 @@
SpirGSS6450FileSignalSource::SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, 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_filename = "../data/my_capture.dat";
std::string default_dump_filename = "../data/my_capture_dump.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_ #ifndef GNSS_SDR_SPIR_GSS6450_FILE_SIGNAL_SOURCE_H_
#define 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_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
#include "unpack_spir_gss6450_samples.h" #include "unpack_spir_gss6450_samples.h"
@ -42,7 +43,7 @@
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/throttle.h> #include <gnuradio/blocks/throttle.h>
#include <gnuradio/hier_block2.h> #include <gnuradio/hier_block2.h>
#include <gnuradio/msg_queue.h> #include <pmt/pmt.h>
#include <cstdint> #include <cstdint>
#include <string> #include <string>
#include <vector> #include <vector>
@ -58,7 +59,7 @@ class SpirGSS6450FileSignalSource : public GNSSBlockInterface
{ {
public: public:
SpirGSS6450FileSignalSource(ConfigurationInterface* configuration, const std::string& role, 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(); virtual ~SpirGSS6450FileSignalSource();
inline std::string role() override inline std::string role() override
@ -131,7 +132,7 @@ private:
std::vector<boost::shared_ptr<gr::block>> valve_vec_; std::vector<boost::shared_ptr<gr::block>> valve_vec_;
std::vector<gr::blocks::file_sink::sptr> sink_vec_; std::vector<gr::blocks::file_sink::sptr> sink_vec_;
std::vector<gr::blocks::throttle::sptr> throttle_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_; size_t item_size_;
}; };

View File

@ -45,7 +45,7 @@ TwoBitCpxFileSignalSource::TwoBitCpxFileSignalSource(ConfigurationInterface* con
const std::string& role, const std::string& role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_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), in_streams_(in_streams),
out_streams_(out_streams), out_streams_(out_streams),
queue_(std::move(queue)) queue_(std::move(queue))

View File

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

View File

@ -47,7 +47,7 @@ TwoBitPackedFileSignalSource::TwoBitPackedFileSignalSource(ConfigurationInterfac
const std::string& role, const std::string& role,
unsigned int in_streams, unsigned int in_streams,
unsigned int out_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), in_streams_(in_streams),
out_streams_(out_streams), out_streams_(out_streams),
queue_(std::move(queue)) queue_(std::move(queue))

View File

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

View File

@ -42,7 +42,7 @@
UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration, UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
const std::string& role, unsigned int in_stream, unsigned int out_stream, 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 // DUMP PARAMETERS
std::string empty = ""; std::string empty = "";

View File

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

View File

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

View File

@ -31,8 +31,9 @@
#ifndef GNSS_SDR_LABSAT23_SOURCE_H #ifndef GNSS_SDR_LABSAT23_SOURCE_H
#define GNSS_SDR_LABSAT23_SOURCE_H #define GNSS_SDR_LABSAT23_SOURCE_H
#include "concurrent_queue.h"
#include <gnuradio/block.h> #include <gnuradio/block.h>
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr #include <pmt/pmt.h>
#include <cstdint> #include <cstdint>
#include <fstream> #include <fstream>
#include <string> #include <string>
@ -45,7 +46,7 @@ using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
labsat23_source_sptr labsat23_make_source_sptr( labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename, const char *signal_file_basename,
int channel_selector, 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 * \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( friend labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename, const char *signal_file_basename,
int channel_selector, int channel_selector,
gr::msg_queue::sptr queue); std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
labsat23_source(const char *signal_file_basename, labsat23_source(const char *signal_file_basename,
int channel_selector, int channel_selector,
gr::msg_queue::sptr queue); std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue);
std::string generate_filename(); std::string generate_filename();
void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type); void decode_samples_one_channel(int16_t input_short, gr_complex *out, int type);
@ -82,7 +83,7 @@ private:
std::ifstream *binary_input_file; std::ifstream *binary_input_file;
uint8_t d_ref_clock; uint8_t d_ref_clock;
uint8_t d_bits_per_sample; uint8_t d_bits_per_sample;
gr::msg_queue::sptr d_queue; std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> d_queue;
}; };
#endif #endif

View File

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

View File

@ -32,17 +32,17 @@
*/ */
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
#include "control_message_factory.h" // for ControlMessageFactory #include "command_event.h"
#include <glog/logging.h> // for LOG #include <glog/logging.h> // for LOG
#include <gnuradio/io_signature.h> // for io_signature #include <gnuradio/io_signature.h> // for io_signature
#include <algorithm> // for min #include <algorithm> // for min
#include <cstring> // for memcpy #include <cstring> // for memcpy
#include <unistd.h> // for usleep #include <unistd.h> // for usleep
#include <utility> #include <utility>
Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item, Gnss_Sdr_Valve::Gnss_Sdr_Valve(size_t sizeof_stream_item,
uint64_t nitems, uint64_t nitems,
gr::msg_queue::sptr queue, std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue,
bool stop_flowgraph) : gr::sync_block("valve", 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),
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)); boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), stop_flowgraph));
return valve_; 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)); boost::shared_ptr<Gnss_Sdr_Valve> valve_(new Gnss_Sdr_Valve(sizeof_stream_item, nitems, std::move(queue), true));
return valve_; return valve_;
@ -83,10 +83,8 @@ int Gnss_Sdr_Valve::work(int noutput_items,
{ {
if (d_ncopied_items >= d_nitems) 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"; 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) if (d_stop_flowgraph)
{ {
return -1; // Done! return -1; // Done!

View File

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

View File

@ -24,6 +24,8 @@ set(CORE_LIBS_SOURCES
string_converter.cc string_converter.cc
gnss_sdr_supl_client.cc gnss_sdr_supl_client.cc
gnss_sdr_sample_counter.cc gnss_sdr_sample_counter.cc
channel_status_msg_receiver.cc
channel_event.cc
) )
set(CORE_LIBS_HEADERS set(CORE_LIBS_HEADERS
@ -32,6 +34,8 @@ set(CORE_LIBS_HEADERS
string_converter.h string_converter.h
gnss_sdr_supl_client.h gnss_sdr_supl_client.h
gnss_sdr_sample_counter.h gnss_sdr_sample_counter.h
channel_status_msg_receiver.h
channel_event.h
) )
if(ENABLE_FPGA) if(ENABLE_FPGA)
@ -60,6 +64,7 @@ target_link_libraries(core_libs
Gnuradio::runtime Gnuradio::runtime
core_libs_supl core_libs_supl
core_system_parameters core_system_parameters
pvt_libs
PRIVATE PRIVATE
Boost::serialization Boost::serialization
Gflags::gflags Gflags::gflags

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,116 @@
/*!
* \file channel_status_msg_receiver.cc
* \brief GNU Radio block that receives asynchronous channel messages from acquisition and tracking blocks
* \author Javier Arribas, 2016. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* 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 "channel_status_msg_receiver.h"
#include <boost/any.hpp>
#include <boost/bind.hpp>
#include <glog/logging.h>
#include <gnuradio/gr_complex.h>
#include <gnuradio/io_signature.h>
#include <cstdint>
#include <utility>
channel_status_msg_receiver_sptr channel_status_msg_receiver_make()
{
return channel_status_msg_receiver_sptr(new channel_status_msg_receiver());
}
channel_status_msg_receiver::channel_status_msg_receiver() : gr::block("channel_status_msg_receiver", gr::io_signature::make(0, 0, 0), gr::io_signature::make(0, 0, 0))
{
this->message_port_register_in(pmt::mp("status"));
this->set_msg_handler(pmt::mp("status"), boost::bind(&channel_status_msg_receiver::msg_handler_events, this, _1));
d_pvt_status.RX_time = -1; // to indicate that the PVT is not available
}
channel_status_msg_receiver::~channel_status_msg_receiver() = default;
void channel_status_msg_receiver::msg_handler_events(pmt::pmt_t msg)
{
gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_events function called by the scheduler
try
{
// ************* Gnss_Synchro received *****************
if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Gnss_Synchro>))
{
std::shared_ptr<Gnss_Synchro> gnss_synchro_obj;
gnss_synchro_obj = boost::any_cast<std::shared_ptr<Gnss_Synchro>>(pmt::any_ref(msg));
if (gnss_synchro_obj->Flag_valid_pseudorange == true)
{
d_channel_status_map[gnss_synchro_obj->Channel_ID] = gnss_synchro_obj;
}
else
{
d_channel_status_map.erase(gnss_synchro_obj->Channel_ID);
}
// std::cout << "-------- \n\n";
// for (std::map<int, std::shared_ptr<Gnss_Synchro>>::iterator it = d_channel_status_map.begin(); it != d_channel_status_map.end(); ++it)
// {
// std::cout << " Channel: " << it->first << " => Doppler: " << it->second->Carrier_Doppler_hz << "[Hz] \n";
// }
// std::cout << "-------- \n\n";
}
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr<Monitor_Pvt>))
{
// ************* Monitor_Pvt received *****************
std::shared_ptr<Monitor_Pvt> monitor_pvt_obj;
monitor_pvt_obj = boost::any_cast<std::shared_ptr<Monitor_Pvt>>(pmt::any_ref(msg));
d_pvt_status = *monitor_pvt_obj.get();
//
// std::cout << "-------- \n\n";
// std::cout << "PVT TOW: " << d_pvt_status->TOW_at_current_symbol_ms << std::endl;
// std::cout << "-------- \n\n";
}
else
{
LOG(WARNING) << "channel_status_msg_receiver unknown object type!";
}
}
catch (boost::bad_any_cast& e)
{
LOG(WARNING) << "channel_status_msg_receiver Bad any cast!";
}
}
std::map<int, std::shared_ptr<Gnss_Synchro>> channel_status_msg_receiver::get_current_status_map()
{
gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_events function called by the scheduler
return d_channel_status_map;
}
Monitor_Pvt channel_status_msg_receiver::get_current_status_pvt()
{
gr::thread::scoped_lock lock(d_setlock); // require mutex with msg_handler_events function called by the scheduler
return d_pvt_status;
}

View File

@ -0,0 +1,71 @@
/*!
* \file channel_msg_receiver_cc.h
* \brief GNU Radio block that receives asynchronous channel messages from acquisition and tracking blocks
* \author Javier Arribas, 2016. jarribas(at)cttc.es
*
* -------------------------------------------------------------------------
*
* 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_CHANNEL_STATUS_MSG_RECEIVER_CC_H
#define GNSS_SDR_CHANNEL_STATUS_MSG_RECEIVER_CC_H
#include "gnss_synchro.h"
#include "monitor_pvt.h"
#include <gnuradio/block.h>
#include <pmt/pmt.h>
#include <memory>
class channel_status_msg_receiver;
using channel_status_msg_receiver_sptr = boost::shared_ptr<channel_status_msg_receiver>;
channel_status_msg_receiver_sptr channel_status_msg_receiver_make();
/*!
* \brief GNU Radio block that receives asynchronous channel messages from tlm blocks
*/
class channel_status_msg_receiver : public gr::block
{
public:
~channel_status_msg_receiver(); //!< Default destructor
/*!
* \brief return the current status map of all channels with valid telemetry
*/
std::map<int, std::shared_ptr<Gnss_Synchro>> get_current_status_map();
/*!
* \brief return the current receiver PVT
*/
Monitor_Pvt get_current_status_pvt();
private:
friend channel_status_msg_receiver_sptr channel_status_msg_receiver_make();
channel_status_msg_receiver();
std::map<int, std::shared_ptr<Gnss_Synchro>> d_channel_status_map;
Monitor_Pvt d_pvt_status;
void msg_handler_events(pmt::pmt_t msg);
};
#endif

View File

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

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

@ -33,10 +33,10 @@
*/ */
#include "control_thread.h" #include "control_thread.h"
#include "channel_event.h"
#include "command_event.h"
#include "concurrent_map.h" #include "concurrent_map.h"
#include "concurrent_queue.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "control_message_factory.h"
#include "file_configuration.h" #include "file_configuration.h"
#include "galileo_almanac.h" #include "galileo_almanac.h"
#include "galileo_ephemeris.h" #include "galileo_ephemeris.h"
@ -62,7 +62,6 @@
#include "rtklib_rtkcmn.h" // for utc2gpst #include "rtklib_rtkcmn.h" // for utc2gpst
#include <boost/lexical_cast.hpp> // for bad_lexical_cast #include <boost/lexical_cast.hpp> // for bad_lexical_cast
#include <glog/logging.h> // for LOG #include <glog/logging.h> // for LOG
#include <gnuradio/message.h> // for message::sptr
#include <pmt/pmt.h> // for make_any #include <pmt/pmt.h> // for make_any
#include <algorithm> // for find, min #include <algorithm> // for find, min
#include <chrono> // for milliseconds #include <chrono> // for milliseconds
@ -110,7 +109,7 @@ ControlThread::ControlThread(std::shared_ptr<ConfigurationInterface> configurati
void ControlThread::init() void ControlThread::init()
{ {
// Instantiates a control queue, a GNSS flowgraph, and a control message factory // 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 cmd_interface_.set_msg_queue(control_queue_); //set also the queue pointer for the telecommand thread
try try
{ {
@ -120,7 +119,6 @@ void ControlThread::init()
{ {
std::cout << "Caught bad lexical cast with error " << e.what() << std::endl; std::cout << "Caught bad lexical cast with error " << e.what() << std::endl;
} }
control_message_factory_ = std::make_shared<ControlMessageFactory>();
stop_ = false; stop_ = false;
processed_control_messages_ = 0; processed_control_messages_ = 0;
applied_actions_ = 0; applied_actions_ = 0;
@ -226,6 +224,49 @@ void ControlThread::telecommand_listener()
} }
} }
void ControlThread::event_dispatcher(bool &valid_event, pmt::pmt_t &msg)
{
if (valid_event)
{
if (pmt::any_ref(msg).type() == typeid(channel_event_sptr))
{
channel_event_sptr new_event;
new_event = boost::any_cast<channel_event_sptr>(pmt::any_ref(msg));
DLOG(INFO) << "New channel event rx from ch id: " << new_event->channel_id
<< " what: " << new_event->event_type;
flowgraph_->apply_action(new_event->channel_id, new_event->event_type);
}
else if (pmt::any_ref(msg).type() == typeid(command_event_sptr))
{
command_event_sptr new_event;
new_event = boost::any_cast<command_event_sptr>(pmt::any_ref(msg));
DLOG(INFO) << "New command event rx from ch id: " << new_event->command_id
<< " what: " << new_event->event_type;
if (new_event->command_id == 200)
{
apply_action(new_event->event_type);
}
else
{
if (new_event->command_id == 300) // some TC commands require also actions from control_thread
{
apply_action(new_event->event_type);
}
flowgraph_->apply_action(new_event->command_id, new_event->event_type);
}
}
else
{
DLOG(INFO) << "Control Queue: unknown object type!\n";
}
}
else
{
//perform non-priority tasks
flowgraph_->acquisition_manager(0); //start acquisition of untracked satellites
}
}
/* /*
* Runs the control thread that manages the receiver control plane * Runs the control thread that manages the receiver control plane
@ -285,14 +326,13 @@ int ControlThread::run()
flowgraph_); flowgraph_);
#endif #endif
// Main loop to read and process the control messages // Main loop to read and process the control messages
pmt::pmt_t msg;
while (flowgraph_->running() && !stop_) while (flowgraph_->running() && !stop_)
{ {
//TODO re-enable the blocking read messages functions and fork the process //read event messages, triggered by event signaling with a 100 ms timeout to perform low priority receiver management tasks
read_control_messages(); bool valid_event = control_queue_->timed_wait_and_pop(msg, 100);
if (control_messages_ != nullptr) //call the new sat dispatcher and receiver controller
{ event_dispatcher(valid_event, msg);
process_control_messages();
}
} }
std::cout << "Stopping GNSS-SDR, please wait!" << std::endl; std::cout << "Stopping GNSS-SDR, please wait!" << std::endl;
flowgraph_->stop(); flowgraph_->stop();
@ -325,7 +365,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()) if (flowgraph_->running())
{ {
@ -790,50 +830,6 @@ 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();
}
}
// 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();
DLOG(INFO) << "Processed all control messages";
}
void ControlThread::apply_action(unsigned int what) void ControlThread::apply_action(unsigned int what)
{ {
std::shared_ptr<PvtInterface> pvt_ptr; std::shared_ptr<PvtInterface> pvt_ptr;
@ -1092,11 +1088,7 @@ void ControlThread::sysv_queue_listener()
if ((std::abs(received_message - (-200.0)) < 10 * std::numeric_limits<double>::epsilon())) if ((std::abs(received_message - (-200.0)) < 10 * std::numeric_limits<double>::epsilon()))
{ {
std::cout << "Quit order received, stopping GNSS-SDR !!" << std::endl; std::cout << "Quit order received, stopping GNSS-SDR !!" << std::endl;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); control_queue_->push(pmt::make_any(command_event_make(200, 0)));
if (control_queue_ != gr::msg_queue::sptr())
{
control_queue_->handle(cmf->GetQueueMessage(200, 0));
}
read_queue = false; read_queue = false;
} }
} }
@ -1114,11 +1106,7 @@ void ControlThread::keyboard_listener()
if (c == 'q') if (c == 'q')
{ {
std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl; std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); control_queue_->push(pmt::make_any(command_event_make(200, 0)));
if (control_queue_ != gr::msg_queue::sptr())
{
control_queue_->handle(cmf->GetQueueMessage(200, 0));
}
read_keys = false; read_keys = false;
} }
std::this_thread::sleep_for(std::chrono::milliseconds(100)); std::this_thread::sleep_for(std::chrono::milliseconds(100));

View File

@ -35,20 +35,20 @@
#ifndef GNSS_SDR_CONTROL_THREAD_H_ #ifndef GNSS_SDR_CONTROL_THREAD_H_
#define GNSS_SDR_CONTROL_THREAD_H_ #define GNSS_SDR_CONTROL_THREAD_H_
#include "agnss_ref_location.h" // for Agnss_Ref_Location #include "agnss_ref_location.h" // for Agnss_Ref_Location
#include "agnss_ref_time.h" // for Agnss_Ref_Time #include "agnss_ref_time.h" // for Agnss_Ref_Time
#include "control_message_factory.h" // for ControlMessage #include "concurrent_queue.h"
#include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client #include "gnss_sdr_supl_client.h" // for Gnss_Sdr_Supl_Client
#include "tcp_cmd_interface.h" // for TcpCmdInterface #include "tcp_cmd_interface.h" // for TcpCmdInterface
#include <armadillo> // for arma::vec #include <armadillo> // for arma::vec
#include <boost/thread.hpp> // for boost::thread #include <boost/thread.hpp> // for boost::thread
#include <gnuradio/msg_queue.h> // for msg_queue, msg_queue::sptr #include <pmt/pmt.h>
#include <ctime> // for time_t #include <ctime> // for time_t
#include <memory> // for shared_ptr #include <memory> // for shared_ptr
#include <string> // for string #include <string> // for string
#include <thread> // for std::thread #include <thread> // for std::thread
#include <utility> // for pair #include <utility> // for pair
#include <vector> // for vector #include <vector> // for vector
class ConfigurationInterface; class ConfigurationInterface;
class GNSSFlowgraph; class GNSSFlowgraph;
@ -95,9 +95,9 @@ public:
/*! /*!
* \brief Sets the control_queue * \brief Sets the control_queue
* *
* \param[in] boost::shared_ptr<gr::msg_queue> control_queue * \param[in] std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> 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() unsigned int processed_control_messages()
{ {
@ -123,6 +123,10 @@ private:
//Telecommand TCP interface //Telecommand TCP interface
TcpCmdInterface cmd_interface_; TcpCmdInterface cmd_interface_;
void telecommand_listener(); void telecommand_listener();
/*
* New receiver event dispatcher
*/
void event_dispatcher(bool &valid_event, pmt::pmt_t &msg);
std::thread cmd_interface_thread_; std::thread cmd_interface_thread_;
//SUPL assistance classes //SUPL assistance classes
Gnss_Sdr_Supl_Client supl_client_acquisition_; Gnss_Sdr_Supl_Client supl_client_acquisition_;
@ -140,10 +144,6 @@ private:
// Save {ephemeris, iono, utc, ref loc, ref time} assistance to a local XML file // Save {ephemeris, iono, utc, ref loc, ref time} assistance to a local XML file
//bool save_assistance_to_XML(); //bool save_assistance_to_XML();
void read_control_messages();
void process_control_messages();
/* /*
* Blocking function that reads the GPS assistance queue * Blocking function that reads the GPS assistance queue
*/ */
@ -153,7 +153,7 @@ private:
* Compute elevations for the specified time and position for all the available satellites in ephemeris and almanac queues * Compute elevations for the specified time and position for all the available satellites in ephemeris and almanac queues
* returns a vector filled with the available satellites ordered from high elevation to low elevation angle. * returns a vector filled with the available satellites ordered from high elevation to low elevation angle.
*/ */
std::vector<std::pair<int, Gnss_Satellite>> get_visible_sats(time_t rx_utc_time, const arma::vec& LLH); std::vector<std::pair<int, Gnss_Satellite>> get_visible_sats(time_t rx_utc_time, const arma::vec &LLH);
/* /*
* Read initial GNSS assistance from SUPL server or local XML files * Read initial GNSS assistance from SUPL server or local XML files
@ -163,9 +163,7 @@ private:
void apply_action(unsigned int what); void apply_action(unsigned int what);
std::shared_ptr<GNSSFlowgraph> flowgraph_; std::shared_ptr<GNSSFlowgraph> flowgraph_;
std::shared_ptr<ConfigurationInterface> configuration_; std::shared_ptr<ConfigurationInterface> configuration_;
gr::msg_queue::sptr control_queue_; std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue_;
std::shared_ptr<ControlMessageFactory> control_message_factory_;
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages_;
bool stop_; bool stop_;
bool restart_; bool restart_;
bool delete_configuration_; bool delete_configuration_;

View File

@ -182,7 +182,7 @@ GNSSBlockFactory::~GNSSBlockFactory() = default;
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetSignalSource( 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 default_implementation = "File_Signal_Source";
std::string role = "SignalSource"; //backwards compatibility for old conf files 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( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1C(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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 //"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 //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( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2S(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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: " LOG(INFO) << "Instantiating Channel " << channel << " with Acquisition Implementation: "
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm; << 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( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -520,7 +520,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1B(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -587,7 +587,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_5X(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -655,7 +655,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_1G(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -723,7 +723,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_2G(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -790,7 +790,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_L5(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -857,7 +857,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B1(
std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B3( std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B3(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel, 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; std::stringstream stream;
stream << channel; stream << channel;
@ -921,7 +921,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetChannel_B3(
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GNSSBlockFactory::GetChannels( 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 default_implementation = "Pass_Through";
std::string tracking_implementation; std::string tracking_implementation;
@ -1241,7 +1241,7 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role, const std::string& role,
const std::string& implementation, unsigned int in_streams, 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; std::unique_ptr<GNSSBlockInterface> block;

View File

@ -37,10 +37,11 @@
#ifndef GNSS_SDR_BLOCK_FACTORY_H_ #ifndef GNSS_SDR_BLOCK_FACTORY_H_
#define GNSS_SDR_BLOCK_FACTORY_H_ #define GNSS_SDR_BLOCK_FACTORY_H_
#include <gnuradio/msg_queue.h> // for msg_queue::sptr #include "concurrent_queue.h"
#include <memory> // for unique_ptr, shared_ptr #include <pmt/pmt.h>
#include <string> // for string #include <memory> // for unique_ptr, shared_ptr
#include <vector> // for vector #include <string> // for string
#include <vector> // for vector
class ConfigurationInterface; class ConfigurationInterface;
@ -59,12 +60,12 @@ public:
virtual ~GNSSBlockFactory(); virtual ~GNSSBlockFactory();
std::unique_ptr<GNSSBlockInterface> GetSignalSource(const std::shared_ptr<ConfigurationInterface>& configuration, 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<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, 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); 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, std::unique_ptr<GNSSBlockInterface> GetBlock(const std::shared_ptr<ConfigurationInterface>& configuration,
const std::string& role, const std::string& implementation, const std::string& role, const std::string& implementation,
unsigned int in_streams, unsigned int out_streams, 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: private:
std::unique_ptr<GNSSBlockInterface> GetChannel_1C(const std::shared_ptr<ConfigurationInterface>& configuration, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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( std::unique_ptr<AcquisitionInterface> GetAcqBlock(
const std::shared_ptr<ConfigurationInterface>& configuration, const std::shared_ptr<ConfigurationInterface>& configuration,

File diff suppressed because it is too large Load Diff

View File

@ -37,11 +37,12 @@
#ifndef GNSS_SDR_GNSS_FLOWGRAPH_H_ #ifndef GNSS_SDR_GNSS_FLOWGRAPH_H_
#define GNSS_SDR_GNSS_FLOWGRAPH_H_ #define GNSS_SDR_GNSS_FLOWGRAPH_H_
#include "channel_status_msg_receiver.h"
#include "concurrent_queue.h"
#include "gnss_sdr_sample_counter.h" #include "gnss_sdr_sample_counter.h"
#include "gnss_signal.h" #include "gnss_signal.h"
#include "pvt_interface.h" #include "pvt_interface.h"
#include <gnuradio/blocks/null_sink.h> //for null_sink #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 <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <pmt/pmt.h> // for pmt_t #include <pmt/pmt.h> // for pmt_t
#include <list> // for list #include <list> // for list
@ -71,7 +72,7 @@ public:
/*! /*!
* \brief Constructor that initializes the receiver flow graph * \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 * \brief Destructor
@ -99,6 +100,8 @@ public:
void perform_hw_reset(); void perform_hw_reset();
#endif #endif
void acquisition_manager(unsigned int who);
/*! /*!
* \brief Applies an action to the flow graph * \brief Applies an action to the flow graph
* *
@ -107,12 +110,11 @@ public:
*/ */
void apply_action(unsigned int who, unsigned int what); void apply_action(unsigned int who, unsigned int what);
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
unsigned int applied_actions() const void push_back_signal(Gnss_Signal gs);
{ void remove_signal(Gnss_Signal gs);
return applied_actions_;
} void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
bool connected() const bool connected() const
{ {
@ -149,7 +151,12 @@ private:
void set_signals_list(); void set_signals_list();
void set_channels_state(); // Initializes the channels state (start acquisition or keep standby) void set_channels_state(); // Initializes the channels state (start acquisition or keep standby)
// using the configuration parameters (number of channels and max channels in acquisition) // using the configuration parameters (number of channels and max channels in acquisition)
Gnss_Signal search_next_signal(const std::string& searched_signal, bool pop, bool tracked = false); Gnss_Signal search_next_signal(const std::string& searched_signal,
const bool pop,
bool& is_primary_frequency,
bool& assistance_available,
float& estimated_doppler,
double& RX_time);
bool connected_; bool connected_;
bool running_; bool running_;
int sources_count_; int sources_count_;
@ -157,7 +164,6 @@ private:
unsigned int channels_count_; unsigned int channels_count_;
unsigned int acq_channels_count_; unsigned int acq_channels_count_;
unsigned int max_acq_channels_; unsigned int max_acq_channels_;
unsigned int applied_actions_;
std::string config_file_; std::string config_file_;
std::shared_ptr<ConfigurationInterface> configuration_; std::shared_ptr<ConfigurationInterface> configuration_;
@ -175,7 +181,7 @@ private:
gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter; gnss_sdr_fpga_sample_counter_sptr ch_out_fpga_sample_counter;
#endif #endif
gr::top_block_sptr top_block_; 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_1C_signals_;
std::list<Gnss_Signal> available_GPS_2S_signals_; std::list<Gnss_Signal> available_GPS_2S_signals_;
@ -203,6 +209,7 @@ private:
std::map<std::string, StringValue> mapStringValues_; std::map<std::string, StringValue> mapStringValues_;
std::vector<unsigned int> channels_state_; std::vector<unsigned int> channels_state_;
channel_status_msg_receiver_sptr channels_status_; //class that receives and stores the current status of the receiver channels
std::mutex signal_list_mutex; std::mutex signal_list_mutex;
bool enable_monitor_; bool enable_monitor_;

View File

@ -30,7 +30,7 @@
*/ */
#include "tcp_cmd_interface.h" #include "tcp_cmd_interface.h"
#include "control_message_factory.h" #include "command_event.h"
#include "pvt_interface.h" #include "pvt_interface.h"
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <array> #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 TcpCmdInterface::reset(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) 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"; response = "OK\n";
} }
else else
{ {
response = "ERROR\n"; response = "ERROR\n";
} }
return response; 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 TcpCmdInterface::standby(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) 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"; response = "OK\n";
} }
else else
@ -203,10 +202,10 @@ std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLin
} }
else else
{ {
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) 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"; response = "OK\n";
} }
else else
@ -250,10 +249,10 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
} }
else else
{ {
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) 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"; response = "OK\n";
} }
else 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 TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) 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"; response = "OK\n";
} }
else else
{ {
response = "ERROR\n"; response = "ERROR\n";
} }
return response; 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); control_queue_ = std::move(control_queue);
} }

View File

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

View File

@ -869,7 +869,6 @@ endif()
if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA)
add_executable(control_thread_test add_executable(control_thread_test
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc ${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_message_factory_test.cc
${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc ${CMAKE_CURRENT_SOURCE_DIR}/unit-tests/control-plane/control_thread_test.cc
) )
if(${FILESYSTEM_FOUND}) if(${FILESYSTEM_FOUND})

Binary file not shown.

Binary file not shown.

View File

@ -60,7 +60,6 @@ DECLARE_string(log_dir);
#include "unit-tests/arithmetic/fft_speed_test.cc" #include "unit-tests/arithmetic/fft_speed_test.cc"
#include "unit-tests/arithmetic/magnitude_squared_test.cc" #include "unit-tests/arithmetic/magnitude_squared_test.cc"
#include "unit-tests/arithmetic/multiply_test.cc" #include "unit-tests/arithmetic/multiply_test.cc"
#include "unit-tests/control-plane/control_message_factory_test.cc"
#include "unit-tests/control-plane/control_thread_test.cc" #include "unit-tests/control-plane/control_thread_test.cc"
#include "unit-tests/control-plane/file_configuration_test.cc" #include "unit-tests/control-plane/file_configuration_test.cc"
#include "unit-tests/control-plane/gnss_block_factory_test.cc" #include "unit-tests/control-plane/gnss_block_factory_test.cc"

View File

@ -1,90 +0,0 @@
/*!
* \file control message_factory_test.cc
* \brief This file implements tests for the ControlMessageFactory.
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
* Carles Fernandez-Prades, 2012. cfernandez(at)cttc.es
*
*
* -------------------------------------------------------------------------
*
* 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 <gtest/gtest.h>
#include <string>
TEST(ControlMessageFactoryTest, GetQueueMessage)
{
std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
gr::message::sptr queue_message = factory->GetQueueMessage(0, 2);
auto control_messages = factory->GetControlMessages(queue_message);
unsigned int expected0 = 0;
unsigned int expected2 = 2;
EXPECT_EQ(expected0, control_messages->at(0)->who);
EXPECT_EQ(expected2, control_messages->at(0)->what);
EXPECT_EQ(sizeof(ControlMessage), queue_message->length());
}
TEST(ControlMessageFactoryTest, GetControlMessages)
{
std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
gr::message::sptr queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
std::shared_ptr<ControlMessage> control_message = std::make_shared<ControlMessage>();
control_message->who = 1;
control_message->what = 4;
memcpy(queue_message->msg(), control_message.get(), sizeof(ControlMessage));
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = factory->GetControlMessages(queue_message);
unsigned int expected1 = 1;
unsigned int expected4 = 4;
EXPECT_EQ(expected1, control_messages->size());
EXPECT_EQ(expected1, control_messages->at(0)->who);
EXPECT_EQ(expected4, control_messages->at(0)->what);
}
/*
TEST(ControlMessageFactoryTest, GetControlMessagesWrongSize)
{
std::shared_ptr<ControlMessageFactory> factory = std::make_shared<ControlMessageFactory>();
std::shared_ptr<ControlMessage> control_message = std::make_shared<ControlMessage>();
control_message->who = 1;
control_message->what = 4;
int another_int = 10;
gr::message::sptr queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage) + sizeof(int));
memcpy(queue_message->msg(), control_message.get(), sizeof(ControlMessage));
memcpy(queue_message->msg() + sizeof(ControlMessage), &another_int, sizeof(int));
std::shared_ptr<std::vector<std::shared_ptr<ControlMessage>>> control_messages = factory->GetControlMessages(queue_message);
unsigned int expected0 = 0;
EXPECT_EQ(expected0, control_messages->size());
} */

View File

@ -32,16 +32,17 @@
#include "control_thread.h" #include "control_thread.h"
#include "control_message_factory.h" #include "channel_event.h"
#include "command_event.h"
#include "concurrent_queue.h"
#include "in_memory_configuration.h" #include "in_memory_configuration.h"
#include <boost/exception/diagnostic_information.hpp> #include <boost/exception/diagnostic_information.hpp>
#include <boost/exception_ptr.hpp> #include <boost/exception_ptr.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <gnuradio/message.h>
#include <gnuradio/msg_queue.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <exception> #include <exception>
#include <memory> #include <memory>
@ -121,13 +122,10 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages /*unused*/)
std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
control_queue->push(pmt::make_any(channel_event_make(0, 0)));
std::unique_ptr<ControlMessageFactory> control_msg_factory(new ControlMessageFactory()); control_queue->push(pmt::make_any(channel_event_make(1, 0)));
control_queue->push(pmt::make_any(command_event_make(200, 0)));
control_queue->handle(control_msg_factory->GetQueueMessage(0, 0));
control_queue->handle(control_msg_factory->GetQueueMessage(1, 0));
control_queue->handle(control_msg_factory->GetQueueMessage(200, 0));
control_thread->set_control_queue(control_queue); control_thread->set_control_queue(control_queue);
try try
@ -181,16 +179,14 @@ TEST_F(ControlThreadTest /*unused*/, InstantiateRunControlMessages2 /*unused*/)
config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
std::unique_ptr<ControlThread> control_thread2(new ControlThread(config)); std::unique_ptr<ControlThread> control_thread2(new ControlThread(config));
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> control_queue2 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
gr::msg_queue::sptr control_queue2 = gr::msg_queue::make(0); control_queue2->push(pmt::make_any(channel_event_make(0, 0)));
control_queue2->push(pmt::make_any(channel_event_make(2, 0)));
control_queue2->push(pmt::make_any(channel_event_make(1, 0)));
control_queue2->push(pmt::make_any(channel_event_make(3, 0)));
control_queue2->push(pmt::make_any(command_event_make(200, 0)));
std::unique_ptr<ControlMessageFactory> control_msg_factory2(new ControlMessageFactory());
control_queue2->handle(control_msg_factory2->GetQueueMessage(0, 0));
control_queue2->handle(control_msg_factory2->GetQueueMessage(2, 0));
control_queue2->handle(control_msg_factory2->GetQueueMessage(1, 0));
control_queue2->handle(control_msg_factory2->GetQueueMessage(3, 0));
control_queue2->handle(control_msg_factory2->GetQueueMessage(200, 0));
control_thread2->set_control_queue(control_queue2); control_thread2->set_control_queue(control_queue2);
@ -245,7 +241,7 @@ TEST_F(ControlThreadTest /*unused*/, StopReceiverProgrammatically /*unused*/)
config->set_property("GNSS-SDR.internal_fs_sps", "4000000"); config->set_property("GNSS-SDR.internal_fs_sps", "4000000");
std::shared_ptr<ControlThread> control_thread = std::make_shared<ControlThread>(config); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
control_thread->set_control_queue(control_queue); control_thread->set_control_queue(control_queue);
std::thread stop_receiver_thread(stop_receiver); std::thread stop_receiver_thread(stop_receiver);

View File

@ -36,14 +36,15 @@
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "channel.h" #include "channel.h"
#include "concurrent_queue.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "in_memory_configuration.h" #include "in_memory_configuration.h"
#include "observables_interface.h" #include "observables_interface.h"
#include "pvt_interface.h" #include "pvt_interface.h"
#include "telemetry_decoder_interface.h" #include "telemetry_decoder_interface.h"
#include "tracking_interface.h" #include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <vector> #include <vector>
TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource) TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource)
@ -53,7 +54,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFileSignalSource)
std::string path = std::string(TEST_PATH); std::string path = std::string(TEST_PATH);
std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat"; std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
configuration->set_property("SignalSource.filename", filename); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
// Example of a factory as a shared_ptr // Example of a factory as a shared_ptr
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>(); std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
// Example of a block as a shared_ptr // Example of a block as a shared_ptr
@ -67,7 +68,7 @@ TEST(GNSSBlockFactoryTest, InstantiateWrongSignalSource)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
configuration->set_property("SignalSource.implementation", "Pepito"); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
// Example of a factory as a unique_ptr // Example of a factory as a unique_ptr
std::unique_ptr<GNSSBlockFactory> factory; std::unique_ptr<GNSSBlockFactory> factory;
// Example of a block as a unique_ptr // Example of a block as a unique_ptr
@ -90,7 +91,7 @@ TEST(GNSSBlockFactoryTest, InstantiateSignalConditioner)
TEST(GNSSBlockFactoryTest, InstantiateFIRFilter) TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
configuration->set_property("InputFilter.implementation", "Fir_Filter"); configuration->set_property("InputFilter.implementation", "Fir_Filter");
@ -123,7 +124,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFIRFilter)
TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter) TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter"); configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
@ -158,7 +159,7 @@ TEST(GNSSBlockFactoryTest, InstantiateFreqXlatingFIRFilter)
TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter) TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
configuration->set_property("InputFilter.implementation", "Pulse_Blanking_Filter"); configuration->set_property("InputFilter.implementation", "Pulse_Blanking_Filter");
std::unique_ptr<GNSSBlockFactory> factory; std::unique_ptr<GNSSBlockFactory> factory;
@ -171,7 +172,7 @@ TEST(GNSSBlockFactoryTest, InstantiatePulseBlankingFilter)
TEST(GNSSBlockFactoryTest, InstantiateNotchFilter) TEST(GNSSBlockFactoryTest, InstantiateNotchFilter)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
configuration->set_property("InputFilter.implementation", "Notch_Filter"); configuration->set_property("InputFilter.implementation", "Notch_Filter");
std::unique_ptr<GNSSBlockFactory> factory; std::unique_ptr<GNSSBlockFactory> factory;
@ -184,7 +185,7 @@ TEST(GNSSBlockFactoryTest, InstantiateNotchFilter)
TEST(GNSSBlockFactoryTest, InstantiateNotchFilterLite) TEST(GNSSBlockFactoryTest, InstantiateNotchFilterLite)
{ {
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>(); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
configuration->set_property("InputFilter.implementation", "Notch_Filter_Lite"); configuration->set_property("InputFilter.implementation", "Notch_Filter_Lite");
std::unique_ptr<GNSSBlockFactory> factory; std::unique_ptr<GNSSBlockFactory> factory;
@ -309,7 +310,7 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels)
configuration->set_property("Channel0.item_type", "gr_complex"); configuration->set_property("Channel0.item_type", "gr_complex");
configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition"); configuration->set_property("Acquisition_1C.implementation", "GPS_L1_CA_PCPS_Acquisition");
configuration->set_property("Channel1.item_type", "gr_complex"); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::unique_ptr<GNSSBlockFactory> factory; std::unique_ptr<GNSSBlockFactory> factory;
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration, queue); std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration, queue);
EXPECT_EQ(static_cast<unsigned int>(2), channels->size()); EXPECT_EQ(static_cast<unsigned int>(2), channels->size());

View File

@ -30,17 +30,17 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "gnss_flowgraph.h"
#include "acquisition_interface.h" #include "acquisition_interface.h"
#include "channel.h" #include "channel.h"
#include "channel_interface.h" #include "channel_interface.h"
#include "concurrent_queue.h"
#include "file_configuration.h" #include "file_configuration.h"
#include "file_signal_source.h" #include "file_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_flowgraph.h"
#include "in_memory_configuration.h" #include "in_memory_configuration.h"
#include "pass_through.h" #include "pass_through.h"
#include "tracking_interface.h" #include "tracking_interface.h"
#include <gnuradio/msg_queue.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
@ -68,7 +68,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopOldNotation /*unused*/
config->set_property("Observables.implementation", "Hybrid_Observables"); config->set_property("Observables.implementation", "Hybrid_Observables");
config->set_property("PVT.implementation", "RTKLIB_PVT"); config->set_property("PVT.implementation", "RTKLIB_PVT");
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0)); std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
EXPECT_NO_THROW(flowgraph->connect()); EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected()); EXPECT_TRUE(flowgraph->connected());
@ -103,7 +103,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStop /*unused*/)
config->set_property("Observables.implementation", "Hybrid_Observables"); config->set_property("Observables.implementation", "Hybrid_Observables");
config->set_property("PVT.implementation", "RTKLIB_PVT"); config->set_property("PVT.implementation", "RTKLIB_PVT");
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0)); std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
EXPECT_NO_THROW(flowgraph->connect()); EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected()); EXPECT_TRUE(flowgraph->connected());
@ -137,7 +137,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopGalileoE1B /*unused*/)
config->set_property("Observables.implementation", "Hybrid_Observables"); config->set_property("Observables.implementation", "Hybrid_Observables");
config->set_property("PVT.implementation", "RTKLIB_PVT"); config->set_property("PVT.implementation", "RTKLIB_PVT");
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0)); std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
EXPECT_NO_THROW(flowgraph->connect()); EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected()); EXPECT_TRUE(flowgraph->connected());
@ -253,7 +253,7 @@ TEST(GNSSFlowgraph /*unused*/, InstantiateConnectStartStopHybrid /*unused*/)
config->set_property("Observables.implementation", "Hybrid_Observables"); config->set_property("Observables.implementation", "Hybrid_Observables");
config->set_property("PVT.implementation", "RTKLIB_PVT"); config->set_property("PVT.implementation", "RTKLIB_PVT");
std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, gr::msg_queue::make(0)); std::shared_ptr<GNSSFlowgraph> flowgraph = std::make_shared<GNSSFlowgraph>(config, std::make_shared<Concurrent_Queue<pmt::pmt_t>>());
EXPECT_NO_THROW(flowgraph->connect()); EXPECT_NO_THROW(flowgraph->connect());
EXPECT_TRUE(flowgraph->connected()); EXPECT_TRUE(flowgraph->connected());

View File

@ -51,6 +51,7 @@
#include <gnuradio/blocks/interleaved_char_to_complex.h> #include <gnuradio/blocks/interleaved_char_to_complex.h>
#include <gnuradio/blocks/skiphead.h> #include <gnuradio/blocks/skiphead.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <thread> #include <thread>
#include <utility> #include <utility>
@ -342,7 +343,7 @@ protected:
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<AcquisitionInterface> acquisition; std::shared_ptr<AcquisitionInterface> acquisition;
std::shared_ptr<InMemoryConfiguration> config; std::shared_ptr<InMemoryConfiguration> config;
@ -598,7 +599,7 @@ int AcquisitionPerformanceTest::run_receiver()
boost::shared_ptr<AcqPerfTest_msg_rx> msg_rx = AcqPerfTest_msg_rx_make(channel_internal_queue); boost::shared_ptr<AcqPerfTest_msg_rx> msg_rx = AcqPerfTest_msg_rx_make(channel_internal_queue);
gr::blocks::skiphead::sptr skiphead = gr::blocks::skiphead::make(sizeof(gr_complex), FLAGS_acq_test_skiphead); gr::blocks::skiphead::sptr skiphead = gr::blocks::skiphead::make(sizeof(gr_complex), FLAGS_acq_test_skiphead);
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
gnss_synchro = Gnss_Synchro(); gnss_synchro = Gnss_Synchro();
init(); init();

View File

@ -31,9 +31,10 @@
*/ */
#include "beidou_b1i_pcps_acquisition.h"
#include "Beidou_B1I.h" #include "Beidou_B1I.h"
#include "acquisition_dump_reader.h" #include "acquisition_dump_reader.h"
#include "beidou_b1i_pcps_acquisition.h" #include "concurrent_queue.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -46,9 +47,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
@ -198,7 +199,7 @@ void BeidouB1iPcpsAcquisitionTest::plot_grid()
std::vector<int> *doppler = &acq_dump.doppler; std::vector<int> *doppler = &acq_dump.doppler;
std::vector<unsigned int> *samples = &acq_dump.samples; std::vector<unsigned int> *samples = &acq_dump.samples;
std::vector<std::vector<float> > *mag = &acq_dump.mag; std::vector<std::vector<float>> *mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable); const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if (gnuplot_executable.empty()) if (gnuplot_executable.empty())
@ -261,7 +262,7 @@ TEST_F(BeidouB1iPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 25000; int nsamples = 25000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
init(); init();

View File

@ -31,9 +31,10 @@
*/ */
#include "beidou_b3i_pcps_acquisition.h"
#include "Beidou_B3I.h" #include "Beidou_B3I.h"
#include "acquisition_dump_reader.h" #include "acquisition_dump_reader.h"
#include "beidou_b3i_pcps_acquisition.h" #include "concurrent_queue.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -46,9 +47,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
@ -197,7 +198,7 @@ void BeidouB3iPcpsAcquisitionTest::plot_grid()
std::vector<int> *doppler = &acq_dump.doppler; std::vector<int> *doppler = &acq_dump.doppler;
std::vector<unsigned int> *samples = &acq_dump.samples; std::vector<unsigned int> *samples = &acq_dump.samples;
std::vector<std::vector<float> > *mag = &acq_dump.mag; std::vector<std::vector<float>> *mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable); const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if (gnuplot_executable.empty()) if (gnuplot_executable.empty())
@ -260,7 +261,7 @@ TEST_F(BeidouB3iPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 50000; int nsamples = 50000;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
init(); init();

View File

@ -30,8 +30,9 @@
*/ */
#include "fir_filter.h"
#include "galileo_e1_pcps_8ms_ambiguous_acquisition.h" #include "galileo_e1_pcps_8ms_ambiguous_acquisition.h"
#include "concurrent_queue.h"
#include "fir_filter.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -43,8 +44,8 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include <utility> #include <utility>
@ -134,7 +135,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisition> acquisition; std::shared_ptr<GalileoE1Pcps8msAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
@ -433,7 +434,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
std::chrono::duration<double> elapsed_seconds(0.0); std::chrono::duration<double> elapsed_seconds(0.0);
config_1(); config_1();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0);
@ -483,7 +484,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults) TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
{ {
config_1(); config_1();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0, queue); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0, queue);
@ -572,7 +573,7 @@ TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities) TEST_F(GalileoE1Pcps8msAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabilities)
{ {
config_2(); config_2();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_8ms_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1Pcps8msAmbiguousAcquisition>(acq_);

View File

@ -31,8 +31,9 @@
*/ */
#include "fir_filter.h"
#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e1_pcps_ambiguous_acquisition.h"
#include "concurrent_queue.h"
#include "fir_filter.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -43,7 +44,6 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
@ -134,7 +134,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition; std::shared_ptr<GalileoE1PcpsAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
@ -435,7 +435,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
config_1(); config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0);
@ -466,7 +466,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
{ {
config_1(); config_1();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -551,7 +551,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsProbabi
{ {
config_2(); config_2();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);

View File

@ -42,6 +42,7 @@
#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "galileo_e1_pcps_ambiguous_acquisition.h"
#include "concurrent_queue.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -52,8 +53,8 @@
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/blocks/skiphead.h> #include <gnuradio/blocks/skiphead.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
@ -140,7 +141,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
std::shared_ptr<InMemoryConfiguration> config; std::shared_ptr<InMemoryConfiguration> config;
@ -217,7 +218,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ConnectAndRun)
int nsamples = 4 * fs_in; int nsamples = 4 * fs_in;
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
init(); init();
@ -248,7 +249,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionGSoCTest, ValidationOfResults)
{ {
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
init(); init();

View File

@ -31,9 +31,10 @@
*/ */
#include "galileo_e1_pcps_ambiguous_acquisition.h"
#include "Galileo_E1.h" #include "Galileo_E1.h"
#include "acquisition_dump_reader.h" #include "acquisition_dump_reader.h"
#include "galileo_e1_pcps_ambiguous_acquisition.h" #include "concurrent_queue.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -47,9 +48,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
@ -200,7 +201,7 @@ void GalileoE1PcpsAmbiguousAcquisitionTest::plot_grid()
std::vector<int>* doppler = &acq_dump.doppler; std::vector<int>* doppler = &acq_dump.doppler;
std::vector<unsigned int>* samples = &acq_dump.samples; std::vector<unsigned int>* samples = &acq_dump.samples;
std::vector<std::vector<float> >* mag = &acq_dump.mag; std::vector<std::vector<float>>* mag = &acq_dump.mag;
const std::string gnuplot_executable(FLAGS_gnuplot_executable); const std::string gnuplot_executable(FLAGS_gnuplot_executable);
if (gnuplot_executable.empty()) if (gnuplot_executable.empty())
@ -265,7 +266,7 @@ TEST_F(GalileoE1PcpsAmbiguousAcquisitionTest, ConnectAndRun)
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Acquisition test"); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
init(); init();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 0); 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_); std::shared_ptr<AcquisitionInterface> acquisition = std::dynamic_pointer_cast<AcquisitionInterface>(acq_);

View File

@ -31,8 +31,9 @@
*/ */
#include "fir_filter.h"
#include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h" #include "galileo_e1_pcps_cccwsr_ambiguous_acquisition.h"
#include "concurrent_queue.h"
#include "fir_filter.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -44,8 +45,8 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include <utility> #include <utility>
@ -135,7 +136,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisition> acquisition; std::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
@ -438,7 +439,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ConnectAndRun)
config_1(); config_1();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
@ -468,7 +469,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResults)
{ {
config_1(); config_1();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue);
@ -561,7 +562,7 @@ TEST_F(GalileoE1PcpsCccwsrAmbiguousAcquisitionTest, ValidationOfResultsProbabili
{ {
config_2(); config_2();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsCccwsrAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx> msg_rx = GalileoE1PcpsCccwsrAmbiguousAcquisitionTest_msg_rx_make(channel_internal_queue);

View File

@ -31,8 +31,8 @@
*/ */
#include "fir_filter.h"
#include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h" #include "galileo_e1_pcps_quicksync_ambiguous_acquisition.h"
#include "fir_filter.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -46,6 +46,7 @@
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <fstream> #include <fstream>
#include <stdexcept> #include <stdexcept>
@ -142,7 +143,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisition> acquisition; std::shared_ptr<GalileoE1PcpsQuickSyncAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
@ -560,7 +561,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ConnectAndRun)
std::chrono::time_point<std::chrono::system_clock> begin, end; std::chrono::time_point<std::chrono::system_clock> begin, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
config_1(); config_1();
@ -597,7 +598,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
LOG(INFO) << "Start validation of results test"; LOG(INFO) << "Start validation of results test";
config_1(); config_1();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
@ -688,7 +689,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
LOG(INFO) << "Start validation of results with noise+interference test"; LOG(INFO) << "Start validation of results with noise+interference test";
config_3(); config_3();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);
@ -776,7 +777,7 @@ TEST_F(GalileoE1PcpsQuickSyncAmbiguousAcquisitionGSoC2014Test, ValidationOfResul
{ {
config_2(); config_2();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_QuickSync_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsQuickSyncAmbiguousAcquisition>(acq_);

View File

@ -30,9 +30,10 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
#include "concurrent_queue.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "fir_filter.h" #include "fir_filter.h"
#include "galileo_e1_pcps_tong_ambiguous_acquisition.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -44,9 +45,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include <utility> #include <utility>
@ -135,7 +136,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisition> acquisition; std::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisition> acquisition;
std::shared_ptr<GNSSBlockFactory> factory; std::shared_ptr<GNSSBlockFactory> factory;
@ -438,7 +439,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ConnectAndRun)
std::chrono::time_point<std::chrono::system_clock> start, end; std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0.0); std::chrono::duration<double> elapsed_seconds(0.0);
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
config_1(); config_1();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
@ -466,7 +467,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResults)
{ {
config_1(); config_1();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);
@ -555,7 +556,7 @@ TEST_F(GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test, ValidationOfResultsPro
{ {
config_2(); config_2();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0); std::shared_ptr<GNSSBlockInterface> acq_ = factory->GetBlock(config, "Acquisition_1B", "Galileo_E1_PCPS_Tong_Ambiguous_Acquisition", 1, 0);
acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_); acquisition = std::dynamic_pointer_cast<GalileoE1PcpsTongAmbiguousAcquisition>(acq_);
boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx> msg_rx = GalileoE1PcpsTongAmbiguousAcquisitionGSoC2013Test_msg_rx_make(channel_internal_queue);

View File

@ -29,6 +29,7 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "concurrent_queue.h"
#include "fir_filter.h" #include "fir_filter.h"
#include "galileo_e5a_noncoherent_iq_acquisition_caf.h" #include "galileo_e5a_noncoherent_iq_acquisition_caf.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
@ -42,8 +43,8 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <utility> #include <utility>
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
@ -131,7 +132,7 @@ protected:
void stop_queue(); void stop_queue();
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
std::shared_ptr<GalileoE5aNoncoherentIQAcquisitionCaf> acquisition; std::shared_ptr<GalileoE5aNoncoherentIQAcquisitionCaf> acquisition;
@ -540,7 +541,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition_5X", 1, 0); acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition_5X", 1, 0);
boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue);
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
ASSERT_NO_THROW({ ASSERT_NO_THROW({
@ -566,7 +567,7 @@ TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ConnectAndRun)
TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM) TEST_F(GalileoE5aPcpsAcquisitionGSoC2014GensourceTest, ValidationOfSIM)
{ {
config_1(); config_1();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition_5X", 1, 0); acquisition = std::make_shared<GalileoE5aNoncoherentIQAcquisitionCaf>(config.get(), "Acquisition_5X", 1, 0);
boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue); boost::shared_ptr<GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx> msg_rx = GalileoE5aPcpsAcquisitionGSoC2014GensourceTest_msg_rx_make(channel_internal_queue);

View File

@ -31,10 +31,11 @@
*/ */
#include "glonass_l1_ca_pcps_acquisition.h"
#include "concurrent_queue.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "freq_xlating_fir_filter.h" #include "freq_xlating_fir_filter.h"
#include "gen_signal_source.h" #include "gen_signal_source.h"
#include "glonass_l1_ca_pcps_acquisition.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
#include "gnss_synchro.h" #include "gnss_synchro.h"
@ -46,9 +47,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <thread> #include <thread>
#include <utility> #include <utility>
@ -140,7 +141,7 @@ protected:
Concurrent_Queue<int> channel_internal_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; gr::top_block_sptr top_block;
GlonassL1CaPcpsAcquisition* acquisition; GlonassL1CaPcpsAcquisition* acquisition;
std::shared_ptr<InMemoryConfiguration> config; std::shared_ptr<InMemoryConfiguration> config;
@ -442,7 +443,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun)
int nsamples = floor(fs_in * integration_time_ms * 1e-3); int nsamples = floor(fs_in * integration_time_ms * 1e-3);
std::chrono::time_point<std::chrono::system_clock> begin, end; std::chrono::time_point<std::chrono::system_clock> begin, end;
std::chrono::duration<double> elapsed_seconds(0); std::chrono::duration<double> elapsed_seconds(0);
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
config_1(); config_1();
@ -474,7 +475,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ConnectAndRun)
TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults) TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults)
{ {
config_1(); config_1();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0);
@ -563,7 +564,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResults)
TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities) TEST_F(GlonassL1CaPcpsAcquisitionGSoC2017Test, ValidationOfResultsProbabilities)
{ {
config_2(); config_2();
queue = gr::msg_queue::make(0); queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0); acquisition = new GlonassL1CaPcpsAcquisition(config.get(), "Acquisition", 1, 0);
boost::shared_ptr<GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx> msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue); boost::shared_ptr<GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx> msg_rx = GlonassL1CaPcpsAcquisitionGSoC2017Test_msg_rx_make(channel_internal_queue);

View File

@ -30,8 +30,9 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "freq_xlating_fir_filter.h"
#include "glonass_l1_ca_pcps_acquisition.h" #include "glonass_l1_ca_pcps_acquisition.h"
#include "concurrent_queue.h"
#include "freq_xlating_fir_filter.h"
#include "gnss_block_factory.h" #include "gnss_block_factory.h"
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#include "gnss_sdr_valve.h" #include "gnss_sdr_valve.h"
@ -41,9 +42,9 @@
#include <gnuradio/analog/sig_source_waveform.h> #include <gnuradio/analog/sig_source_waveform.h>
#include <gnuradio/blocks/file_source.h> #include <gnuradio/blocks/file_source.h>
#include <gnuradio/blocks/null_sink.h> #include <gnuradio/blocks/null_sink.h>
#include <gnuradio/msg_queue.h>
#include <gnuradio/top_block.h> #include <gnuradio/top_block.h>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <pmt/pmt.h>
#include <chrono> #include <chrono>
#include <cstdlib> #include <cstdlib>
#include <utility> #include <utility>
@ -184,7 +185,7 @@ TEST_F(GlonassL1CaPcpsAcquisitionTest, ConnectAndRun)
int nsamples = 62314; int nsamples = 62314;
std::chrono::time_point<std::chrono::system_clock> begin, end; std::chrono::time_point<std::chrono::system_clock> begin, end;
std::chrono::duration<double> elapsed_seconds(0); 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 = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
top_block = gr::make_top_block("Acquisition test"); top_block = gr::make_top_block("Acquisition test");
init(); init();

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