mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-12-04 07:38:08 +00:00
Switch to GNU Radio 3.7.x API
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@368 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -24,9 +24,10 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs
|
||||
${GNURADIO_CORE_INCLUDE_DIRS}
|
||||
${GNURADIO_GRUEL_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(channel_adapters ${CHANNEL_ADAPTER_SOURCES})
|
||||
target_link_libraries(channel_adapters channel_fsm)
|
||||
target_link_libraries(channel_adapters channel_fsm ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include <sstream>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <gnuradio/gr_io_signature.h>
|
||||
#include <gnuradio/gr_message.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <gnuradio/message.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
@@ -50,7 +50,7 @@ using google::LogMessage;
|
||||
Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
GNSSBlockInterface *pass_through, AcquisitionInterface *acq,
|
||||
TrackingInterface *trk, TelemetryDecoderInterface *nav,
|
||||
std::string role, std::string implementation, gr_msg_queue_sptr queue) :
|
||||
std::string role, std::string implementation, boost::shared_ptr<gr::msg_queue> queue) :
|
||||
pass_through_(pass_through), acq_(acq), trk_(trk), nav_(nav),
|
||||
role_(role), implementation_(implementation), channel_(channel),
|
||||
queue_(queue)
|
||||
@@ -84,10 +84,11 @@ Channel::Channel(ConfigurationInterface *configuration, unsigned int channel,
|
||||
|
||||
float threshold = configuration->property("Acquisition" + boost::lexical_cast<std::string>(channel_)
|
||||
+ ".threshold",0.0);
|
||||
if(threshold==0.0) threshold = configuration->property("Acquisition.threshold",0.0);
|
||||
if(threshold==0.0) threshold = configuration->property("Acquisition.threshold",0);
|
||||
|
||||
acq_->set_threshold(threshold);
|
||||
|
||||
|
||||
repeat_ = configuration->property("Acquisition" + boost::lexical_cast<
|
||||
std::string>(channel_) + ".repeat_satellite", false);
|
||||
|
||||
@@ -119,7 +120,7 @@ Channel::~Channel()
|
||||
|
||||
|
||||
|
||||
void Channel::connect(gr_top_block_sptr top_block)
|
||||
void Channel::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (connected_)
|
||||
{
|
||||
@@ -142,7 +143,7 @@ void Channel::connect(gr_top_block_sptr top_block)
|
||||
|
||||
|
||||
|
||||
void Channel::disconnect(gr_top_block_sptr top_block)
|
||||
void Channel::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (!connected_)
|
||||
{
|
||||
@@ -161,14 +162,14 @@ void Channel::disconnect(gr_top_block_sptr top_block)
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr Channel::get_left_block()
|
||||
gr::basic_block_sptr Channel::get_left_block()
|
||||
{
|
||||
return pass_through_->get_left_block();
|
||||
}
|
||||
|
||||
|
||||
|
||||
gr_basic_block_sptr Channel::get_right_block()
|
||||
gr::basic_block_sptr Channel::get_right_block()
|
||||
{
|
||||
return nav_->get_right_block();
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
#ifndef GNSS_SDR_CHANNEL_H_
|
||||
#define GNSS_SDR_CHANNEL_H_
|
||||
|
||||
#include <gnuradio/gr_null_sink.h>
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
//#include <gnuradio/blocks/null_sink.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include "channel_interface.h"
|
||||
#include "gps_l1_ca_channel_fsm.h"
|
||||
#include "control_message_factory.h"
|
||||
@@ -62,13 +62,13 @@ public:
|
||||
GNSSBlockInterface *pass_through, AcquisitionInterface *acq,
|
||||
TrackingInterface *trk, TelemetryDecoderInterface *nav,
|
||||
std::string role, std::string implementation,
|
||||
gr_msg_queue_sptr queue);
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
//! Virtual destructor
|
||||
virtual ~Channel();
|
||||
void connect(gr_top_block_sptr top_block);
|
||||
void disconnect(gr_top_block_sptr top_block);
|
||||
gr_basic_block_sptr get_left_block();
|
||||
gr_basic_block_sptr get_right_block();
|
||||
void connect(gr::top_block_sptr top_block);
|
||||
void disconnect(gr::top_block_sptr top_block);
|
||||
gr::basic_block_sptr get_left_block();
|
||||
gr::basic_block_sptr get_right_block();
|
||||
std::string role(){ return role_; }
|
||||
|
||||
//! Returns "Channel"
|
||||
@@ -103,7 +103,7 @@ private:
|
||||
int message_;
|
||||
bool repeat_;
|
||||
GpsL1CaChannelFsm channel_fsm_;
|
||||
gr_msg_queue_sptr queue_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
concurrent_queue<int> channel_internal_queue_;
|
||||
boost::thread ch_thread_;
|
||||
void run();
|
||||
|
||||
@@ -24,8 +24,9 @@ include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters
|
||||
${GNURADIO_CORE_INCLUDE_DIRS}
|
||||
${GNURADIO_GRUEL_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
add_library(channel_fsm ${CHANNEL_FSM_SOURCES})
|
||||
add_library(channel_fsm ${CHANNEL_FSM_SOURCES})
|
||||
|
||||
@@ -156,7 +156,7 @@ void GpsL1CaChannelFsm::set_tracking(TrackingInterface *tracking) {
|
||||
trk_ = tracking;
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::set_queue(gr_msg_queue_sptr queue) {
|
||||
void GpsL1CaChannelFsm::set_queue(boost::shared_ptr<gr::msg_queue> queue) {
|
||||
queue_ = queue;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ void GpsL1CaChannelFsm::start_tracking() {
|
||||
//trk_->set_acq_sample_stamp(acq_->get_sample_stamp());
|
||||
trk_->start_tracking();
|
||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||
if (queue_ != gr_msg_queue_sptr()) {
|
||||
if (queue_ != gr::msg_queue::make()) {
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 1));
|
||||
}
|
||||
delete cmf;
|
||||
@@ -189,7 +189,7 @@ void GpsL1CaChannelFsm::start_tracking() {
|
||||
|
||||
void GpsL1CaChannelFsm::request_satellite() {
|
||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||
if (queue_ != gr_msg_queue_sptr()) {
|
||||
if (queue_ != gr::msg_queue::make()) {
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 0));
|
||||
}
|
||||
delete cmf;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "acquisition_interface.h"
|
||||
#include "tracking_interface.h"
|
||||
#include "telemetry_decoder_interface.h"
|
||||
#include <gnuradio/gr_msg_queue.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
void set_acquisition(AcquisitionInterface *acquisition);
|
||||
void set_tracking(TrackingInterface *tracking);
|
||||
void set_queue(gr_msg_queue_sptr queue);
|
||||
void set_queue(boost::shared_ptr<gr::msg_queue> queue);
|
||||
void set_channel(unsigned int channel);
|
||||
void start_acquisition();
|
||||
void start_tracking();
|
||||
@@ -87,7 +87,7 @@ private:
|
||||
AcquisitionInterface *acq_;
|
||||
TrackingInterface *trk_;
|
||||
TelemetryDecoderInterface *nav_;
|
||||
gr_msg_queue_sptr queue_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
unsigned int channel_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user