mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-04-09 12:16:46 +00:00
changing some raw pointers by smart pointers in the core receiver.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@502 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
1b8204bdb3
commit
4e714bf033
@ -30,171 +30,188 @@
|
||||
|
||||
#include "gps_l1_ca_channel_fsm.h"
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <glog/logging.h>
|
||||
#include "control_message_factory.h"
|
||||
#include "channel.h"
|
||||
|
||||
|
||||
struct Ev_gps_channel_start_acquisition: sc::event<
|
||||
Ev_gps_channel_start_acquisition> {
|
||||
};
|
||||
struct Ev_gps_channel_start_acquisition: sc::event<Ev_gps_channel_start_acquisition>
|
||||
{};
|
||||
|
||||
struct Ev_gps_channel_valid_acquisition: sc::event<
|
||||
Ev_gps_channel_valid_acquisition> {
|
||||
};
|
||||
struct Ev_gps_channel_valid_acquisition: sc::event<Ev_gps_channel_valid_acquisition>
|
||||
{};
|
||||
|
||||
struct Ev_gps_channel_failed_acquisition_repeat: sc::event<
|
||||
Ev_gps_channel_failed_acquisition_repeat> {
|
||||
};
|
||||
struct Ev_gps_channel_failed_acquisition_repeat: sc::event<Ev_gps_channel_failed_acquisition_repeat>
|
||||
{};
|
||||
|
||||
struct Ev_gps_channel_failed_acquisition_no_repeat: sc::event<
|
||||
Ev_gps_channel_failed_acquisition_no_repeat> {
|
||||
};
|
||||
struct Ev_gps_channel_failed_acquisition_no_repeat: sc::event<Ev_gps_channel_failed_acquisition_no_repeat>
|
||||
{};
|
||||
|
||||
struct Ev_gps_channel_failed_tracking_standby: sc::event<Ev_gps_channel_failed_tracking_standby> {
|
||||
};
|
||||
struct Ev_gps_channel_failed_tracking_standby: sc::event<Ev_gps_channel_failed_tracking_standby>
|
||||
{};
|
||||
|
||||
//struct Ev_gps_channel_failed_tracking_reacq: sc::event<Ev_gps_channel_failed_tracking_reacq> {
|
||||
//};
|
||||
//struct Ev_gps_channel_failed_tracking_reacq: sc::event<Ev_gps_channel_failed_tracking_reacq>
|
||||
//{};
|
||||
|
||||
struct gps_channel_idle_fsm_S0: public sc::state<gps_channel_idle_fsm_S0,
|
||||
GpsL1CaChannelFsm> {
|
||||
struct gps_channel_idle_fsm_S0: public sc::state<gps_channel_idle_fsm_S0, GpsL1CaChannelFsm>
|
||||
{
|
||||
public:
|
||||
// sc::transition(event, next state)
|
||||
typedef sc::transition<Ev_gps_channel_start_acquisition,
|
||||
gps_channel_acquiring_fsm_S1> reactions;
|
||||
gps_channel_idle_fsm_S0(my_context ctx) :
|
||||
my_base(ctx) {
|
||||
//std::cout << "Enter Channel_Idle_S0 " << std::endl;
|
||||
}
|
||||
// sc::transition(event, next state)
|
||||
typedef sc::transition<Ev_gps_channel_start_acquisition, gps_channel_acquiring_fsm_S1> reactions;
|
||||
gps_channel_idle_fsm_S0(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_Idle_S0 " << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
struct gps_channel_acquiring_fsm_S1: public sc::state<
|
||||
gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm> {
|
||||
|
||||
struct gps_channel_acquiring_fsm_S1: public sc::state<gps_channel_acquiring_fsm_S1, GpsL1CaChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef mpl::list<sc::transition<
|
||||
Ev_gps_channel_failed_acquisition_no_repeat,
|
||||
gps_channel_waiting_fsm_S3>, sc::transition<
|
||||
Ev_gps_channel_failed_acquisition_repeat,
|
||||
gps_channel_acquiring_fsm_S1>, sc::transition<
|
||||
Ev_gps_channel_valid_acquisition, gps_channel_tracking_fsm_S2> >
|
||||
reactions;
|
||||
typedef mpl::list<sc::transition<Ev_gps_channel_failed_acquisition_no_repeat, gps_channel_waiting_fsm_S3>,
|
||||
sc::transition<Ev_gps_channel_failed_acquisition_repeat, gps_channel_acquiring_fsm_S1>,
|
||||
sc::transition<Ev_gps_channel_valid_acquisition, gps_channel_tracking_fsm_S2> > reactions;
|
||||
|
||||
gps_channel_acquiring_fsm_S1(my_context ctx) :
|
||||
my_base(ctx) {
|
||||
//std::cout << "Enter Channel_Acq_S1 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().start_acquisition();
|
||||
}
|
||||
gps_channel_acquiring_fsm_S1(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_Acq_S1 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().start_acquisition();
|
||||
}
|
||||
};
|
||||
|
||||
struct gps_channel_tracking_fsm_S2: public sc::state<
|
||||
gps_channel_tracking_fsm_S2, GpsL1CaChannelFsm> {
|
||||
|
||||
struct gps_channel_tracking_fsm_S2: public sc::state<gps_channel_tracking_fsm_S2, GpsL1CaChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef mpl::list<sc::transition<Ev_gps_channel_failed_tracking_standby,
|
||||
gps_channel_idle_fsm_S0>, sc::transition<Ev_gps_channel_start_acquisition,
|
||||
gps_channel_acquiring_fsm_S1>> reactions;
|
||||
typedef mpl::list<sc::transition<Ev_gps_channel_failed_tracking_standby, gps_channel_idle_fsm_S0>,
|
||||
sc::transition<Ev_gps_channel_start_acquisition, gps_channel_acquiring_fsm_S1>> reactions;
|
||||
|
||||
gps_channel_tracking_fsm_S2(my_context ctx) :
|
||||
my_base(ctx) {
|
||||
//std::cout << "Enter Channel_tracking_S2 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().start_tracking();
|
||||
}
|
||||
gps_channel_tracking_fsm_S2(my_context ctx) : my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_tracking_S2 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().start_tracking();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct gps_channel_waiting_fsm_S3: public sc::state<gps_channel_waiting_fsm_S3,
|
||||
GpsL1CaChannelFsm> {
|
||||
|
||||
struct gps_channel_waiting_fsm_S3: public sc::state<gps_channel_waiting_fsm_S3, GpsL1CaChannelFsm>
|
||||
{
|
||||
public:
|
||||
typedef sc::transition<Ev_gps_channel_start_acquisition,
|
||||
gps_channel_acquiring_fsm_S1> reactions;
|
||||
typedef sc::transition<Ev_gps_channel_start_acquisition,
|
||||
gps_channel_acquiring_fsm_S1> reactions;
|
||||
|
||||
gps_channel_waiting_fsm_S3(my_context ctx) :
|
||||
my_base(ctx) {
|
||||
//std::cout << "Enter Channel_waiting_S3 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().request_satellite();
|
||||
}
|
||||
~gps_channel_waiting_fsm_S3(){}
|
||||
gps_channel_waiting_fsm_S3(my_context ctx) :
|
||||
my_base(ctx)
|
||||
{
|
||||
//std::cout << "Enter Channel_waiting_S3 " << std::endl;
|
||||
context<GpsL1CaChannelFsm> ().request_satellite();
|
||||
}
|
||||
~gps_channel_waiting_fsm_S3(){}
|
||||
};
|
||||
|
||||
GpsL1CaChannelFsm::GpsL1CaChannelFsm() {
|
||||
initiate(); //start the FSM
|
||||
|
||||
|
||||
GpsL1CaChannelFsm::GpsL1CaChannelFsm()
|
||||
{
|
||||
initiate(); //start the FSM
|
||||
}
|
||||
|
||||
|
||||
|
||||
GpsL1CaChannelFsm::GpsL1CaChannelFsm(AcquisitionInterface *acquisition) :
|
||||
acq_(acquisition) {
|
||||
initiate(); //start the FSM
|
||||
acq_(acquisition)
|
||||
{
|
||||
initiate(); //start the FSM
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_start_acquisition() {
|
||||
this->process_event(Ev_gps_channel_start_acquisition());
|
||||
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_start_acquisition()
|
||||
{
|
||||
this->process_event(Ev_gps_channel_start_acquisition());
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_valid_acquisition() {
|
||||
this->process_event(Ev_gps_channel_valid_acquisition());
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_valid_acquisition()
|
||||
{
|
||||
this->process_event(Ev_gps_channel_valid_acquisition());
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_acquisition_repeat() {
|
||||
this->process_event(Ev_gps_channel_failed_acquisition_repeat());
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_acquisition_repeat()
|
||||
{
|
||||
this->process_event(Ev_gps_channel_failed_acquisition_repeat());
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_acquisition_no_repeat() {
|
||||
this->process_event(Ev_gps_channel_failed_acquisition_no_repeat());
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_acquisition_no_repeat()
|
||||
{
|
||||
this->process_event(Ev_gps_channel_failed_acquisition_no_repeat());
|
||||
}
|
||||
|
||||
|
||||
// Something is wrong here, we are using a memory after it ts freed
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_tracking_standby() {
|
||||
this->process_event(Ev_gps_channel_failed_tracking_standby());
|
||||
void GpsL1CaChannelFsm::Event_gps_failed_tracking_standby()
|
||||
{
|
||||
this->process_event(Ev_gps_channel_failed_tracking_standby());
|
||||
}
|
||||
|
||||
//void GpsL1CaChannelFsm::Event_gps_failed_tracking_reacq() {
|
||||
// this->process_event(Ev_gps_channel_failed_tracking_reacq());
|
||||
//}
|
||||
|
||||
void GpsL1CaChannelFsm::set_acquisition(AcquisitionInterface *acquisition) {
|
||||
acq_ = acquisition;
|
||||
void GpsL1CaChannelFsm::set_acquisition(AcquisitionInterface *acquisition)
|
||||
{
|
||||
acq_ = acquisition;
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::set_tracking(TrackingInterface *tracking) {
|
||||
trk_ = tracking;
|
||||
void GpsL1CaChannelFsm::set_tracking(TrackingInterface *tracking)
|
||||
{
|
||||
trk_ = tracking;
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::set_queue(boost::shared_ptr<gr::msg_queue> queue) {
|
||||
queue_ = queue;
|
||||
void GpsL1CaChannelFsm::set_queue(boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
queue_ = queue;
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::set_channel(unsigned int channel) {
|
||||
channel_ = channel;
|
||||
void GpsL1CaChannelFsm::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::start_acquisition() {
|
||||
acq_->reset();
|
||||
void GpsL1CaChannelFsm::start_acquisition()
|
||||
{
|
||||
acq_->reset();
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::start_tracking() {
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing prn code phase " << acq_->prn_code_phase();
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing doppler freq shift " << acq_->doppler_freq_shift();
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing acquisition sample stamp "
|
||||
//<< acq_->get_sample_stamp();
|
||||
//trk_->set_prn_code_phase(acq_->prn_code_phase());
|
||||
//trk_->set_doppler_freq_shift(acq_->doppler_freq_shift());
|
||||
//trk_->set_acq_sample_stamp(acq_->get_sample_stamp());
|
||||
trk_->start_tracking();
|
||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||
if (queue_ != gr::msg_queue::make()) {
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 1));
|
||||
}
|
||||
delete cmf;
|
||||
void GpsL1CaChannelFsm::start_tracking()
|
||||
{
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing prn code phase " << acq_->prn_code_phase();
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing doppler freq shift " << acq_->doppler_freq_shift();
|
||||
//LOG_AT_LEVEL(INFO) << "Channel " << channel_
|
||||
//<< " passing acquisition sample stamp "
|
||||
//<< acq_->get_sample_stamp();
|
||||
//trk_->set_prn_code_phase(acq_->prn_code_phase());
|
||||
//trk_->set_doppler_freq_shift(acq_->doppler_freq_shift());
|
||||
//trk_->set_acq_sample_stamp(acq_->get_sample_stamp());
|
||||
trk_->start_tracking();
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (queue_ != gr::msg_queue::make())
|
||||
{
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 1));
|
||||
}
|
||||
}
|
||||
|
||||
void GpsL1CaChannelFsm::request_satellite() {
|
||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||
if (queue_ != gr::msg_queue::make()) {
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 0));
|
||||
}
|
||||
delete cmf;
|
||||
void GpsL1CaChannelFsm::request_satellite()
|
||||
{
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (queue_ != gr::msg_queue::make())
|
||||
{
|
||||
queue_->handle(cmf->GetQueueMessage(channel_, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,6 @@
|
||||
#include "telemetry_decoder_interface.h"
|
||||
|
||||
|
||||
|
||||
|
||||
namespace sc = boost::statechart;
|
||||
namespace mpl = boost::mpl;
|
||||
|
||||
@ -62,11 +60,9 @@ struct gps_channel_waiting_fsm_S3;
|
||||
/*!
|
||||
* \brief This class implements a State Machine for channel using boost::statechart
|
||||
*/
|
||||
class GpsL1CaChannelFsm: public sc::state_machine<GpsL1CaChannelFsm,gps_channel_idle_fsm_S0>
|
||||
class GpsL1CaChannelFsm: public sc::state_machine<GpsL1CaChannelFsm, gps_channel_idle_fsm_S0>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
GpsL1CaChannelFsm();
|
||||
GpsL1CaChannelFsm(AcquisitionInterface *acquisition);
|
||||
|
||||
|
@ -37,23 +37,15 @@
|
||||
|
||||
void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps)
|
||||
{
|
||||
//old
|
||||
//double phase = 0;
|
||||
//const double phase_step = (GPS_TWO_PI * _f) / _fs;
|
||||
//new Fixed Point NCO (faster)
|
||||
int phase_i = 0;
|
||||
int phase_step_i;
|
||||
float phase_step_f = (float)((GPS_TWO_PI * _f) / _fs);
|
||||
phase_step_i = gr::fxpt::float_to_fixed(phase_step_f);
|
||||
float sin_f,cos_f;
|
||||
float sin_f, cos_f;
|
||||
|
||||
for(unsigned int i = 0; i < _samps; i++)
|
||||
{
|
||||
//old
|
||||
//_dest[i] = std::complex<float>(cos(phase), sin(phase));
|
||||
//phase += phase_step;
|
||||
//new Fixed Point NCO (faster)
|
||||
gr::fxpt::sincos(phase_i,&sin_f,&cos_f);
|
||||
gr::fxpt::sincos(phase_i, &sin_f, &cos_f);
|
||||
_dest[i] = std::complex<float>(cos_f, sin_f);
|
||||
phase_i += phase_step_i;
|
||||
}
|
||||
@ -62,23 +54,15 @@ void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned
|
||||
|
||||
void complex_exp_gen_conj(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps)
|
||||
{
|
||||
//old
|
||||
//double phase = 0;
|
||||
//const double phase_step = (GPS_TWO_PI * _f) / _fs;
|
||||
//new Fixed Point NCO (faster)
|
||||
int phase_i = 0;
|
||||
int phase_step_i;
|
||||
float phase_step_f = (float)((GPS_TWO_PI * _f) / _fs);
|
||||
phase_step_i = gr::fxpt::float_to_fixed(phase_step_f);
|
||||
float sin_f,cos_f;
|
||||
float sin_f, cos_f;
|
||||
|
||||
for(unsigned int i = 0; i < _samps; i++)
|
||||
{
|
||||
//old
|
||||
//_dest[i] = std::complex<float>(cos(phase), sin(phase));
|
||||
//phase += phase_step;
|
||||
//new Fixed Point NCO (faster)
|
||||
gr::fxpt::sincos(phase_i,&sin_f,&cos_f);
|
||||
gr::fxpt::sincos(phase_i, &sin_f, &cos_f);
|
||||
_dest[i] = std::complex<float>(cos_f, -sin_f);
|
||||
phase_i += phase_step_i;
|
||||
}
|
||||
|
@ -44,44 +44,39 @@ unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples()
|
||||
return unpack_byte_2bit_samples_sptr(new unpack_byte_2bit_samples());
|
||||
}
|
||||
|
||||
unpack_byte_2bit_samples::unpack_byte_2bit_samples()
|
||||
: sync_interpolator("unpack_byte_2bit_samples",
|
||||
gr::io_signature::make(1, 1,sizeof(signed char)),
|
||||
gr::io_signature::make(1, 1,sizeof(float)),
|
||||
4)
|
||||
{
|
||||
|
||||
}
|
||||
unpack_byte_2bit_samples::unpack_byte_2bit_samples() : sync_interpolator("unpack_byte_2bit_samples",
|
||||
gr::io_signature::make(1, 1, sizeof(signed char)),
|
||||
gr::io_signature::make(1, 1, sizeof(float)),
|
||||
4)
|
||||
{}
|
||||
|
||||
unpack_byte_2bit_samples::~unpack_byte_2bit_samples()
|
||||
{
|
||||
{}
|
||||
|
||||
}
|
||||
|
||||
int unpack_byte_2bit_samples::work(int noutput_items,gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
int unpack_byte_2bit_samples::work(int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
const signed char *in = (const signed char *)input_items[0];
|
||||
float *out = (float*)output_items[0];
|
||||
|
||||
byte_2bit_struct sample;
|
||||
int n=0;
|
||||
for(int i = 0; i < noutput_items/4; i++) {
|
||||
// Read packed input sample (1 byte = 4 samples)
|
||||
signed char c = in[i];
|
||||
sample.two_bit_sample=c & 3;
|
||||
out[n++]=(float)sample.two_bit_sample;
|
||||
int n = 0;
|
||||
for(int i = 0; i < noutput_items/4; i++)
|
||||
{
|
||||
// Read packed input sample (1 byte = 4 samples)
|
||||
signed char c = in[i];
|
||||
sample.two_bit_sample = c & 3;
|
||||
out[n++] = (float)sample.two_bit_sample;
|
||||
|
||||
sample.two_bit_sample=(c>>2) & 3;
|
||||
out[n++]=(float)sample.two_bit_sample;
|
||||
sample.two_bit_sample = (c>>2) & 3;
|
||||
out[n++] = (float)sample.two_bit_sample;
|
||||
|
||||
sample.two_bit_sample=(c>>4) & 3;
|
||||
out[n++]=(float)sample.two_bit_sample;
|
||||
|
||||
sample.two_bit_sample=(c>>6) & 3;
|
||||
out[n++]=(float)sample.two_bit_sample;
|
||||
|
||||
}
|
||||
sample.two_bit_sample = (c>>4) & 3;
|
||||
out[n++] = (float)sample.two_bit_sample;
|
||||
|
||||
sample.two_bit_sample = (c>>6) & 3;
|
||||
out[n++] = (float)sample.two_bit_sample;
|
||||
}
|
||||
return noutput_items;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <gnuradio/sync_interpolator.h>
|
||||
|
||||
class unpack_byte_2bit_samples;
|
||||
|
||||
typedef boost::shared_ptr<unpack_byte_2bit_samples> unpack_byte_2bit_samples_sptr;
|
||||
|
||||
unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples();
|
||||
@ -51,7 +52,8 @@ private:
|
||||
public:
|
||||
unpack_byte_2bit_samples();
|
||||
~unpack_byte_2bit_samples();
|
||||
int work (int noutput_items, gr_vector_const_void_star &input_items,
|
||||
int work (int noutput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
|
@ -46,12 +46,11 @@ ControlMessageFactory::~ControlMessageFactory()
|
||||
|
||||
boost::shared_ptr<gr::message> ControlMessageFactory::GetQueueMessage(unsigned int who, unsigned int what)
|
||||
{
|
||||
ControlMessage *control_message = new ControlMessage;
|
||||
std::shared_ptr<ControlMessage> control_message = std::make_shared<ControlMessage>();
|
||||
control_message->who = who;
|
||||
control_message->what = what;
|
||||
boost::shared_ptr<gr::message> queue_message = gr::message::make(0, 0, 0, sizeof(ControlMessage));
|
||||
memcpy(queue_message->msg(), control_message, sizeof(ControlMessage));
|
||||
delete control_message;
|
||||
memcpy(queue_message->msg(), control_message.get(), sizeof(ControlMessage));
|
||||
return queue_message;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
@ -90,16 +91,14 @@ DEFINE_string(config_file, "../conf/gnss-sdr.conf",
|
||||
|
||||
ControlThread::ControlThread()
|
||||
{
|
||||
configuration_ = new FileConfiguration(FLAGS_config_file);
|
||||
delete_configuration_ = true;
|
||||
configuration_ = std::make_shared<FileConfiguration>(FLAGS_config_file);
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
ControlThread::ControlThread(ConfigurationInterface *configuration)
|
||||
ControlThread::ControlThread(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
delete_configuration_ = false;
|
||||
init();
|
||||
}
|
||||
|
||||
@ -111,10 +110,6 @@ ControlThread::~ControlThread()
|
||||
gps_ephemeris_data_write_to_XML();
|
||||
gps_iono_data_write_to_XML();
|
||||
gps_utc_model_data_write_to_XML();
|
||||
|
||||
delete flowgraph_;
|
||||
if (delete_configuration_) delete configuration_;
|
||||
delete control_message_factory_;
|
||||
}
|
||||
|
||||
|
||||
@ -234,8 +229,8 @@ void ControlThread::init()
|
||||
{
|
||||
// Instantiates a control queue, a GNSS flowgraph, and a control message factory
|
||||
control_queue_ = gr::msg_queue::make(0);
|
||||
flowgraph_ = new GNSSFlowgraph(configuration_, control_queue_);
|
||||
control_message_factory_ = new ControlMessageFactory();
|
||||
flowgraph_ = std::make_shared<GNSSFlowgraph>(configuration_, control_queue_);
|
||||
control_message_factory_ = std::make_shared<ControlMessageFactory>();
|
||||
stop_ = false;
|
||||
processed_control_messages_ = 0;
|
||||
applied_actions_ = 0;
|
||||
@ -544,7 +539,7 @@ void ControlThread::galileo_ephemeris_data_collector()
|
||||
if (galileo_eph.IOD_ephemeris > galileo_eph_old.IOD_ephemeris)
|
||||
{
|
||||
LOG(INFO) << "Galileo Ephemeris record updated in global map-- IOD_ephemeris ="
|
||||
<< galileo_eph.IOD_ephemeris << std::endl;
|
||||
<< galileo_eph.IOD_ephemeris;
|
||||
global_galileo_ephemeris_map.write(galileo_eph.SV_ID_PRN_4, galileo_eph);
|
||||
LOG(INFO) << "IOD_ephemeris OLD: " << galileo_eph_old.IOD_ephemeris;
|
||||
LOG(INFO) << "satellite: " << galileo_eph.SV_ID_PRN_4;
|
||||
@ -587,7 +582,7 @@ void ControlThread::gps_iono_data_collector()
|
||||
else
|
||||
{
|
||||
// insert new ephemeris record
|
||||
global_gps_iono_map.write(0 ,gps_iono);
|
||||
global_gps_iono_map.write(0, gps_iono);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -797,12 +792,11 @@ void ControlThread::keyboard_listener()
|
||||
if (c =='q')
|
||||
{
|
||||
std::cout << "Quit keystroke order received, stopping GNSS-SDR !!" << std::endl;
|
||||
ControlMessageFactory* cmf = new ControlMessageFactory();
|
||||
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
|
||||
if (control_queue_ != gr::msg_queue::sptr())
|
||||
{
|
||||
control_queue_->handle(cmf->GetQueueMessage(200, 0));
|
||||
}
|
||||
delete cmf;
|
||||
read_keys = false;
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
*
|
||||
* \param[in] configuration Pointer to a ConfigurationInterface
|
||||
*/
|
||||
ControlThread(ConfigurationInterface *configuration);
|
||||
ControlThread(std::shared_ptr<ConfigurationInterface> configuration);
|
||||
|
||||
//! \brief Virtual destructor. Derived classes must implement the destructor
|
||||
virtual ~ControlThread();
|
||||
@ -105,7 +105,7 @@ public:
|
||||
*/
|
||||
GNSSFlowgraph* flowgraph()
|
||||
{
|
||||
return flowgraph_;
|
||||
return flowgraph_.get();
|
||||
}
|
||||
|
||||
|
||||
@ -173,10 +173,10 @@ private:
|
||||
|
||||
|
||||
void apply_action(unsigned int what);
|
||||
GNSSFlowgraph *flowgraph_;
|
||||
ConfigurationInterface *configuration_;
|
||||
std::shared_ptr<GNSSFlowgraph> flowgraph_;
|
||||
std::shared_ptr<ConfigurationInterface> configuration_;
|
||||
boost::shared_ptr<gr::msg_queue> control_queue_;
|
||||
ControlMessageFactory *control_message_factory_;
|
||||
std::shared_ptr<ControlMessageFactory> control_message_factory_;
|
||||
std::vector<ControlMessage*> *control_messages_;
|
||||
bool stop_;
|
||||
bool delete_configuration_;
|
||||
|
@ -59,9 +59,6 @@ FileConfiguration::FileConfiguration()
|
||||
FileConfiguration::~FileConfiguration()
|
||||
{
|
||||
LOG(INFO) << "Destructor called";
|
||||
delete ini_reader_;
|
||||
delete converter_;
|
||||
delete overrided_;
|
||||
}
|
||||
|
||||
|
||||
@ -175,9 +172,9 @@ void FileConfiguration::set_property(std::string property_name, std::string valu
|
||||
|
||||
void FileConfiguration::init()
|
||||
{
|
||||
converter_ = new StringConverter();
|
||||
overrided_ = new InMemoryConfiguration();
|
||||
ini_reader_ = new INIReader(filename_);
|
||||
std::unique_ptr<StringConverter> converter_(new StringConverter);
|
||||
overrided_ = std::make_shared<InMemoryConfiguration>();
|
||||
ini_reader_ = std::make_shared<INIReader>(filename_);
|
||||
error_ = ini_reader_->ParseError();
|
||||
if(error_ == 0)
|
||||
{
|
||||
|
@ -38,6 +38,7 @@
|
||||
#define GNSS_SDR_FILE_CONFIGURATION_H_
|
||||
|
||||
#include "configuration_interface.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class INIReader;
|
||||
@ -71,10 +72,10 @@ public:
|
||||
private:
|
||||
void init();
|
||||
std::string filename_;
|
||||
INIReader *ini_reader_;
|
||||
InMemoryConfiguration* overrided_;
|
||||
std::shared_ptr<INIReader> ini_reader_;
|
||||
std::shared_ptr<InMemoryConfiguration> overrided_;
|
||||
std::unique_ptr<StringConverter> converter_;
|
||||
int error_;
|
||||
StringConverter *converter_;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_FILE_CONFIGURATION_H_*/
|
||||
|
@ -106,7 +106,7 @@ GNSSBlockFactory::~GNSSBlockFactory()
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetSignalSource(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "File_Signal_Source";
|
||||
std::string implementation = configuration->property(
|
||||
@ -119,7 +119,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalSource(
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetSignalConditioner(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "Pass_Through";
|
||||
std::string signal_conditioner = configuration->property(
|
||||
@ -151,7 +151,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalConditioner(
|
||||
if(signal_conditioner.compare("Array_Signal_Conditioner") == 0)
|
||||
{
|
||||
//instantiate the array version
|
||||
return new ArraySignalConditioner(configuration, GetBlock(configuration,
|
||||
return new ArraySignalConditioner(configuration.get(), GetBlock(configuration,
|
||||
"DataTypeAdapter", data_type_adapter, 1, 1, queue), GetBlock(
|
||||
configuration,"InputFilter", input_filter, 1, 1, queue),
|
||||
GetBlock(configuration,"Resampler", resampler, 1, 1, queue),
|
||||
@ -160,7 +160,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalConditioner(
|
||||
else
|
||||
{
|
||||
//normal version
|
||||
return new SignalConditioner(configuration, GetBlock(configuration,
|
||||
return new SignalConditioner(configuration.get(), GetBlock(configuration,
|
||||
"DataTypeAdapter", data_type_adapter, 1, 1, queue), GetBlock(
|
||||
configuration,"InputFilter", input_filter, 1, 1, queue),
|
||||
GetBlock(configuration,"Resampler", resampler, 1, 1, queue),
|
||||
@ -170,8 +170,8 @@ GNSSBlockInterface* GNSSBlockFactory::GetSignalConditioner(
|
||||
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetObservables(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetObservables(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "GPS_L1_CA_Observables";
|
||||
std::string implementation = configuration->property("Observables.implementation", default_implementation);
|
||||
@ -182,8 +182,8 @@ GNSSBlockInterface* GNSSBlockFactory::GetObservables(
|
||||
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetPVT(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetPVT(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "Pass_Through";
|
||||
std::string implementation = configuration->property("PVT.implementation", default_implementation);
|
||||
@ -194,8 +194,8 @@ GNSSBlockInterface* GNSSBlockFactory::GetPVT(
|
||||
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetOutputFilter(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetOutputFilter(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "Null_Sink_Output_Filter";
|
||||
std::string implementation = configuration->property("OutputFilter.implementation", default_implementation);
|
||||
@ -205,30 +205,28 @@ GNSSBlockInterface* GNSSBlockFactory::GetOutputFilter(
|
||||
|
||||
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetChannel(
|
||||
ConfigurationInterface *configuration, std::string acq,
|
||||
std::string trk, std::string tlm, int channel,
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::stringstream stream;
|
||||
stream << channel;
|
||||
std::string id = stream.str();
|
||||
LOG(INFO) << "Instantiating Channel " << id << " with Acquisition Implementation: "
|
||||
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
|
||||
<< acq << ", Tracking Implementation: " << trk << ", Telemetry Decoder implementation: " << tlm;
|
||||
|
||||
return new Channel(configuration, channel, GetBlock(configuration,
|
||||
return new Channel(configuration.get(), channel, GetBlock(configuration,
|
||||
"Channel", "Pass_Through", 1, 1, queue),
|
||||
(AcquisitionInterface*)GetBlock(configuration, "Acquisition",
|
||||
acq, 1, 1, queue), (TrackingInterface*)GetBlock(
|
||||
configuration, "Tracking", trk, 1, 1, queue),
|
||||
(TelemetryDecoderInterface*)GetBlock(configuration,
|
||||
"TelemetryDecoder", tlm, 1, 1, queue), "Channel",
|
||||
"Channel", queue);
|
||||
(AcquisitionInterface*)GetBlock(configuration, "Acquisition", acq, 1, 1, queue),
|
||||
(TrackingInterface*)GetBlock(configuration, "Tracking", trk, 1, 1, queue),
|
||||
(TelemetryDecoderInterface*)GetBlock(configuration, "TelemetryDecoder", tlm, 1, 1, queue),
|
||||
"Channel", "Channel", queue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::vector<GNSSBlockInterface*>* GNSSBlockFactory::GetChannels(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
std::shared_ptr<ConfigurationInterface> configuration, boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
std::string default_implementation = "Pass_Through";
|
||||
unsigned int channel_count = configuration->property("Channels.count", 12);
|
||||
@ -261,7 +259,8 @@ std::vector<GNSSBlockInterface*>* GNSSBlockFactory::GetChannels(
|
||||
* PLEASE ADD YOUR NEW BLOCK HERE!!
|
||||
*/
|
||||
GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
ConfigurationInterface *configuration, std::string role,
|
||||
std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role,
|
||||
std::string implementation, unsigned int in_streams,
|
||||
unsigned int out_streams, boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
@ -270,7 +269,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
//PASS THROUGH ----------------------------------------------------------------
|
||||
if (implementation.compare("Pass_Through") == 0)
|
||||
{
|
||||
block = new Pass_Through(configuration, role, in_streams, out_streams);
|
||||
block = new Pass_Through(configuration.get(), role, in_streams, out_streams);
|
||||
}
|
||||
|
||||
// SIGNAL SOURCES -------------------------------------------------------------
|
||||
@ -278,7 +277,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
{
|
||||
try
|
||||
{
|
||||
block = new FileSignalSource(configuration, role, in_streams,
|
||||
block = new FileSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
@ -292,7 +291,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
{
|
||||
try
|
||||
{
|
||||
block = new NsrFileSignalSource(configuration, role, in_streams,
|
||||
block = new NsrFileSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
@ -304,13 +303,13 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
}
|
||||
else if (implementation.compare("UHD_Signal_Source") == 0)
|
||||
{
|
||||
block = new UhdSignalSource(configuration, role, in_streams,
|
||||
block = new UhdSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
#if GN3S_DRIVER
|
||||
else if (implementation.compare("GN3S_Signal_Source") == 0)
|
||||
{
|
||||
block = new Gn3sSignalSource(configuration, role, in_streams,
|
||||
block = new Gn3sSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
#endif
|
||||
@ -318,7 +317,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
#if RAW_ARRAY_DRIVER
|
||||
else if (implementation.compare("Raw_Array_Signal_Source") == 0)
|
||||
{
|
||||
block = new RawArraySignalSource(configuration, role, in_streams,
|
||||
block = new RawArraySignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
#endif
|
||||
@ -326,7 +325,7 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
#if RTLSDR_DRIVER
|
||||
else if (implementation.compare("Rtlsdr_Signal_Source") == 0)
|
||||
{
|
||||
block = new RtlsdrSignalSource(configuration, role, in_streams,
|
||||
block = new RtlsdrSignalSource(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
#endif
|
||||
@ -334,172 +333,172 @@ GNSSBlockInterface* GNSSBlockFactory::GetBlock(
|
||||
// DATA TYPE ADAPTER -----------------------------------------------------------
|
||||
else if (implementation.compare("Ishort_To_Complex") == 0)
|
||||
{
|
||||
block = new IshortToComplex(configuration, role, in_streams,
|
||||
block = new IshortToComplex(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
// INPUT FILTER ----------------------------------------------------------------
|
||||
else if (implementation.compare("Fir_Filter") == 0)
|
||||
{
|
||||
block = new FirFilter(configuration, role, in_streams,
|
||||
block = new FirFilter(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Freq_Xlating_Fir_Filter") == 0)
|
||||
{
|
||||
block = new FreqXlatingFirFilter(configuration, role, in_streams,
|
||||
block = new FreqXlatingFirFilter(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Beamformer_Filter") == 0)
|
||||
{
|
||||
block = new BeamformerFilter(configuration, role, in_streams,
|
||||
block = new BeamformerFilter(configuration.get(), role, in_streams,
|
||||
out_streams);
|
||||
}
|
||||
|
||||
// RESAMPLER -------------------------------------------------------------------
|
||||
else if (implementation.compare("Direct_Resampler") == 0)
|
||||
{
|
||||
block = new DirectResamplerConditioner(configuration, role,
|
||||
block = new DirectResamplerConditioner(configuration.get(), role,
|
||||
in_streams, out_streams);
|
||||
}
|
||||
|
||||
// ACQUISITION BLOCKS ---------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsAcquisition(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_Assisted_Acquisition") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsAssistedAcquisition(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsAssistedAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_Tong_Acquisition") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsTongAcquisition(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsTongAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_Multithread_Acquisition") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsMultithreadAcquisition(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsMultithreadAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
#if OPENCL_BLOCKS
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_OpenCl_Acquisition") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsOpenClAcquisition(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsOpenClAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
#endif
|
||||
|
||||
else if (implementation.compare("GPS_L1_CA_PCPS_Acquisition_Fine_Doppler") == 0)
|
||||
{
|
||||
block = new GpsL1CaPcpsAcquisitionFineDoppler(configuration, role, in_streams,
|
||||
block = new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_PCPS_Ambiguous_Acquisition") == 0)
|
||||
{
|
||||
block = new GalileoE1PcpsAmbiguousAcquisition(configuration, role, in_streams,
|
||||
block = new GalileoE1PcpsAmbiguousAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_PCPS_8ms_Ambiguous_Acquisition") == 0)
|
||||
{
|
||||
block = new GalileoE1Pcps8msAmbiguousAcquisition(configuration, role, in_streams,
|
||||
block = new GalileoE1Pcps8msAmbiguousAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_PCPS_Tong_Ambiguous_Acquisition") == 0)
|
||||
{
|
||||
block = new GalileoE1PcpsTongAmbiguousAcquisition(configuration, role, in_streams,
|
||||
block = new GalileoE1PcpsTongAmbiguousAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_PCPS_CCCWSR_Ambiguous_Acquisition") == 0)
|
||||
{
|
||||
block = new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration, role, in_streams,
|
||||
block = new GalileoE1PcpsCccwsrAmbiguousAcquisition(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
// TRACKING BLOCKS -------------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_DLL_PLL_Tracking") == 0)
|
||||
{
|
||||
block = new GpsL1CaDllPllTracking(configuration, role, in_streams,
|
||||
block = new GpsL1CaDllPllTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_DLL_PLL_Optim_Tracking") == 0)
|
||||
{
|
||||
block = new GpsL1CaDllPllOptimTracking(configuration, role, in_streams,
|
||||
block = new GpsL1CaDllPllOptimTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_DLL_FLL_PLL_Tracking") == 0)
|
||||
{
|
||||
block = new GpsL1CaDllFllPllTracking(configuration, role, in_streams,
|
||||
block = new GpsL1CaDllFllPllTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GPS_L1_CA_TCP_CONNECTOR_Tracking") == 0)
|
||||
{
|
||||
block = new GpsL1CaTcpConnectorTracking(configuration, role, in_streams,
|
||||
block = new GpsL1CaTcpConnectorTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_DLL_PLL_VEML_Tracking") == 0)
|
||||
{
|
||||
block = new GalileoE1DllPllVemlTracking(configuration, role, in_streams,
|
||||
block = new GalileoE1DllPllVemlTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1_TCP_CONNECTOR_Tracking") == 0)
|
||||
{
|
||||
block = new GalileoE1TcpConnectorTracking(configuration, role, in_streams,
|
||||
block = new GalileoE1TcpConnectorTracking(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
// TELEMETRY DECODERS ----------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_Telemetry_Decoder") == 0)
|
||||
{
|
||||
block = new GpsL1CaTelemetryDecoder(configuration, role, in_streams,
|
||||
block = new GpsL1CaTelemetryDecoder(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("Galileo_E1B_Telemetry_Decoder") == 0)
|
||||
{
|
||||
block = new GalileoE1BTelemetryDecoder(configuration, role, in_streams,
|
||||
block = new GalileoE1BTelemetryDecoder(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("SBAS_L1_Telemetry_Decoder") == 0)
|
||||
{
|
||||
block = new SbasL1TelemetryDecoder(configuration, role, in_streams,
|
||||
block = new SbasL1TelemetryDecoder(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
// OBSERVABLES -----------------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_Observables") == 0)
|
||||
{
|
||||
block = new GpsL1CaObservables(configuration, role, in_streams,
|
||||
block = new GpsL1CaObservables(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
else if (implementation.compare("Galileo_E1B_Observables") == 0)
|
||||
{
|
||||
block = new GalileoE1Observables(configuration, role, in_streams,
|
||||
block = new GalileoE1Observables(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
|
||||
// PVT -------------------------------------------------------------------------
|
||||
else if (implementation.compare("GPS_L1_CA_PVT") == 0)
|
||||
{
|
||||
block = new GpsL1CaPvt(configuration, role, in_streams,
|
||||
block = new GpsL1CaPvt(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
else if (implementation.compare("GALILEO_E1_PVT") == 0)
|
||||
{
|
||||
block = new GalileoE1Pvt(configuration, role, in_streams,
|
||||
block = new GalileoE1Pvt(configuration.get(), role, in_streams,
|
||||
out_streams, queue);
|
||||
}
|
||||
// OUTPUT FILTERS --------------------------------------------------------------
|
||||
else if (implementation.compare("Null_Sink_Output_Filter") == 0)
|
||||
{
|
||||
block = new NullSinkOutputFilter(configuration, role, in_streams,
|
||||
block = new NullSinkOutputFilter(configuration.get(), role, in_streams,
|
||||
out_streams);
|
||||
}
|
||||
else if (implementation.compare("File_Output_Filter") == 0)
|
||||
{
|
||||
block = new FileOutputFilter(configuration, role, in_streams,
|
||||
block = new FileOutputFilter(configuration.get(), role, in_streams,
|
||||
out_streams);
|
||||
}
|
||||
else
|
||||
|
@ -51,25 +51,25 @@ class GNSSBlockFactory
|
||||
public:
|
||||
GNSSBlockFactory();
|
||||
virtual ~GNSSBlockFactory();
|
||||
GNSSBlockInterface* GetSignalSource(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetSignalConditioner(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetPVT(ConfigurationInterface *configuration,
|
||||
GNSSBlockInterface* GetSignalSource(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetObservables(ConfigurationInterface *configuration,
|
||||
GNSSBlockInterface* GetSignalConditioner(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetOutputFilter(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetChannel(ConfigurationInterface *configuration,
|
||||
GNSSBlockInterface* GetPVT(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetObservables(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetOutputFilter(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSBlockInterface* GetChannel(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string acq, std::string trk, std::string tlm, int channel,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
std::vector<GNSSBlockInterface*>* GetChannels(
|
||||
ConfigurationInterface *configuration, boost::shared_ptr<gr::msg_queue> queue);
|
||||
std::vector<GNSSBlockInterface*>* GetChannels(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
/*
|
||||
* \brief Returns the block with the required configuration and implementation
|
||||
*/
|
||||
GNSSBlockInterface* GetBlock(ConfigurationInterface* configuration,
|
||||
GNSSBlockInterface* GetBlock(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
std::string role, std::string implementation,
|
||||
unsigned int in_streams, unsigned int out_streams,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "unistd.h"
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <glog/logging.h>
|
||||
@ -47,23 +48,20 @@
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GNSSFlowgraph::GNSSFlowgraph(ConfigurationInterface *configuration,
|
||||
GNSSFlowgraph::GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue)
|
||||
{
|
||||
connected_ = false;
|
||||
running_ = false;
|
||||
configuration_ = configuration;
|
||||
blocks_ = new std::vector<GNSSBlockInterface*>();
|
||||
block_factory_ = new GNSSBlockFactory();
|
||||
queue_ = queue;
|
||||
//available_GNSS_signals_ = new std::list<Gnss_Satellite>();
|
||||
init();
|
||||
}
|
||||
|
||||
|
||||
GNSSFlowgraph::~GNSSFlowgraph()
|
||||
{
|
||||
delete block_factory_;
|
||||
for (unsigned int i = 0; i < blocks_->size(); i++)
|
||||
{
|
||||
delete blocks_->at(i);
|
||||
@ -425,7 +423,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
|
||||
|
||||
|
||||
|
||||
void GNSSFlowgraph::set_configuration(ConfigurationInterface* configuration)
|
||||
void GNSSFlowgraph::set_configuration(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
if (running_)
|
||||
{
|
||||
|
@ -60,8 +60,8 @@ public:
|
||||
/*!
|
||||
* \brief Constructor that initializes the receiver flowgraph
|
||||
*/
|
||||
GNSSFlowgraph(ConfigurationInterface* configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
GNSSFlowgraph(std::shared_ptr<ConfigurationInterface> configuration,
|
||||
boost::shared_ptr<gr::msg_queue> queue);
|
||||
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
@ -91,7 +91,7 @@ public:
|
||||
*/
|
||||
void apply_action(unsigned int who, unsigned int what);
|
||||
|
||||
void set_configuration(ConfigurationInterface* configuration);
|
||||
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
|
||||
|
||||
GNSSBlockInterface* signal_source();
|
||||
GNSSBlockInterface* signal_conditioner();
|
||||
@ -120,7 +120,7 @@ private:
|
||||
*/
|
||||
void set_signals_list();
|
||||
/*!
|
||||
* \brief Initializes the channels state (start acquisition or keep stanby) using the configuration parameters (number of channels and max channels in acquisition)
|
||||
* \brief Initializes the channels state (start acquisition or keep standby) using the configuration parameters (number of channels and max channels in acquisition)
|
||||
*/
|
||||
void set_channels_state();
|
||||
bool connected_;
|
||||
@ -130,8 +130,8 @@ private:
|
||||
unsigned int max_acq_channels_;
|
||||
unsigned int applied_actions_;
|
||||
std::string config_file_;
|
||||
ConfigurationInterface *configuration_;
|
||||
GNSSBlockFactory *block_factory_;
|
||||
std::shared_ptr<ConfigurationInterface> configuration_;
|
||||
std::unique_ptr<GNSSBlockFactory> block_factory_;
|
||||
std::vector<GNSSBlockInterface*>* blocks_;
|
||||
gr::top_block_sptr top_block_;
|
||||
boost::shared_ptr<gr::msg_queue> queue_;
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@ -31,19 +31,17 @@
|
||||
|
||||
|
||||
#include "in_memory_configuration.h"
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include "string_converter.h"
|
||||
|
||||
InMemoryConfiguration::InMemoryConfiguration()
|
||||
{
|
||||
converter_ = new StringConverter();
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
InMemoryConfiguration::~InMemoryConfiguration()
|
||||
{
|
||||
properties_.clear();
|
||||
delete converter_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2012 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@ -37,6 +37,7 @@
|
||||
#define GNSS_SDR_IN_MEMORY_CONFIGURATION_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "configuration_interface.h"
|
||||
|
||||
@ -64,7 +65,7 @@ public:
|
||||
bool is_present(std::string property_name);
|
||||
private:
|
||||
std::map<std::string, std::string> properties_;
|
||||
StringConverter *converter_;
|
||||
std::unique_ptr<StringConverter> converter_;
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_IN_MEMORY_CONFIGURATION_H_*/
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <complex>
|
||||
#include <ctime>
|
||||
#include <numeric>
|
||||
#include <armadillo>
|
||||
#include <volk/volk.h>
|
||||
|
||||
@ -150,12 +151,7 @@ TEST(Multiply_Test, C11ComplexImplementation)
|
||||
ASSERT_LE(0, end - begin);
|
||||
|
||||
std::complex<float> expected(0,0);
|
||||
std::complex<float> result(0,0);
|
||||
// auto result = std::inner_product(output.begin(), output.end(), output.begin(), 0);
|
||||
for (const auto &item : output)
|
||||
{
|
||||
result += item;
|
||||
}
|
||||
auto result = std::inner_product(output.begin(), output.end(), output.begin(), expected);
|
||||
ASSERT_EQ(expected, result);
|
||||
}
|
||||
|
||||
|
@ -40,46 +40,34 @@ TEST(File_Configuration_Test, OverridedProperties)
|
||||
{
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string filename = path + "data/config_file_sample.txt";
|
||||
ConfigurationInterface *configuration = new FileConfiguration(filename);
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(filename);
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new FileConfiguration(filename));
|
||||
std::string default_value = "default_value";
|
||||
std::string value = configuration->property("NotThere", default_value);
|
||||
|
||||
EXPECT_STREQ("default_value", value.c_str());
|
||||
|
||||
configuration->set_property("NotThere", "Yes!");
|
||||
value = configuration->property("NotThere", default_value);
|
||||
|
||||
EXPECT_STREQ("Yes!", value.c_str());
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TEST(File_Configuration_Test, LoadFromNonExistentFile)
|
||||
{
|
||||
|
||||
ConfigurationInterface *configuration = new FileConfiguration("./i_dont_exist.conf");
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new FileConfiguration("./i_dont_exist.conf"));
|
||||
std::string default_value = "default_value";
|
||||
std::string value = configuration->property("whatever.whatever", default_value);
|
||||
|
||||
EXPECT_STREQ("default_value", value.c_str());
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
TEST(File_Configuration_Test, PropertyDoesNotExist)
|
||||
{
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string filename = path + "data/config_file_sample.txt";
|
||||
ConfigurationInterface *configuration = new FileConfiguration(filename);
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new FileConfiguration(filename));
|
||||
std::string default_value = "default_value";
|
||||
std::string value = configuration->property("whatever.whatever", default_value);
|
||||
|
||||
EXPECT_STREQ("default_value", value.c_str());
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
@ -34,109 +34,86 @@
|
||||
|
||||
TEST(InMemoryConfiguration, IsPresent)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
//std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<InMemoryConfiguration> configuration(new InMemoryConfiguration);
|
||||
EXPECT_FALSE(configuration->is_present("NotThere"));
|
||||
|
||||
configuration->set_property("NotThere", "Yes!");
|
||||
EXPECT_TRUE(configuration->is_present("NotThere"));
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, StoreAndRetrieve)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
((InMemoryConfiguration*)configuration)->set_property("Foo.property1", "value");
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
configuration->set_property("Foo.property1", "value");
|
||||
std::string default_value = "default_value";
|
||||
std::string value = configuration->property("Foo.property1", default_value);
|
||||
|
||||
EXPECT_STREQ("value", value.c_str());
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, NoStoringAndRetrieve)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
std::string default_value = "default_value";
|
||||
std::string value = configuration->property("Foo.property1", default_value);
|
||||
|
||||
EXPECT_STREQ("default_value", value.c_str());
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveBool)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
((InMemoryConfiguration*)configuration)->set_property("Foo.property1", "true");
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
configuration->set_property("Foo.property1", "true");
|
||||
bool value = configuration->property("Foo.property1", false);
|
||||
bool expectedtrue = true;
|
||||
EXPECT_EQ(expectedtrue, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveBoolFail)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
((InMemoryConfiguration*)configuration)->set_property("Foo.property1", "tru");
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
configuration->set_property("Foo.property1", "tru");
|
||||
bool value = configuration->property("Foo.property1", false);
|
||||
|
||||
bool expectedfalse = false;
|
||||
EXPECT_EQ(expectedfalse, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveBoolNoDefine)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
bool value = configuration->property("Foo.property1", false);
|
||||
|
||||
bool expectedfalse = false;
|
||||
EXPECT_EQ(expectedfalse, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveSizeT)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
((InMemoryConfiguration*)configuration)->set_property("Foo.property1", "8");
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
configuration->set_property("Foo.property1", "8");
|
||||
unsigned int value = configuration->property("Foo.property1", 4);
|
||||
|
||||
unsigned int expected8 = 8;
|
||||
EXPECT_EQ(expected8, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveSizeTFail)
|
||||
{
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
((InMemoryConfiguration*)configuration)->set_property("Foo.property1", "true");
|
||||
unsigned int value = configuration->property("Foo.property1", 4);
|
||||
|
||||
unsigned int expected4 = 4;
|
||||
EXPECT_EQ(expected4, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveSizeTNoDefine) {
|
||||
ConfigurationInterface *configuration = new InMemoryConfiguration();
|
||||
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
configuration->set_property("Foo.property1", "true");
|
||||
unsigned int value = configuration->property("Foo.property1", 4);
|
||||
unsigned int expected4 = 4;
|
||||
EXPECT_EQ(expected4, value);
|
||||
}
|
||||
|
||||
TEST(InMemoryConfiguration, RetrieveSizeTNoDefine)
|
||||
{
|
||||
//std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
std::unique_ptr<ConfigurationInterface> configuration(new InMemoryConfiguration);
|
||||
unsigned int value = configuration->property("Foo.property1", 4);
|
||||
unsigned int expected4 = 4;
|
||||
EXPECT_EQ(expected4, value);
|
||||
|
||||
delete configuration;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <exception>
|
||||
#include <memory>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
@ -42,60 +43,20 @@
|
||||
#include <gnuradio/message.h>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/logging.h>
|
||||
//#include "control_thread.h"
|
||||
#include "control_thread.h"
|
||||
#include "in_memory_configuration.h"
|
||||
#include "control_message_factory.h"
|
||||
/*
|
||||
#include "control_thread.h"
|
||||
#include "gnss_flowgraph.h"
|
||||
#include "file_configuration.h"
|
||||
|
||||
|
||||
#include "gps_ephemeris.h"
|
||||
#include "gps_iono.h"
|
||||
#include "gps_utc_model.h"
|
||||
#include "gps_almanac.h"
|
||||
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "galileo_iono.h"
|
||||
#include "galileo_utc_model.h"
|
||||
#include "galileo_almanac.h"
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "concurrent_map.h"
|
||||
|
||||
extern concurrent_map<Gps_Ephemeris> global_gps_ephemeris_map;
|
||||
extern concurrent_map<Gps_Iono> global_gps_iono_map;
|
||||
extern concurrent_map<Gps_Utc_Model> global_gps_utc_model_map;
|
||||
extern concurrent_map<Gps_Almanac> global_gps_almanac_map;
|
||||
extern concurrent_map<Gps_Acq_Assist> global_gps_acq_assist_map;
|
||||
|
||||
extern concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue;
|
||||
extern concurrent_queue<Gps_Iono> global_gps_iono_queue;
|
||||
extern concurrent_queue<Gps_Utc_Model> global_gps_utc_model_queue;
|
||||
extern concurrent_queue<Gps_Almanac> global_gps_almanac_queue;
|
||||
extern concurrent_queue<Gps_Acq_Assist> global_gps_acq_assist_queue;
|
||||
|
||||
extern concurrent_map<Galileo_Ephemeris> global_galileo_ephemeris_map;
|
||||
extern concurrent_map<Galileo_Iono> global_galileo_iono_map;
|
||||
extern concurrent_map<Galileo_Utc_Model> global_galileo_utc_model_map;
|
||||
extern concurrent_map<Galileo_Almanac> global_galileo_almanac_map;
|
||||
//extern concurrent_map<Galileo_Acq_Assist> global_gps_acq_assist_map;
|
||||
|
||||
extern concurrent_queue<Galileo_Ephemeris> global_galileo_ephemeris_queue;
|
||||
extern concurrent_queue<Galileo_Iono> global_galileo_iono_queue;
|
||||
extern concurrent_queue<Galileo_Utc_Model> global_galileo_utc_model_queue;
|
||||
extern concurrent_queue<Galileo_Almanac> global_galileo_almanac_queue;
|
||||
*/
|
||||
|
||||
|
||||
TEST(Control_Thread_Test, InstantiateRunControlMessages)
|
||||
{
|
||||
InMemoryConfiguration *config = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("SignalSource.implementation", "File_Signal_Source");
|
||||
//config->set_property("SignalSource.filename", "../src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat");
|
||||
config->set_property("SignalSource.filename", "../src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat");
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
|
||||
const char * file_name = file.c_str();
|
||||
config->set_property("SignalSource.filename", file_name);
|
||||
config->set_property("SignalSource.item_type", "gr_complex");
|
||||
config->set_property("SignalSource.sampling_frequency", "4000000");
|
||||
config->set_property("SignalSource.repeat", "true");
|
||||
@ -124,7 +85,7 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages)
|
||||
|
||||
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_queue->handle(control_msg_factory->GetQueueMessage(200,0));
|
||||
|
||||
control_thread->set_control_queue(control_queue);
|
||||
try
|
||||
@ -144,10 +105,6 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages)
|
||||
unsigned int expected1 = 1;
|
||||
EXPECT_EQ(expected3, control_thread->processed_control_messages());
|
||||
EXPECT_EQ(expected1, control_thread->applied_actions());
|
||||
|
||||
delete config;
|
||||
//delete control_thread;
|
||||
//delete control_msg_factory;
|
||||
}
|
||||
|
||||
|
||||
@ -156,10 +113,12 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages)
|
||||
|
||||
TEST(Control_Thread_Test, InstantiateRunControlMessages2)
|
||||
{
|
||||
InMemoryConfiguration *config = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> config = std::make_shared<InMemoryConfiguration>();
|
||||
config->set_property("SignalSource.implementation", "File_Signal_Source");
|
||||
//config->set_property("SignalSource.filename", "../src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat");
|
||||
config->set_property("SignalSource.filename", "../src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat");
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string file = path + "signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat";
|
||||
const char * file_name = file.c_str();
|
||||
config->set_property("SignalSource.filename", file_name);
|
||||
config->set_property("SignalSource.item_type", "gr_complex");
|
||||
config->set_property("SignalSource.sampling_frequency", "4000000");
|
||||
config->set_property("SignalSource.repeat", "true");
|
||||
@ -179,7 +138,6 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages2)
|
||||
config->set_property("OutputFilter.implementation", "Null_Sink_Output_Filter");
|
||||
config->set_property("OutputFilter.item_type", "gr_complex");
|
||||
|
||||
//ControlThread *control_thread = new ControlThread(config);
|
||||
std::unique_ptr<ControlThread> control_thread2(new ControlThread(config));
|
||||
|
||||
gr::msg_queue::sptr control_queue2 = gr::msg_queue::make(0);
|
||||
@ -211,8 +169,4 @@ TEST(Control_Thread_Test, InstantiateRunControlMessages2)
|
||||
unsigned int expected1 = 1;
|
||||
EXPECT_EQ(expected5, control_thread2->processed_control_messages());
|
||||
EXPECT_EQ(expected1, control_thread2->applied_actions());
|
||||
|
||||
delete config;
|
||||
//delete control_thread;
|
||||
//delete control_msg_factory;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
TEST(GNSSFlowgraph, InstantiateConnectStartStop)
|
||||
{
|
||||
InMemoryConfiguration* config = new InMemoryConfiguration();
|
||||
std::shared_ptr<ConfigurationInterface> config = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
config->set_property("SignalSource.sampling_frequency", "4000000");
|
||||
config->set_property("SignalSource.implementation", "File_Signal_Source");
|
||||
@ -58,6 +58,7 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStop)
|
||||
config->set_property("Channels.count", "2");
|
||||
config->set_property("Channels.acquisition.implementation", "Pass_Through");
|
||||
config->set_property("Channels.tracking.implementation", "Pass_Through");
|
||||
config->set_property("Channels.telemetry.implementation", "Pass_Through");
|
||||
config->set_property("Channels.observables.implementation", "Pass_Through");
|
||||
config->set_property("Observables.implementation", "GPS_L1_CA_Observables");
|
||||
config->set_property("PVT.implementation", "GPS_L1_CA_PVT");
|
||||
@ -70,9 +71,11 @@ TEST(GNSSFlowgraph, InstantiateConnectStartStop)
|
||||
EXPECT_STREQ("Channel", flowgraph->channel(0)->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(0))->acquisition()->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(0))->tracking()->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(0))->telemetry()->implementation().c_str());
|
||||
EXPECT_STREQ("Channel", flowgraph->channel(1)->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(1))->acquisition()->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(1))->tracking()->implementation().c_str());
|
||||
EXPECT_STREQ("Pass_Through", ((Channel*)flowgraph->channel(1))->telemetry()->implementation().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_Observables", flowgraph->observables()->implementation().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_PVT", flowgraph->pvt()->implementation().c_str());
|
||||
EXPECT_STREQ("Null_Sink_Output_Filter", flowgraph->output_filter()->implementation().c_str());
|
||||
|
@ -47,44 +47,36 @@
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("SignalSource.implementation", "File_Signal_Source");
|
||||
std::string path = std::string(TEST_PATH);
|
||||
std::string filename = path + "signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat";
|
||||
configuration->set_property("SignalSource.filename", filename);
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *signal_source = factory->GetSignalSource(configuration, queue);
|
||||
EXPECT_STREQ("SignalSource", signal_source->role().c_str());
|
||||
EXPECT_STREQ("File_Signal_Source", signal_source->implementation().c_str());
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete signal_source;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateUHDSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("SignalSource.implementation", "UHD_Signal_Source");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *signal_source = factory->GetSignalSource(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("SignalSource", signal_source->role().c_str());
|
||||
EXPECT_STREQ("UHD_Signal_Source", signal_source->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete signal_source;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("SignalSource.implementation", "Pepito");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
@ -92,33 +84,29 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongSignalSource)
|
||||
GNSSBlockInterface *signal_source = factory->GetSignalSource(configuration, queue);
|
||||
|
||||
EXPECT_EQ(NULL, signal_source);
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateSignalConditioner)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("SignalConditioner.implementation", "Signal_Conditioner");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *signal_conditioner = factory->GetSignalConditioner(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("SignalConditioner", signal_conditioner->role().c_str());
|
||||
EXPECT_STREQ("Signal_Conditioner", signal_conditioner->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete signal_conditioner;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
configuration->set_property("InputFilter.implementation", "Fir_Filter");
|
||||
@ -142,20 +130,18 @@ TEST(GNSS_Block_Factory_Test, InstantiateFIRFilter)
|
||||
configuration->set_property("InputFilter.filter_type", "bandpass");
|
||||
configuration->set_property("InputFilter.grid_density", "16");
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *input_filter = factory->GetBlock(configuration, "InputFilter", "Fir_Filter", 1,1, queue);
|
||||
|
||||
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
||||
EXPECT_STREQ("Fir_Filter", input_filter->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete input_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
configuration->set_property("InputFilter.implementation", "Freq_Xlating_Fir_Filter");
|
||||
@ -182,162 +168,144 @@ TEST(GNSS_Block_Factory_Test, InstantiateFreqXlatingFIRFilter)
|
||||
configuration->set_property("InputFilter.sampling_frequency","4000000");
|
||||
configuration->set_property("InputFilter.IF","34000");
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *input_filter = factory->GetBlock(configuration, "InputFilter", "Freq_Xlating_Fir_Filter", 1,1, queue);
|
||||
|
||||
EXPECT_STREQ("InputFilter", input_filter->role().c_str());
|
||||
EXPECT_STREQ("Freq_Xlating_Fir_Filter", input_filter->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete input_filter;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateDirectResampler)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Resampler.implementation", "Direct_Resampler");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *resampler = factory->GetBlock(configuration, "Resampler", "Direct_Resampler", 1,1, queue);
|
||||
|
||||
EXPECT_STREQ("Resampler", resampler->role().c_str());
|
||||
EXPECT_STREQ("Direct_Resampler", resampler->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete resampler;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPcpsAcquisition)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Acquisition.implementation", "GPS_L1_CA_PCPS_Acquisition");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
AcquisitionInterface *acquisition = (AcquisitionInterface*)factory->GetBlock(configuration, "Acquisition", "GPS_L1_CA_PCPS_Acquisition", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_PCPS_Acquisition", acquisition->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete acquisition;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1PcpsAmbiguousAcquisition)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Acquisition.implementation", "Galileo_E1_PCPS_Ambiguous_Acquisition");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
AcquisitionInterface *acquisition = (AcquisitionInterface*)factory->GetBlock(configuration, "Acquisition", "Galileo_E1_PCPS_Ambiguous_Acquisition", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Acquisition", acquisition->role().c_str());
|
||||
EXPECT_STREQ("Galileo_E1_PCPS_Ambiguous_Acquisition", acquisition->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete acquisition;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllFllPllTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_FLL_PLL_Tracking");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_FLL_PLL_Tracking", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_DLL_FLL_PLL_Tracking", tracking->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete tracking;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaDllPllTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_DLL_PLL_Tracking");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_DLL_PLL_Tracking", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_DLL_PLL_Tracking", tracking->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete tracking;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTcpConnectorTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Tracking.implementation", "GPS_L1_CA_TCP_CONNECTOR_Tracking");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "GPS_L1_CA_TCP_CONNECTOR_Tracking", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_TCP_CONNECTOR_Tracking", tracking->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete tracking;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGalileoE1DllPllVemlTracking)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Tracking.implementation", "Galileo_E1_DLL_PLL_VEML_Tracking");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
TrackingInterface *tracking = (TrackingInterface*)factory->GetBlock(configuration, "Tracking", "Galileo_E1_DLL_PLL_VEML_Tracking", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("Tracking", tracking->role().c_str());
|
||||
EXPECT_STREQ("Galileo_E1_DLL_PLL_VEML_Tracking", tracking->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete tracking;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaTelemetryDecoder)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("TelemetryDecoder.implementation", "GPS_L1_CA_Telemetry_Decoder");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
TelemetryDecoderInterface *telemetry_decoder = (TelemetryDecoderInterface*)factory->GetBlock(configuration, "TelemetryDecoder", "GPS_L1_CA_Telemetry_Decoder", 1, 1, queue);
|
||||
|
||||
EXPECT_STREQ("TelemetryDecoder", telemetry_decoder->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_Telemetry_Decoder", telemetry_decoder->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete telemetry_decoder;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateChannels)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
|
||||
configuration->set_property("Channels.count", "2");
|
||||
configuration->set_property("Channels.in_acquisition", "2");
|
||||
@ -352,14 +320,12 @@ TEST(GNSS_Block_Factory_Test, InstantiateChannels)
|
||||
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
|
||||
std::vector<GNSSBlockInterface*>* channels = factory->GetChannels(configuration, queue);
|
||||
|
||||
EXPECT_EQ((unsigned int) 2, channels->size());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
;
|
||||
for(unsigned int i=0 ; i<channels->size() ; i++) delete channels->at(i);
|
||||
channels->clear();
|
||||
delete channels;
|
||||
@ -368,105 +334,91 @@ TEST(GNSS_Block_Factory_Test, InstantiateChannels)
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Observables.implementation", "Pass_Through");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
ObservablesInterface *observables = (ObservablesInterface*)factory->GetObservables(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("Observables", observables->role().c_str());
|
||||
EXPECT_STREQ("Pass_Through", observables->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete observables;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Observables.implementation", "GPS_L1_CA_Observables");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
ObservablesInterface *observables = (ObservablesInterface*)factory->GetObservables(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("Observables", observables->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_Observables", observables->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete observables;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongObservables)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("Observables.implementation", "Pepito");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
ObservablesInterface *observables = (ObservablesInterface*)factory->GetObservables(configuration, queue);
|
||||
|
||||
EXPECT_EQ(NULL, observables);
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete observables;
|
||||
}
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiatePvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("PVT.implementation", "Pass_Through");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
PvtInterface *pvt = (PvtInterface*)factory->GetPVT(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("PVT", pvt->role().c_str());
|
||||
EXPECT_STREQ("Pass_Through", pvt->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete pvt;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateGpsL1CaPvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("PVT.implementation", "GPS_L1_CA_PVT");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
PvtInterface *pvt = (PvtInterface*)factory->GetPVT(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("PVT", pvt->role().c_str());
|
||||
EXPECT_STREQ("GPS_L1_CA_PVT", pvt->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete pvt;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("PVT.implementation", "Pepito");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
PvtInterface *pvt = (PvtInterface*)factory->GetPVT(configuration, queue);
|
||||
|
||||
EXPECT_EQ(NULL, pvt);
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete pvt;
|
||||
}
|
||||
|
||||
@ -474,51 +426,45 @@ TEST(GNSS_Block_Factory_Test, InstantiateWrongPvt)
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateNullSinkOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("OutputFilter.implementation", "Null_Sink_Output_Filter");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *output_filter = factory->GetOutputFilter(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("OutputFilter", output_filter->role().c_str());
|
||||
EXPECT_STREQ("Null_Sink_Output_Filter", output_filter->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete output_filter;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateFileOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("OutputFilter.implementation", "File_Output_Filter");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *output_filter = factory->GetOutputFilter(configuration, queue);
|
||||
|
||||
EXPECT_STREQ("OutputFilter", output_filter->role().c_str());
|
||||
EXPECT_STREQ("File_Output_Filter", output_filter->implementation().c_str());
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete output_filter;
|
||||
}
|
||||
|
||||
|
||||
TEST(GNSS_Block_Factory_Test, InstantiateWrongOutputFilter)
|
||||
{
|
||||
InMemoryConfiguration *configuration = new InMemoryConfiguration();
|
||||
std::shared_ptr<InMemoryConfiguration> configuration = std::make_shared<InMemoryConfiguration>();
|
||||
configuration->set_property("OutputFilter.implementation", "Pepito");
|
||||
gr::msg_queue::sptr queue = gr::msg_queue::make(0);
|
||||
|
||||
GNSSBlockFactory *factory = new GNSSBlockFactory();
|
||||
std::shared_ptr<GNSSBlockFactory> factory = std::make_shared<GNSSBlockFactory>();
|
||||
GNSSBlockInterface *output_filter = factory->GetOutputFilter(configuration, queue);
|
||||
|
||||
EXPECT_EQ(NULL, output_filter);
|
||||
|
||||
delete configuration;
|
||||
delete factory;
|
||||
delete output_filter;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <memory>
|
||||
#include <gtest/gtest.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gflags/gflags.h>
|
||||
@ -77,11 +78,8 @@ DECLARE_string(log_dir);
|
||||
#include "control_thread/control_message_factory_test.cc"
|
||||
//#include "control_thread/control_thread_test.cc"
|
||||
#include "flowgraph/pass_through_test.cc"
|
||||
#include "gnss_block/gnss_block_factory_test.cc"
|
||||
#include "gnuradio_block/gnss_sdr_valve_test.cc"
|
||||
#include "gnuradio_block/direct_resampler_conditioner_cc_test.cc"
|
||||
#include "string_converter/string_converter_test.cc"
|
||||
//#include "flowgraph/gnss_flowgraph_test.cc"
|
||||
#include "gnss_block/gnss_block_factory_test.cc"
|
||||
#include "gnss_block/rtcm_printer_test.cc"
|
||||
#include "gnss_block/file_output_filter_test.cc"
|
||||
#include "gnss_block/file_signal_source_test.cc"
|
||||
@ -100,7 +98,9 @@ DECLARE_string(log_dir);
|
||||
#include "gnss_block/galileo_e1_pcps_tong_ambiguous_acquisition_gsoc2013_test.cc"
|
||||
#include "gnss_block/galileo_e1_pcps_cccwsr_ambiguous_acquisition_gsoc2013_test.cc"
|
||||
#include "gnss_block/galileo_e1_dll_pll_veml_tracking_test.cc"
|
||||
|
||||
#include "gnuradio_block/gnss_sdr_valve_test.cc"
|
||||
#include "gnuradio_block/direct_resampler_conditioner_cc_test.cc"
|
||||
#include "string_converter/string_converter_test.cc"
|
||||
|
||||
|
||||
concurrent_queue<Gps_Ephemeris> global_gps_ephemeris_queue;
|
||||
|
@ -234,7 +234,7 @@ int FrontEndCal::Get_SUPL_Assist()
|
||||
}
|
||||
|
||||
|
||||
void FrontEndCal::set_configuration(ConfigurationInterface *configuration)
|
||||
void FrontEndCal::set_configuration(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
class FrontEndCal
|
||||
{
|
||||
private:
|
||||
ConfigurationInterface *configuration_;
|
||||
std::shared_ptr<ConfigurationInterface> configuration_;
|
||||
|
||||
/*!
|
||||
* \brief LLA2ECEF Convert geodetic coordinates to Earth-centered Earth-fixed
|
||||
@ -98,7 +98,7 @@ public:
|
||||
* \brief Sets the configuration data required by get_ephemeris function
|
||||
*
|
||||
*/
|
||||
void set_configuration(ConfigurationInterface *configuration);
|
||||
void set_configuration(std::shared_ptr<ConfigurationInterface> configuration);
|
||||
|
||||
/*!
|
||||
* \brief This function connects to a Secure User Location Protocol (SUPL) server to obtain
|
||||
|
@ -146,7 +146,7 @@ void wait_message()
|
||||
}
|
||||
}
|
||||
|
||||
bool front_end_capture(ConfigurationInterface *configuration)
|
||||
bool front_end_capture(std::shared_ptr<ConfigurationInterface> configuration)
|
||||
{
|
||||
gr::top_block_sptr top_block;
|
||||
GNSSBlockFactory block_factory;
|
||||
@ -158,8 +158,7 @@ bool front_end_capture(ConfigurationInterface *configuration)
|
||||
GNSSBlockInterface *source;
|
||||
source = block_factory.GetSignalSource(configuration, queue);
|
||||
|
||||
GNSSBlockInterface *conditioner;
|
||||
conditioner = block_factory.GetSignalConditioner(configuration,queue);
|
||||
GNSSBlockInterface *conditioner = block_factory.GetSignalConditioner(configuration,queue);
|
||||
|
||||
gr::block_sptr sink;
|
||||
sink = gr::blocks::file_sink::make(sizeof(gr_complex), "tmp_capture.dat");
|
||||
@ -192,7 +191,7 @@ bool front_end_capture(ConfigurationInterface *configuration)
|
||||
return false;
|
||||
}
|
||||
|
||||
delete conditioner;
|
||||
//delete conditioner;
|
||||
delete source;
|
||||
return true;
|
||||
}
|
||||
@ -262,8 +261,8 @@ int main(int argc, char** argv)
|
||||
|
||||
// 1. Load configuration parameters from config file
|
||||
|
||||
ConfigurationInterface *configuration;
|
||||
configuration = new FileConfiguration(FLAGS_config_file);
|
||||
std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(FLAGS_config_file);
|
||||
//configuration = new FileConfiguration(FLAGS_config_file);
|
||||
front_end_cal.set_configuration(configuration);
|
||||
|
||||
|
||||
@ -306,7 +305,7 @@ int main(int argc, char** argv)
|
||||
long fs_in_ = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
|
||||
GNSSBlockFactory block_factory;
|
||||
acquisition = new GpsL1CaPcpsAcquisitionFineDoppler(configuration, "Acquisition", 1, 1, queue);
|
||||
acquisition = new GpsL1CaPcpsAcquisitionFineDoppler(configuration.get(), "Acquisition", 1, 1, queue);
|
||||
|
||||
acquisition->set_channel(1);
|
||||
acquisition->set_gnss_synchro(gnss_synchro);
|
||||
@ -413,7 +412,7 @@ int main(int argc, char** argv)
|
||||
else
|
||||
{
|
||||
std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl;
|
||||
delete configuration;
|
||||
//delete configuration;
|
||||
delete acquisition;
|
||||
delete gnss_synchro;
|
||||
google::ShutDownCommandLineFlags();
|
||||
@ -435,7 +434,7 @@ int main(int argc, char** argv)
|
||||
if (doppler_measurements_map.size() == 0)
|
||||
{
|
||||
std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl;
|
||||
delete configuration;
|
||||
//delete configuration;
|
||||
delete acquisition;
|
||||
delete gnss_synchro;
|
||||
google::ShutDownCommandLineFlags();
|
||||
@ -517,7 +516,7 @@ int main(int argc, char** argv)
|
||||
|
||||
// 8. Generate GNSS-SDR config file.
|
||||
|
||||
delete configuration;
|
||||
//delete configuration;
|
||||
delete acquisition;
|
||||
delete gnss_synchro;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user