1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-26 15:03:14 +00:00

File cleaning

This commit is contained in:
Carles Fernandez 2019-07-07 21:44:58 +02:00
parent 29a910df30
commit 6cc1de7118
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
8 changed files with 19 additions and 56 deletions

View File

@ -55,7 +55,6 @@ public:
// google::protobuf::ShutdownProtobufLibrary();
}
/*
inline Serdes_Monitor_Pvt(Serdes_Monitor_Pvt&& other) //!< Copy constructor
{
this->monitor_ = other.monitor_;
@ -63,12 +62,7 @@ public:
inline Serdes_Monitor_Pvt& operator=(const Serdes_Monitor_Pvt& rhs) //!< Copy assignment operator
{
// Only do assignment if RHS is a different object from this.
if (this != &rhs)
{
// Deallocate, allocate new space, copy values...
this->monitor_ = rhs.monitor_;
}
this->monitor_ = rhs.monitor_;
return *this;
}
@ -84,7 +78,7 @@ public:
this->monitor_ = std::move(other.monitor_);
}
return *this;
}*/
}
inline std::string createProtobuffer(const Monitor_Pvt& monitor) //!< Serialization into a string
{

View File

@ -31,11 +31,8 @@
#include "beamformer.h"
#include <gnuradio/io_signature.h>
#include <sstream>
#define GNSS_SDR_BEAMFORMER_CHANNELS 8
beamformer_sptr make_beamformer_sptr()
{
return beamformer_sptr(new beamformer());
@ -47,22 +44,6 @@ beamformer::beamformer()
gr::io_signature::make(GNSS_SDR_BEAMFORMER_CHANNELS, GNSS_SDR_BEAMFORMER_CHANNELS, sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex)))
{
//initialize weight vector
if (posix_memalign(reinterpret_cast<void **>(&weight_vector), 16, GNSS_SDR_BEAMFORMER_CHANNELS * sizeof(gr_complex)) == 0)
{
};
for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
{
weight_vector[i] = gr_complex(1, 0);
}
}
beamformer::~beamformer()
{
free(weight_vector);
}
@ -86,7 +67,7 @@ int beamformer::work(int noutput_items, gr_vector_const_void_star &input_items,
for (int n = 0; n < noutput_items; n++)
{
sum = gr_complex(0, 0);
for (int i = 0; i < GNSS_SDR_BEAMFORMER_CHANNELS; i++)
for (int i = 0; i < weight_vector.size(); i++)
{
sum = sum + (reinterpret_cast<const gr_complex *>(input_items[i]))[n] * weight_vector[i];
}

View File

@ -32,26 +32,30 @@
#define GNSS_SDR_BEAMFORMER_H
#include <gnuradio/sync_block.h>
#include <vector>
class beamformer;
using beamformer_sptr = boost::shared_ptr<beamformer>;
beamformer_sptr make_beamformer_sptr();
const int GNSS_SDR_BEAMFORMER_CHANNELS = 8;
/*!
* \brief This class implements a real-time software-defined spatial filter using the CTTC GNSS experimental antenna array input and a set of dynamically reloadable weights
*/
class beamformer : public gr::sync_block
{
public:
~beamformer();
~beamformer() = default;
int work(int noutput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
private:
friend beamformer_sptr make_beamformer_sptr();
beamformer();
gr_complex *weight_vector;
std::vector<gr_complex> weight_vector = std::vector<gr_complex>(GNSS_SDR_BEAMFORMER_CHANNELS, gr_complex(1.0, 0.0));
};
#endif

View File

@ -48,13 +48,6 @@ Exponential_Smoother::Exponential_Smoother()
}
Exponential_Smoother::~Exponential_Smoother() = default;
// Move assignment operator
Exponential_Smoother& Exponential_Smoother::operator=(Exponential_Smoother&& other) = default;
void Exponential_Smoother::set_alpha(float alpha)
{
alpha_ = alpha;

View File

@ -48,7 +48,7 @@ class Exponential_Smoother
{
public:
Exponential_Smoother(); //!< Constructor
~Exponential_Smoother(); //!< Destructor
~Exponential_Smoother() = default; //!< Destructor
void set_alpha(float alpha); //!< 0 < alpha < 1. The higher, the most responsive, but more variance. Default value: 0.001
void set_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
void reset();
@ -56,7 +56,8 @@ public:
void set_offset(float offset);
float smooth(float raw);
double smooth(double raw);
Exponential_Smoother& operator=(Exponential_Smoother&& other); //!< Move assignment operator
Exponential_Smoother(Exponential_Smoother&&) = default; //!< Move operator
Exponential_Smoother& operator=(Exponential_Smoother&& /*other*/) = default; //!< Move assignment operator
private:
float alpha_; // takes value 0.0001 if not set
int samples_for_initialization_;

View File

@ -68,13 +68,6 @@ Tracking_loop_filter::Tracking_loop_filter()
}
Tracking_loop_filter::~Tracking_loop_filter() = default;
// Move assignment operator
Tracking_loop_filter& Tracking_loop_filter::operator=(Tracking_loop_filter&& other) = default;
float Tracking_loop_filter::apply(float current_input)
{
// Now apply the filter coefficients:
@ -238,6 +231,7 @@ void Tracking_loop_filter::set_update_interval(float update_interval)
update_coefficients();
}
float Tracking_loop_filter::get_update_interval(void) const
{
return d_update_interval;

View File

@ -45,13 +45,14 @@ class Tracking_loop_filter
{
public:
Tracking_loop_filter();
~Tracking_loop_filter();
~Tracking_loop_filter() = default;
Tracking_loop_filter(float update_interval, float noise_bandwidth,
int loop_order = 2,
bool include_last_integrator = false);
Tracking_loop_filter& operator=(Tracking_loop_filter&& other); //!< Move assignment operator
Tracking_loop_filter(Tracking_loop_filter&&) = default; //!< Move operator
Tracking_loop_filter& operator=(Tracking_loop_filter&& /*other*/) = default; //!< Move assignment operator
float get_noise_bandwidth(void) const;
float get_update_interval(void) const;

View File

@ -56,7 +56,7 @@ public:
{
google::protobuf::ShutdownProtobufLibrary();
}
/*
inline Serdes_Gnss_Synchro(Serdes_Gnss_Synchro&& other) //!< Copy constructor
{
this->observables = other.observables;
@ -64,12 +64,7 @@ public:
inline Serdes_Gnss_Synchro& operator=(const Serdes_Gnss_Synchro& rhs) //!< Copy assignment operator
{
// Only do assignment if RHS is a different object from this.
if (this != &rhs)
{
// Deallocate, allocate new space, copy values...
this->observables = rhs.observables;
}
this->observables = rhs.observables;
return *this;
}
@ -85,7 +80,7 @@ public:
this->observables = std::move(other.observables);
}
return *this;
}*/
}
inline std::string createProtobuffer(const std::vector<Gnss_Synchro>& vgs) //!< Serialization into a string
{