mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 20:20:35 +00:00
RINEX printer now takes objects by reference instead of by value. Adding
some const.
This commit is contained in:
parent
60fea64b5e
commit
14ddc478a0
@ -219,7 +219,7 @@ Rinex_Printer::~Rinex_Printer()
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::lengthCheck(std::string line)
|
||||
void Rinex_Printer::lengthCheck(const std::string& line)
|
||||
{
|
||||
if (line.length() != 80)
|
||||
{
|
||||
@ -391,7 +391,7 @@ std::string Rinex_Printer::getLocalTime()
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac)
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
@ -501,7 +501,7 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Gal
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model)
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model)
|
||||
{
|
||||
|
||||
std::string line;
|
||||
@ -680,7 +680,7 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, Gps_Iono gps_iono, Gps_Utc_Model gps_utc_model, Galileo_Iono galileo_iono, Galileo_Utc_Model galileo_utc_model, Galileo_Almanac galileo_almanac)
|
||||
void Rinex_Printer::rinex_nav_header(std::ofstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac)
|
||||
{
|
||||
std::string line;
|
||||
stringVersion = "3.02";
|
||||
@ -922,12 +922,10 @@ void Rinex_Printer::rinex_sbs_header(std::ofstream& out)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris> eph_map)
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, const std::map<int,Gps_Ephemeris>& eph_map)
|
||||
{
|
||||
std::string line;
|
||||
std::map<int,Gps_Ephemeris>::iterator gps_ephemeris_iter;
|
||||
std::map<int,Gps_Ephemeris>::const_iterator gps_ephemeris_iter;
|
||||
|
||||
for(gps_ephemeris_iter = eph_map.begin();
|
||||
gps_ephemeris_iter != eph_map.end();
|
||||
@ -1182,7 +1180,7 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris
|
||||
line += std::string(1, ' ');
|
||||
double curve_fit_interval = 4;
|
||||
|
||||
if (gps_ephemeris_iter->second.satelliteBlock[gps_ephemeris_iter->second.i_satellite_PRN].compare("IIA"))
|
||||
if (gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIA"))
|
||||
{
|
||||
// Block II/IIA (Table 20-XI IS-GPS-200E )
|
||||
if ( (gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248) ) curve_fit_interval = 8;
|
||||
@ -1193,10 +1191,10 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris
|
||||
if ( gps_ephemeris_iter->second.d_IODC == 757 ) curve_fit_interval = 98;
|
||||
}
|
||||
|
||||
if ((gps_ephemeris_iter->second.satelliteBlock[gps_ephemeris_iter->second.i_satellite_PRN].compare("IIR") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock[gps_ephemeris_iter->second.i_satellite_PRN].compare("IIR-M") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock[gps_ephemeris_iter->second.i_satellite_PRN].compare("IIF") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock[gps_ephemeris_iter->second.i_satellite_PRN].compare("IIIA") == 0) )
|
||||
if ((gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIR-M") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIF") == 0) ||
|
||||
(gps_ephemeris_iter->second.satelliteBlock.at(gps_ephemeris_iter->second.i_satellite_PRN).compare("IIIA") == 0) )
|
||||
{
|
||||
// Block IIR/IIR-M/IIF/IIIA (Table 20-XII IS-GPS-200E )
|
||||
if ( (gps_ephemeris_iter->second.d_IODC > 239) && (gps_ephemeris_iter->second.d_IODC < 248)) curve_fit_interval = 8;
|
||||
@ -1219,11 +1217,10 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephemeris> eph_map)
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, const std::map<int, Galileo_Ephemeris>& eph_map)
|
||||
{
|
||||
std::string line;
|
||||
std::map<int,Galileo_Ephemeris>::iterator galileo_ephemeris_iter;
|
||||
std::map<int,Galileo_Ephemeris>::const_iterator galileo_ephemeris_iter;
|
||||
line.clear();
|
||||
for(galileo_ephemeris_iter = eph_map.begin();
|
||||
galileo_ephemeris_iter != eph_map.end();
|
||||
@ -1399,7 +1396,7 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephe
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Gps_Ephemeris> gps_eph_map, std::map<int, Galileo_Ephemeris> galileo_eph_map)
|
||||
void Rinex_Printer::log_rinex_nav(std::ofstream& out, const std::map<int, Gps_Ephemeris>& gps_eph_map, const std::map<int, Galileo_Ephemeris>& galileo_eph_map)
|
||||
{
|
||||
version = 3;
|
||||
stringVersion = "3.02";
|
||||
@ -1408,7 +1405,7 @@ void Rinex_Printer::log_rinex_nav(std::ofstream& out, std::map<int, Gps_Ephemeri
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation)
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, const Gps_Ephemeris& eph, const double d_TOW_first_observation)
|
||||
{
|
||||
|
||||
std::string line;
|
||||
@ -1639,7 +1636,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
||||
// -------- TIME OF FIRST OBS
|
||||
line.clear();
|
||||
boost::posix_time::ptime p_gps_time = Rinex_Printer::compute_GPS_time(eph,d_TOW_first_observation);
|
||||
std::string timestring=boost::posix_time::to_iso_string(p_gps_time);
|
||||
std::string timestring = boost::posix_time::to_iso_string(p_gps_time);
|
||||
std::string year (timestring, 0, 4);
|
||||
std::string month (timestring, 4, 2);
|
||||
std::string day (timestring, 6, 2);
|
||||
@ -1671,7 +1668,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, doub
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Galileo_Ephemeris eph, double d_TOW_first_observation)
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation)
|
||||
{
|
||||
std::string line;
|
||||
version = 3;
|
||||
@ -1873,7 +1870,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Galileo_Ephemeris eph,
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris gps_eph, Galileo_Ephemeris galileo_eph, double d_TOW_first_observation)
|
||||
void Rinex_Printer::rinex_obs_header(std::ofstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation)
|
||||
{
|
||||
std::string line;
|
||||
version = 3;
|
||||
@ -2101,7 +2098,7 @@ void Rinex_Printer::rinex_obs_header(std::ofstream& out, Gps_Ephemeris gps_eph,
|
||||
out << line << std::endl;
|
||||
}
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, const Gps_Ephemeris& eph, const double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
|
||||
{
|
||||
// RINEX observations timestamps are GPS timestamps.
|
||||
std::string line;
|
||||
@ -2154,7 +2151,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
||||
line += std::string(1, '0');
|
||||
//Number of satellites observed in current epoch
|
||||
int numSatellitesObserved = 0;
|
||||
std::map<int,Gnss_Synchro>::iterator pseudoranges_iter;
|
||||
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
|
||||
for(pseudoranges_iter = pseudoranges.begin();
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
@ -2239,7 +2236,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
||||
|
||||
//Number of satellites observed in current epoch
|
||||
int numSatellitesObserved = 0;
|
||||
std::map<int,Gnss_Synchro>::iterator pseudoranges_iter;
|
||||
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
|
||||
for(pseudoranges_iter = pseudoranges.begin();
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
@ -2296,7 +2293,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
|
||||
{
|
||||
// RINEX observations timestamps are Galileo timestamps.
|
||||
// See http://gage14.upc.es/gLAB/HTML/Observation_Rinex_v3.01.html
|
||||
@ -2341,7 +2338,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, dou
|
||||
|
||||
//Number of satellites observed in current epoch
|
||||
int numSatellitesObserved = 0;
|
||||
std::map<int,Gnss_Synchro>::iterator pseudoranges_iter;
|
||||
std::map<int, Gnss_Synchro>::const_iterator pseudoranges_iter;
|
||||
for(pseudoranges_iter = pseudoranges.begin();
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
@ -2391,7 +2388,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, dou
|
||||
}
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris gps_eph, Galileo_Ephemeris galileo_eph, double gps_obs_time, std::map<int,Gnss_Synchro> pseudoranges)
|
||||
void Rinex_Printer::log_rinex_obs(std::ofstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, double gps_obs_time, const std::map<int,Gnss_Synchro>& pseudoranges)
|
||||
{
|
||||
std::string line;
|
||||
|
||||
@ -2433,7 +2430,7 @@ void Rinex_Printer::log_rinex_obs(std::ofstream& out, Gps_Ephemeris gps_eph, Gal
|
||||
|
||||
//Number of satellites observed in current epoch
|
||||
int numSatellitesObserved = 0;
|
||||
std::map<int,Gnss_Synchro>::iterator pseudoranges_iter;
|
||||
std::map<int,Gnss_Synchro>::const_iterator pseudoranges_iter;
|
||||
for(pseudoranges_iter = pseudoranges.begin();
|
||||
pseudoranges_iter != pseudoranges.end();
|
||||
pseudoranges_iter++)
|
||||
@ -2562,7 +2559,7 @@ void Rinex_Printer::to_date_time(int gps_week, int gps_tow, int &year, int &mont
|
||||
|
||||
|
||||
|
||||
void Rinex_Printer::log_rinex_sbs(std::ofstream& out, Sbas_Raw_Msg sbs_message)
|
||||
void Rinex_Printer::log_rinex_sbs(std::ofstream& out, const Sbas_Raw_Msg& sbs_message)
|
||||
{
|
||||
// line 1: PRN / EPOCH / RCVR
|
||||
std::stringstream line1;
|
||||
@ -2645,7 +2642,7 @@ void Rinex_Printer::log_rinex_sbs(std::ofstream& out, Sbas_Raw_Msg sbs_message)
|
||||
}
|
||||
|
||||
|
||||
int Rinex_Printer::signalStrength(double snr)
|
||||
int Rinex_Printer::signalStrength(const double snr)
|
||||
{
|
||||
int ss;
|
||||
ss = int ( std::min( std::max( int (floor(snr/6)) , 1), 9) );
|
||||
@ -2653,31 +2650,31 @@ int Rinex_Printer::signalStrength(double snr)
|
||||
}
|
||||
|
||||
|
||||
boost::posix_time::ptime Rinex_Printer::compute_UTC_time(Gps_Navigation_Message nav_msg)
|
||||
boost::posix_time::ptime Rinex_Printer::compute_UTC_time(const Gps_Navigation_Message& nav_msg)
|
||||
{
|
||||
// if we are processing a file -> wait to leap second to resolve the ambiguity else take the week from the local system time
|
||||
//: idea resolve the ambiguity with the leap second http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm
|
||||
double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
|
||||
const double utc_t = nav_msg.utc_time(nav_msg.d_TOW);
|
||||
boost::posix_time::time_duration t = boost::posix_time::millisec((utc_t + 604800 * static_cast<double>(nav_msg.i_GPS_week)) * 1000);
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
|
||||
return p_time;
|
||||
}
|
||||
|
||||
|
||||
boost::posix_time::ptime Rinex_Printer::compute_GPS_time(Gps_Ephemeris eph, double obs_time)
|
||||
boost::posix_time::ptime Rinex_Printer::compute_GPS_time(const Gps_Ephemeris& eph, const double obs_time)
|
||||
{
|
||||
// The RINEX v2.11 v3.00 format uses GPS time for the observations epoch, not UTC time, thus, no leap seconds needed here.
|
||||
// (see Section 3 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex211.txt)
|
||||
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex300.pdf)
|
||||
// --??? No time correction here, since it will be done in the RINEX processor
|
||||
double gps_t = obs_time;
|
||||
const double gps_t = obs_time;
|
||||
boost::posix_time::time_duration t = boost::posix_time::millisec((gps_t + 604800 * static_cast<double>(eph.i_GPS_week % 1024)) * 1000);
|
||||
boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
|
||||
return p_time;
|
||||
}
|
||||
|
||||
|
||||
boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(Galileo_Ephemeris eph, double obs_time)
|
||||
boost::posix_time::ptime Rinex_Printer::compute_Galileo_time(const Galileo_Ephemeris& eph, const double obs_time)
|
||||
{
|
||||
// The RINEX v2.11 v3.00 format uses Galileo time for the observations epoch, not UTC time, thus, no leap seconds needed here.
|
||||
// (see Pag. 17 in http://igscb.jpl.nasa.gov/igscb/data/format/rinex301.pdf)
|
||||
|
@ -93,32 +93,32 @@ public:
|
||||
/*!
|
||||
* \brief Generates the GPS Navigation Data header
|
||||
*/
|
||||
void rinex_nav_header(std::ofstream& out, Gps_Iono iono, Gps_Utc_Model utc_model);
|
||||
void rinex_nav_header(std::ofstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model);
|
||||
|
||||
/*!
|
||||
* \brief Generates the Galileo Navigation Data header
|
||||
*/
|
||||
void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac);
|
||||
void rinex_nav_header(std::ofstream& out, const Galileo_Iono& iono, const Galileo_Utc_Model& utc_model, const Galileo_Almanac& galileo_almanac);
|
||||
|
||||
/*!
|
||||
* \brief Generates the Mixed (GPS/Galileo) Navigation Data header
|
||||
*/
|
||||
void rinex_nav_header(std::ofstream& out, Gps_Iono gps_iono, Gps_Utc_Model gps_utc_model, Galileo_Iono galileo_iono, Galileo_Utc_Model galileo_utc_model, Galileo_Almanac galileo_almanac);
|
||||
void rinex_nav_header(std::ofstream& out, const Gps_Iono& gps_iono, const Gps_Utc_Model& gps_utc_model, const Galileo_Iono& galileo_iono, const Galileo_Utc_Model& galileo_utc_model, const Galileo_Almanac& galileo_almanac);
|
||||
|
||||
/*!
|
||||
* \brief Generates the GPS Observation data header
|
||||
*/
|
||||
void rinex_obs_header(std::ofstream& out, Gps_Ephemeris eph, double d_TOW_first_observation);
|
||||
void rinex_obs_header(std::ofstream& out, const Gps_Ephemeris& eph, const double d_TOW_first_observation);
|
||||
|
||||
/*!
|
||||
* \brief Generates the Galileo Observation data header
|
||||
*/
|
||||
void rinex_obs_header(std::ofstream& out, Galileo_Ephemeris eph, double d_TOW_first_observation);
|
||||
void rinex_obs_header(std::ofstream& out, const Galileo_Ephemeris& eph, const double d_TOW_first_observation);
|
||||
|
||||
/*!
|
||||
* \brief Generates the Mixed (GPS/Galileo) Observation data header
|
||||
*/
|
||||
void rinex_obs_header(std::ofstream& out, Gps_Ephemeris gps_eph, Galileo_Ephemeris galileo_eph, double d_TOW_first_observation);
|
||||
void rinex_obs_header(std::ofstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double d_TOW_first_observation);
|
||||
|
||||
/*!
|
||||
* \brief Generates the SBAS raw data header
|
||||
@ -128,47 +128,47 @@ public:
|
||||
/*!
|
||||
* \brief Computes the UTC time and returns a boost::posix_time::ptime object
|
||||
*/
|
||||
boost::posix_time::ptime compute_UTC_time(Gps_Navigation_Message nav_msg);
|
||||
boost::posix_time::ptime compute_UTC_time(const Gps_Navigation_Message& nav_msg);
|
||||
|
||||
/*!
|
||||
* \brief Computes the GPS time and returns a boost::posix_time::ptime object
|
||||
*/
|
||||
boost::posix_time::ptime compute_GPS_time(Gps_Ephemeris eph, double obs_time);
|
||||
boost::posix_time::ptime compute_GPS_time(const Gps_Ephemeris& eph, const double obs_time);
|
||||
|
||||
/*!
|
||||
* \brief Computes the Galileo time and returns a boost::posix_time::ptime object
|
||||
*/
|
||||
boost::posix_time::ptime compute_Galileo_time(Galileo_Ephemeris eph, double obs_time);
|
||||
boost::posix_time::ptime compute_Galileo_time(const Galileo_Ephemeris& eph, const double obs_time);
|
||||
|
||||
/*!
|
||||
* \brief Writes data from the GPS navigation message into the RINEX file
|
||||
*/
|
||||
void log_rinex_nav(std::ofstream& out, std::map<int,Gps_Ephemeris> eph_map);
|
||||
void log_rinex_nav(std::ofstream& out, const std::map<int, Gps_Ephemeris>& eph_map);
|
||||
|
||||
/*!
|
||||
* \brief Writes data from the Galileo navigation message into the RINEX file
|
||||
*/
|
||||
void log_rinex_nav(std::ofstream& out, std::map<int, Galileo_Ephemeris> eph_map);
|
||||
void log_rinex_nav(std::ofstream& out, const std::map<int, Galileo_Ephemeris>& eph_map);
|
||||
|
||||
/*!
|
||||
* \brief Writes data from the Mixed (GPS/Galileo) navigation message into the RINEX file
|
||||
*/
|
||||
void log_rinex_nav(std::ofstream& out, std::map<int, Gps_Ephemeris> gps_eph_map, std::map<int, Galileo_Ephemeris> galileo_eph_map);
|
||||
void log_rinex_nav(std::ofstream& out, const std::map<int, Gps_Ephemeris>& gps_eph_map, const std::map<int, Galileo_Ephemeris>& galileo_eph_map);
|
||||
|
||||
/*!
|
||||
* \brief Writes GPS observables into the RINEX file
|
||||
*/
|
||||
void log_rinex_obs(std::ofstream& out, Gps_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
||||
void log_rinex_obs(std::ofstream& out, const Gps_Ephemeris& eph, double obs_time, const std::map<int, Gnss_Synchro>& pseudoranges);
|
||||
|
||||
/*!
|
||||
* \brief Writes Galileo observables into the RINEX file
|
||||
*/
|
||||
void log_rinex_obs(std::ofstream& out, Galileo_Ephemeris eph, double obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
||||
void log_rinex_obs(std::ofstream& out, const Galileo_Ephemeris& eph, double obs_time, const std::map<int, Gnss_Synchro>& pseudoranges);
|
||||
|
||||
/*!
|
||||
* \brief Writes Galileo observables into the RINEX file
|
||||
*/
|
||||
void log_rinex_obs(std::ofstream& out, Gps_Ephemeris gps_eph, Galileo_Ephemeris galileo_eph, double gps_obs_time, std::map<int,Gnss_Synchro> pseudoranges);
|
||||
void log_rinex_obs(std::ofstream& out, const Gps_Ephemeris& gps_eph, const Galileo_Ephemeris& galileo_eph, const double gps_obs_time, const std::map<int, Gnss_Synchro>& pseudoranges);
|
||||
|
||||
/*!
|
||||
* \brief Represents GPS time in the date time format. Leap years are considered, but leap seconds are not.
|
||||
@ -178,12 +178,12 @@ public:
|
||||
/*!
|
||||
* \brief Writes raw SBAS messages into the RINEX file
|
||||
*/
|
||||
void log_rinex_sbs(std::ofstream& out, Sbas_Raw_Msg sbs_message);
|
||||
void log_rinex_sbs(std::ofstream& out, const Sbas_Raw_Msg& sbs_message);
|
||||
|
||||
std::map<std::string,std::string> satelliteSystem; //<! GPS, GLONASS, SBAS payload, Galileo or Compass
|
||||
std::map<std::string,std::string> observationType; //<! PSEUDORANGE, CARRIER_PHASE, DOPPLER, SIGNAL_STRENGTH
|
||||
std::map<std::string,std::string> observationCode; //<! GNSS observation descriptors
|
||||
std::string stringVersion; //<! RINEX version (2.10/2.11 or 3.01)
|
||||
std::string stringVersion; //<! RINEX version (2.10/2.11 or 3.01/3.02)
|
||||
|
||||
private:
|
||||
int version ; // RINEX version (2 for 2.10/2.11 and 3 for 3.01)
|
||||
@ -191,7 +191,7 @@ private:
|
||||
/*
|
||||
* Generation of RINEX signal strength indicators
|
||||
*/
|
||||
int signalStrength(double snr);
|
||||
int signalStrength(const double snr);
|
||||
|
||||
/* Creates RINEX file names according to the naming convention
|
||||
*
|
||||
@ -225,7 +225,7 @@ private:
|
||||
/*
|
||||
* Checks that the line is 80 characters length
|
||||
*/
|
||||
void lengthCheck(std::string line);
|
||||
void lengthCheck(const std::string& line);
|
||||
|
||||
/*
|
||||
* If the string is bigger than length, truncate it from the right.
|
||||
|
@ -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
|
||||
@ -16,7 +16,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -40,7 +40,7 @@ StringConverter::StringConverter()
|
||||
StringConverter::~StringConverter()
|
||||
{}
|
||||
|
||||
bool StringConverter::convert(std::string value, bool default_value)
|
||||
bool StringConverter::convert(const std::string& value, bool default_value)
|
||||
{
|
||||
if(value.compare("true") == 0)
|
||||
{
|
||||
@ -57,7 +57,7 @@ bool StringConverter::convert(std::string value, bool default_value)
|
||||
}
|
||||
|
||||
|
||||
long StringConverter::convert(std::string value, long default_value)
|
||||
long StringConverter::convert(const std::string& value, long default_value)
|
||||
{
|
||||
std::stringstream stream(value);
|
||||
|
||||
@ -75,7 +75,7 @@ long StringConverter::convert(std::string value, long default_value)
|
||||
}
|
||||
|
||||
|
||||
int StringConverter::convert(std::string value, int default_value)
|
||||
int StringConverter::convert(const std::string& value, int default_value)
|
||||
{
|
||||
|
||||
std::stringstream stream(value);
|
||||
@ -95,7 +95,7 @@ int StringConverter::convert(std::string value, int default_value)
|
||||
|
||||
|
||||
|
||||
unsigned int StringConverter::convert(std::string value, unsigned int default_value)
|
||||
unsigned int StringConverter::convert(const std::string& value, unsigned int default_value)
|
||||
{
|
||||
std::stringstream stream(value);
|
||||
|
||||
@ -115,7 +115,7 @@ unsigned int StringConverter::convert(std::string value, unsigned int default_va
|
||||
|
||||
|
||||
|
||||
float StringConverter::convert(std::string value, float default_value)
|
||||
float StringConverter::convert(const std::string& value, float default_value)
|
||||
{
|
||||
|
||||
std::stringstream stream(value);
|
||||
@ -136,7 +136,7 @@ float StringConverter::convert(std::string value, float default_value)
|
||||
|
||||
|
||||
|
||||
double StringConverter::convert(std::string value, double default_value)
|
||||
double StringConverter::convert(const std::string& value, double default_value)
|
||||
{
|
||||
|
||||
std::stringstream stream(value);
|
||||
|
@ -6,7 +6,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2013 (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
|
||||
@ -16,7 +16,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -45,12 +45,12 @@ public:
|
||||
StringConverter();
|
||||
virtual ~StringConverter();
|
||||
|
||||
bool convert(std::string value, bool default_value);
|
||||
long convert(std::string value, long default_value);
|
||||
int convert(std::string value, int default_value);
|
||||
unsigned int convert(std::string value, unsigned int default_value);
|
||||
float convert(std::string value, float default_value);
|
||||
double convert(std::string value, double default_value);
|
||||
bool convert(const std::string& value, bool default_value);
|
||||
long convert(const std::string& value, long default_value);
|
||||
int convert(const std::string& value, int default_value);
|
||||
unsigned int convert(const std::string& value, unsigned int default_value);
|
||||
float convert(const std::string& value, float default_value);
|
||||
double convert(const std::string& value, double default_value);
|
||||
};
|
||||
|
||||
#endif /*GNSS_SDR_STRING_CONVERTER_H_*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2013 (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
|
||||
@ -15,7 +15,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -41,7 +41,7 @@ Gnss_Satellite::Gnss_Satellite()
|
||||
|
||||
|
||||
|
||||
Gnss_Satellite::Gnss_Satellite(std::string system_, unsigned int PRN_)
|
||||
Gnss_Satellite::Gnss_Satellite(const std::string& system_, unsigned int PRN_)
|
||||
{
|
||||
Gnss_Satellite::reset();
|
||||
Gnss_Satellite::set_system(system_);
|
||||
@ -61,12 +61,12 @@ Gnss_Satellite::~Gnss_Satellite()
|
||||
|
||||
void Gnss_Satellite::reset()
|
||||
{
|
||||
system_set = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
|
||||
system_set = {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"};
|
||||
satelliteSystem["GPS"] = "G";
|
||||
satelliteSystem["GLONASS"] = "R";
|
||||
satelliteSystem["SBAS"] = "S";
|
||||
satelliteSystem["Galileo"] = "E";
|
||||
satelliteSystem["Compass"] = "C";
|
||||
satelliteSystem["Beidou"] = "C";
|
||||
PRN = 0;
|
||||
system = std::string("");
|
||||
block = std::string("");
|
||||
@ -115,7 +115,7 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite &rhs) {
|
||||
}*/
|
||||
|
||||
|
||||
void Gnss_Satellite::set_system(std::string system_)
|
||||
void Gnss_Satellite::set_system(const std::string& system_)
|
||||
{
|
||||
// Set the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
|
||||
std::set<std::string>::iterator it = system_set.find(system_);
|
||||
@ -126,7 +126,7 @@ void Gnss_Satellite::set_system(std::string system_)
|
||||
}
|
||||
else
|
||||
{
|
||||
DLOG(INFO) << "System " << system_ << " is not defined {GPS, GLONASS, SBAS, Galileo, Compass}. Initialization?";
|
||||
DLOG(INFO) << "System " << system_ << " is not defined {GPS, GLONASS, SBAS, Galileo, Beidou}. Initialization?";
|
||||
system = std::string("");
|
||||
}
|
||||
}
|
||||
@ -217,7 +217,7 @@ unsigned int Gnss_Satellite::get_PRN() const
|
||||
|
||||
std::string Gnss_Satellite::get_system() const
|
||||
{
|
||||
// Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
|
||||
// Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}
|
||||
std::string system_;
|
||||
system_ = system;
|
||||
return system_;
|
||||
@ -246,7 +246,7 @@ std::string Gnss_Satellite::get_block() const
|
||||
|
||||
|
||||
|
||||
void Gnss_Satellite::set_block(std::string system_, unsigned int PRN_ )
|
||||
void Gnss_Satellite::set_block(const std::string& system_, unsigned int PRN_ )
|
||||
{
|
||||
if (system_.compare("GPS") == 0)
|
||||
{
|
||||
|
@ -5,7 +5,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
|
||||
@ -15,7 +15,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -48,10 +48,10 @@ class Gnss_Satellite
|
||||
{
|
||||
public:
|
||||
Gnss_Satellite(); //!< Default Constructor.
|
||||
Gnss_Satellite(std::string system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor.
|
||||
Gnss_Satellite(const std::string& system_, unsigned int PRN_); //!< Concrete GNSS satellite Constructor.
|
||||
~Gnss_Satellite(); //!< Default Destructor.
|
||||
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", "Beidou"}
|
||||
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"}
|
||||
friend bool operator== (const Gnss_Satellite &, const Gnss_Satellite &); //!< operator== for comparison
|
||||
@ -63,9 +63,9 @@ private:
|
||||
std::map<std::string,std::string> satelliteSystem;
|
||||
std::string block;
|
||||
signed int rf_link;
|
||||
void set_system(std::string system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}.
|
||||
void set_system(const std::string& system); // Sets the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Beidou"}.
|
||||
void set_PRN(unsigned int PRN); // Sets satellite's PRN
|
||||
void set_block(std::string system_, unsigned int PRN_ );
|
||||
void set_block(const std::string& system_, unsigned int PRN_ );
|
||||
std::set<std::string> system_set; // = {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"};
|
||||
void reset();
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Javier Arribas, 2012. jarribas(at)cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* 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
|
||||
@ -16,7 +16,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -28,6 +28,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gnss_signal.h"
|
||||
|
||||
Gnss_Signal::Gnss_Signal()
|
||||
@ -36,7 +37,7 @@ Gnss_Signal::Gnss_Signal()
|
||||
}
|
||||
|
||||
|
||||
Gnss_Signal::Gnss_Signal(Gnss_Satellite satellite_,std::string signal_)
|
||||
Gnss_Signal::Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_)
|
||||
{
|
||||
this->satellite = satellite_;
|
||||
this->signal = signal_;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Javier Arribas, 2012. jarribas(at)cttc.es
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* 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
|
||||
@ -16,7 +16,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -47,7 +47,7 @@ private:
|
||||
std::string signal;
|
||||
public:
|
||||
Gnss_Signal();
|
||||
Gnss_Signal(Gnss_Satellite satellite_, std::string signal_);
|
||||
Gnss_Signal(const Gnss_Satellite& satellite_, const std::string& signal_);
|
||||
~Gnss_Signal();
|
||||
std::string get_signal() const; //!< Get the satellite system {"GPS", "GLONASS", "SBAS", "Galileo", "Compass"}
|
||||
Gnss_Satellite get_satellite() const; //!< Get the Gnss_Satellite associated to the signal
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2013 (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
|
||||
@ -17,7 +17,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -666,7 +666,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
|
||||
|
||||
|
||||
|
||||
double Gps_Navigation_Message::utc_time(double gpstime_corrected)
|
||||
double Gps_Navigation_Message::utc_time(const double gpstime_corrected) const
|
||||
{
|
||||
double t_utc;
|
||||
double t_utc_daytime;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -231,7 +231,7 @@ public:
|
||||
* \brief Computes the Coordinated Universal Time (UTC) and
|
||||
* returns it in [s] (IS-GPS-200E, 20.3.3.5.2.4)
|
||||
*/
|
||||
double utc_time(double gpstime_corrected);
|
||||
double utc_time(const double gpstime_corrected) const;
|
||||
|
||||
bool satellite_validation();
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* at your option) any later version.
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -64,14 +64,14 @@ public:
|
||||
{
|
||||
rx_time.relate(time_relation);
|
||||
}
|
||||
Sbas_Time get_rx_time_obj(){ return rx_time; }
|
||||
int get_prn() { return i_prn; }
|
||||
Sbas_Time get_rx_time_obj() const { return rx_time; }
|
||||
int get_prn() const { return i_prn; }
|
||||
std::vector<unsigned char> get_msg() const { return d_msg; }
|
||||
int get_preamble()
|
||||
{
|
||||
return d_msg[0];
|
||||
}
|
||||
int get_msg_type()
|
||||
int get_msg_type() const
|
||||
{
|
||||
return d_msg[1] >> 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user