diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 51d1bad0c..7dcfc704e 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -187,6 +187,7 @@ Rinex_Printer::Rinex_Printer(int conf_version) } numberTypesObservations = 4; // Number of available types of observable in the system + fake_cnav_iode = 1; } @@ -1897,9 +1898,17 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_Toe1 == gps_ephemeris_iter->second.d_Toe2) && (gps_ephemeris_iter->second.d_Toe1 == gps_ephemeris_iter->second.d_Toc)) ) // Toe1: Toe in message type 10, Toe2: Toe in message type 11 + { + // Toe1: Toe in message type 10, Toe2: Toe in message type 11, + fake_cnav_iode = fake_cnav_iode + 1; + if(fake_cnav_iode == 240) fake_cnav_iode = 1; + } + + line += Rinex_Printer::doub2for(fake_cnav_iode, 18, 2); line += std::string(1, ' '); line += Rinex_Printer::doub2for(gps_ephemeris_iter->second.d_Crs, 18, 2); line += std::string(1, ' '); @@ -1962,6 +1971,7 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_IDOT, 18, 2); line += std::string(1, ' '); // No data flag for L2 P code + double my_zero = 0.0; line += Rinex_Printer::doub2for(my_zero, 18, 2); line += std::string(1, ' '); double GPS_week_continuous_number = static_cast(gps_ephemeris_iter->second.i_GPS_week + 1024); // valid until April 7, 2019 (check http://www.colorado.edu/geography/gcraft/notes/gps/gpseow.htm) @@ -1981,8 +1991,8 @@ void Rinex_Printer::log_rinex_nav(std::fstream& out, const std::mapsecond.d_TGD, 18, 2); line += std::string(1, ' '); - // no IODC in CNAV, so we set it to zero - line += Rinex_Printer::doub2for(my_zero, 18, 2); + // no IODC in CNAV, so we fake it (see above) + line += Rinex_Printer::doub2for(fake_cnav_iode, 18, 2); Rinex_Printer::lengthCheck(line); out << line << std::endl; diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 0d1dc940e..3ad44d26b 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -277,6 +277,8 @@ private: */ void lengthCheck(const std::string & line); + double fake_cnav_iode; + /* * If the string is bigger than length, truncate it from the right. * otherwise, add pad characters to its right.