1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-12 18:30:34 +00:00

Code cleaning and documentation

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@151 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2012-01-31 00:03:08 +00:00
parent 9625070ea9
commit c186828669
9 changed files with 91 additions and 81 deletions

View File

@ -1,5 +1,5 @@
/*! /*!
* \file correlator.h * \file correlator.cc
* \brief Highly optimized vector correlator class * \brief Highly optimized vector correlator class
* \author Javier Arribas, 2011. jarribas(at)cttc.es * \author Javier Arribas, 2011. jarribas(at)cttc.es
* *

View File

@ -39,7 +39,11 @@
/*! /*!
* \brief High optimized vector correlator class * \brief Class that implements carrier wipe-off and correlators.
*
* Implemented versions:
* - Generic: Standard C++ implementation.
* - Volk: uses VOLK (Vector-Optimized Library of Kernels) and uses the processor's SIMD instruction sets. See http://gnuradio.org/redmine/projects/gnuradio/wiki/Volk
* *
*/ */
class Correlator class Correlator

View File

@ -63,13 +63,11 @@ Gnss_Satellite::~Gnss_Satellite()
void Gnss_Satellite::reset() void Gnss_Satellite::reset()
{ {
system_set = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}; system_set = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
satelliteSystem["GPS"] = "G"; satelliteSystem["GPS"] = "G";
satelliteSystem["GLONASS"] = "R"; satelliteSystem["GLONASS"] = "R";
satelliteSystem["SBAS"] = "S"; satelliteSystem["SBAS"] = "S";
satelliteSystem["Galileo"] = "E"; satelliteSystem["Galileo"] = "E";
satelliteSystem["Compass"] = "C"; satelliteSystem["Compass"] = "C";
PRN = 0; PRN = 0;
system = std::string(""); system = std::string("");
block = std::string(""); block = std::string("");
@ -188,6 +186,10 @@ void Gnss_Satellite::set_PRN(unsigned int PRN_)
{ {
PRN = 11; PRN = 11;
} }
else if (PRN_ == 12)
{
PRN = 12;
}
else else
{ {
DLOG(INFO) << "This PRN is not defined"; DLOG(INFO) << "This PRN is not defined";
@ -228,8 +230,7 @@ std::string Gnss_Satellite::get_system() const
std::string Gnss_Satellite::get_system_short() const std::string Gnss_Satellite::get_system_short() const
{ {
// Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"} // Get the satellite system {"G", "R", "S", "E", "C"}
return satelliteSystem.at(system); return satelliteSystem.at(system);
} }
@ -479,6 +480,7 @@ void Gnss_Satellite::set_block(std::string system_, unsigned int PRN_ )
break; break;
case 120 : case 120 :
block = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html block = std::string("EGNOS"); // EGNOS AOR-E Broadcast satellite http://www.egnos-pro.esa.int/index.html
break;
case 124 : case 124 :
block = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations block = std::string("EGNOS"); // EGNOS ESA ARTEMIS used for EGNOS Operations
break; break;
@ -498,6 +500,7 @@ void Gnss_Satellite::set_block(std::string system_, unsigned int PRN_ )
break; break;
case 12 : case 12 :
block = std::string("IOV"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, launched the same day block = std::string("IOV"); // Galileo In-Orbit Validation (IOV) satellite FM2 (Flight Model 2) also known as GSAT0102, launched the same day
break;
default: default:
block = std::string("Unknown"); block = std::string("Unknown");
} }

View File

@ -36,6 +36,8 @@
#include <set> #include <set>
#include <iostream> #include <iostream>
#include <map> #include <map>
/* /*
* \brief This class represents a GNSS satellite. * \brief This class represents a GNSS satellite.
* *
@ -50,10 +52,10 @@ public:
~Gnss_Satellite(); //!< Default Destructor. ~Gnss_Satellite(); //!< Default Destructor.
unsigned int get_PRN() const; //!< Gets satellite's PRN unsigned int get_PRN() const; //!< Gets satellite's PRN
std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"} std::string get_system() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
std::string get_system_short() const; //!< Gets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"} std::string get_system_short() const; //!< Gets the satellite system {"G", "R", "SBAS", "E", "C"}
std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"} std::string get_block() const; //!< Gets the satellite block. If GPS, returns {"IIA", "IIR", "IIR-M", "IIF"}
friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); // operator== for comparison friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); // operator<< for pretty printing friend std::ostream& operator<<(std::ostream &, const Gnss_Satellite &); //!< operator<< for pretty printing
//Gnss_Satellite& operator=(const Gnss_Satellite &); //Gnss_Satellite& operator=(const Gnss_Satellite &);
private: private:
unsigned int PRN; unsigned int PRN;

View File

@ -34,24 +34,31 @@ Gnss_Signal::Gnss_Signal()
{ {
this->signal = ""; this->signal = "";
} }
Gnss_Signal::Gnss_Signal(Gnss_Satellite satellite_,std::string signal_) Gnss_Signal::Gnss_Signal(Gnss_Satellite satellite_,std::string signal_)
{ {
this->satellite = satellite_; this->satellite = satellite_;
this->signal = signal_; this->signal = signal_;
} }
Gnss_Signal::~Gnss_Signal() Gnss_Signal::~Gnss_Signal()
{ {}
}
std::string Gnss_Signal::get_signal() const std::string Gnss_Signal::get_signal() const
{ {
return this->signal; return this->signal;
} }
Gnss_Satellite Gnss_Signal::get_satellite() const Gnss_Satellite Gnss_Signal::get_satellite() const
{ {
return this->satellite; return this->satellite;
} }
std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output
{ {
//std::string psystem = sat::get_system() //std::string psystem = sat::get_system()
@ -59,6 +66,7 @@ std::ostream& operator<<(std::ostream &out, const Gnss_Signal &sig) // output
return out; return out;
} }
bool operator== (const Gnss_Signal &sig1, const Gnss_Signal &sig2) bool operator== (const Gnss_Signal &sig1, const Gnss_Signal &sig2)
{ {
bool equal = false; bool equal = false;

View File

@ -41,7 +41,6 @@
*/ */
class Gnss_Signal class Gnss_Signal
{ {
private: private:
Gnss_Satellite satellite; Gnss_Satellite satellite;
std::string signal; std::string signal;
@ -53,7 +52,6 @@ public:
Gnss_Satellite get_satellite() const; Gnss_Satellite get_satellite() const;
friend bool operator== (const Gnss_Signal &, const Gnss_Signal &); // operator== for comparison friend bool operator== (const Gnss_Signal &, const Gnss_Signal &); // operator== for comparison
friend std::ostream& operator<<(std::ostream &, const Gnss_Signal &); // operator<< for pretty printing friend std::ostream& operator<<(std::ostream &, const Gnss_Signal &); // operator<< for pretty printing
}; };
#endif #endif

View File

@ -33,9 +33,6 @@
Gnss_Synchro::Gnss_Synchro() Gnss_Synchro::Gnss_Synchro()
{ {
// Satellite and signal info
//System=" ";
//Signal=" ";
PRN = 0; PRN = 0;
// Acquisition // Acquisition
Acq_delay_samples = 0.0; Acq_delay_samples = 0.0;
@ -65,5 +62,5 @@ Gnss_Synchro::Gnss_Synchro()
} }
Gnss_Synchro::~Gnss_Synchro() Gnss_Synchro::~Gnss_Synchro()
{ {}
}

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gnss_synchro.h * \file gnss_synchro.h
* \brief Implementation of the Gnss_Synchro class * \brief Interface of the Gnss_Synchro class
* \author * \author
* Luis Esteve, 2012. luis(at)epsilon-formacion.com * Luis Esteve, 2012. luis(at)epsilon-formacion.com
* Javier Arribas, 2012. jarribas(at)cttc.es * Javier Arribas, 2012. jarribas(at)cttc.es
@ -33,16 +33,14 @@
#include "gnss_signal.h" #include "gnss_signal.h"
#include <string> /*!
* \brief This is the class that contains the information that flows through the blocks.
class Gnss_Synchro{ */
private: class Gnss_Synchro
{
public: public:
Gnss_Synchro(); Gnss_Synchro();
~Gnss_Synchro(); ~Gnss_Synchro();
//Gnss_Signal Signal;
// Satellite and signal info // Satellite and signal info
char System; char System;
char Signal[3]; char Signal[3];
@ -72,7 +70,7 @@ public:
double Pseudorange_m; double Pseudorange_m;
double Pseudorange_timestamp_ms; double Pseudorange_timestamp_ms;
bool Flag_valid_pseudorange; bool Flag_valid_pseudorange;
}; };
#endif #endif