From 358f29f3052444d7ac30530706b097597c9c382a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 3 Sep 2014 07:58:57 +0200 Subject: [PATCH] Some fixes in the RINEX 3.01 printer --- .../PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc | 4 ++-- src/algorithms/PVT/libs/rinex_printer.cc | 23 +++++++++---------- src/algorithms/PVT/libs/rinex_printer.h | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc index d7fa8e706..4162e6876 100644 --- a/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc +++ b/src/algorithms/PVT/gnuradio_blocks/galileo_e1_pvt_cc.cc @@ -166,7 +166,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it if (global_galileo_almanac_map.size() > 0) { - // Almanac data is shared for all the Galileo satellites. Read always at ID=0 + // Almanac data global_galileo_almanac_map.read(0, d_ls_pvt->galileo_almanac); } // ############ 2 COMPUTE THE PVT ################################ @@ -192,7 +192,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) { rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time); - rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model); + rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac); b_rinex_header_writen = true; // do not write header anymore } } diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc index 189267b7d..8b1a37eb1 100644 --- a/src/algorithms/PVT/libs/rinex_printer.cc +++ b/src/algorithms/PVT/libs/rinex_printer.cc @@ -356,9 +356,8 @@ std::string Rinex_Printer::getLocalTime() } -void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model) +void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac) { - std::string line; stringVersion = "3.01"; version = 3; @@ -435,25 +434,25 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Gali out << line << std::endl; // -------- Line system time correction 2 - /* line.clear(); + line.clear(); line += std::string("GPGA"); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 16, 2), 18); - line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(utc_model.XXX, 15, 2), 16); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.XXX), 7); - line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.XXX), 5); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_0G_10, 16, 2), 18); + line += Rinex_Printer::rightJustify(Rinex_Printer::doub2for(galileo_almanac.A_1G_10, 15, 2), 16); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.t0t_6), 7); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WNot_6), 5); line += std::string(10, ' '); line += Rinex_Printer::leftJustify("TIME SYSTEM CORR", 20); Rinex_Printer::lengthCheck(line); - out << line << std::endl;*/ + out << line << std::endl; // -------- Line 6 leap seconds // For leap second information, see http://www.endruntechnologies.com/leap.htm line.clear(); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.Delta_tLS_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.Delta_tLSF_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.WN_LSF_6)), 6); - line += Rinex_Printer::rightJustify(boost::lexical_cast(static_cast(utc_model.DN_6)), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLS_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.Delta_tLSF_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.WN_LSF_6), 6); + line += Rinex_Printer::rightJustify(boost::lexical_cast(utc_model.DN_6), 6); line += std::string(36, ' '); line += Rinex_Printer::leftJustify("LEAP SECONDS", 20); Rinex_Printer::lengthCheck(line); diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h index 52a0e0340..94fc616bb 100644 --- a/src/algorithms/PVT/libs/rinex_printer.h +++ b/src/algorithms/PVT/libs/rinex_printer.h @@ -97,7 +97,7 @@ public: /*! * \brief Generates the Galileo Navigation Data header */ - void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model); + void rinex_nav_header(std::ofstream& out, Galileo_Iono iono, Galileo_Utc_Model utc_model, Galileo_Almanac galileo_almanac); /*! * \brief Generates the GPS Observation data header