1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2019-09-18 12:03:25 +02:00
commit 969fabfde3

View File

@ -727,6 +727,9 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16);
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
if (gps_utc_model.i_WN_T == 0) if (gps_utc_model.i_WN_T == 0)
@ -749,6 +752,18 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
} }
}
else
{
if (gps_utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 5); // valid from 2009 to 2019
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
}
}
line += std::string(10, ' '); line += std::string(10, ' ');
line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
Rinex_Printer::lengthCheck(line); Rinex_Printer::lengthCheck(line);
@ -1488,6 +1503,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
if (utc_model.i_WN_T == 0) if (utc_model.i_WN_T == 0)
@ -1510,6 +1527,18 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019 line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019
} }
} }
}
else
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 9); // valid from 2019 to 2029
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019
}
}
line += std::string(1, ' '); line += std::string(1, ' ');
line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); line += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20);
} }
@ -1520,6 +1549,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16);
line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); line += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
if (utc_model.i_WN_T == 0) if (utc_model.i_WN_T == 0)
@ -1542,6 +1573,18 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& iono, co
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
} }
}
else
{
if (utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 5); // valid from 2009 to 2019
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
}
}
/* if ( SBAS ) /* if ( SBAS )
{ {
line += string(1, ' '); line += string(1, ' ');
@ -1690,6 +1733,8 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18);
line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16);
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
if (gps_utc_model.i_WN_T == 0) if (gps_utc_model.i_WN_T == 0)
@ -1712,6 +1757,18 @@ void Rinex_Printer::rinex_nav_header(std::fstream& out, const Gps_Iono& gps_iono
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
} }
}
else
{
if (gps_utc_model.i_WN_T == 0)
{
line += Rinex_Printer::rightJustify(std::to_string(eph.i_GPS_week + 1024), 5); // valid from 2009 to 2019
}
else
{
line += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
}
}
line += std::string(10, ' '); line += std::string(10, ' ');
line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
Rinex_Printer::lengthCheck(line); Rinex_Printer::lengthCheck(line);
@ -2718,6 +2775,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 18, 2), 19);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 18, 2), 19);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 9);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 9); // valid from 2019 to 2029 line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 9); // valid from 2019 to 2029
@ -2726,6 +2785,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019 line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 9); // valid from 2009 to 2019
} }
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256), 9);
}
line_aux += std::string(1, ' '); line_aux += std::string(1, ' ');
line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20); line_aux += Rinex_Printer::leftJustify("DELTA-UTC: A0,A1,T,W", 20);
data.push_back(line_aux); data.push_back(line_aux);
@ -2780,6 +2844,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A0, 16, 2), 18);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.d_A1, 15, 2), 16);
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7); line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029 line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029
@ -2788,6 +2854,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Utc_Model& ut
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 1999 to 2008
}
line_aux += std::string(10, ' '); line_aux += std::string(10, ' ');
line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
data.push_back(line_aux); data.push_back(line_aux);
@ -3120,6 +3191,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16);
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029 line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029
@ -3128,6 +3201,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 1999 to 2008
}
line_aux += std::string(10, ' '); line_aux += std::string(10, ' ');
line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
data.push_back(line_aux); data.push_back(line_aux);
@ -3235,6 +3313,8 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A0, 16, 2), 18);
line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16); line_aux += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(gps_utc_model.d_A1, 15, 2), 16);
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7); line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.d_t_OT), 7);
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (eph.i_GPS_week < 512) if (eph.i_GPS_week < 512)
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029 line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 2048), 5); // valid from 2019 to 2029
@ -3243,6 +3323,11 @@ void Rinex_Printer::update_nav_header(std::fstream& out, const Gps_Iono& gps_ion
{ {
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019 line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256 + 1024), 5); // valid from 2009 to 2019
} }
}
else
{
line_aux += Rinex_Printer::rightJustify(std::to_string(gps_utc_model.i_WN_T + (eph.i_GPS_week / 256) * 256), 5);
}
line_aux += std::string(10, ' '); line_aux += std::string(10, ' ');
line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); line_aux += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20);
data.push_back(line_aux); data.push_back(line_aux);
@ -3851,6 +3936,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
line += Rinex_Printer::doub2for(static_cast<double>(gps_ephemeris_iter->second.i_code_on_L2), 18, 2); line += Rinex_Printer::doub2for(static_cast<double>(gps_ephemeris_iter->second.i_code_on_L2), 18, 2);
line += std::string(1, ' '); line += std::string(1, ' ');
double GPS_week_continuous_number; double GPS_week_continuous_number;
if (custom_year_ == 0 or custom_year_ >= 2009)
{
if (gps_ephemeris_iter->second.i_GPS_week < 512) if (gps_ephemeris_iter->second.i_GPS_week < 512)
{ {
GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 2048); // valid until 2029 GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 2048); // valid until 2029
@ -3859,6 +3946,11 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::map<int32_t, Gps
{ {
GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm)
} }
}
else
{
GPS_week_continuous_number = static_cast<double>(gps_ephemeris_iter->second.i_GPS_week + 1024);
}
// This week goes with Toe. This is different from the GPS week in the original satellite message! // This week goes with Toe. This is different from the GPS week in the original satellite message!
if (gps_ephemeris_iter->second.d_Toe < 7200.0) if (gps_ephemeris_iter->second.d_Toe < 7200.0)
{ {