[hamradio-commits] [gnss-sdr] 24/60: hook for updating rinex headers

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sun Mar 22 11:15:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch next
in repository gnss-sdr.

commit 7303f3c3fde67cd95db20bc6265f909978d73ac3
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Sun Mar 1 21:16:29 2015 +0100

    hook for updating rinex headers
---
 src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc | 17 ++++++++++++++---
 src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h  |  1 +
 src/algorithms/PVT/libs/rinex_printer.cc               | 14 ++++++++++++++
 src/algorithms/PVT/libs/rinex_printer.h                |  4 ++++
 4 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc
index 6b2fea3..e76d782 100644
--- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc
+++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.cc
@@ -106,6 +106,7 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels,
     d_rx_time = 0.0;
 
     b_rinex_header_writen = false;
+    b_rinex_header_updated = false;
     b_rinex_sbs_header_writen = false;
     rp = std::make_shared<Rinex_Printer>();
 
@@ -150,6 +151,9 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
     std::map<int,Gnss_Synchro> gnss_pseudoranges_map;
 
     Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0]; //Get the input pointer
+    //Gnss_Synchro **out = (Gnss_Synchro **)  &output_items[0]; //Get the output pointer
+
+    //out = in;
 
     for (unsigned int i = 0; i < d_nchannels; i++)
         {
@@ -168,6 +172,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
         {
             // UTC MODEL data is shared for all the GPS satellites. Read always at ID=0
             global_gps_utc_model_map.read(0, d_ls_pvt->gps_utc_model);
+            std::cout << d_ls_pvt->gps_utc_model.d_A0 << std::endl;
         }
 
     if (global_gps_iono_map.size() > 0)
@@ -223,7 +228,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
         }
 
     // ############ 2 COMPUTE THE PVT ################################
-    if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->gps_ephemeris_map.size() >0)
+    if (gnss_pseudoranges_map.size() > 0 and d_ls_pvt->gps_ephemeris_map.size() > 0)
         {
             // compute on the fly PVT solution
             //mod 8/4/2012 Set the PVT computation rate in this block
@@ -242,7 +247,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
                                     gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
                                     if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
                                         {
-                                            rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second,d_rx_time);
+                                            rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
                                             rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
                                             b_rinex_header_writen = true; // do not write header anymore
                                         }
@@ -262,6 +267,12 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
                                         {
                                             rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
                                         }
+                                    if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0))
+                                        {
+                                            //rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
+                                            rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
+                                            b_rinex_header_updated = true;
+                                        }
                                 }
                         }
                 }
@@ -304,7 +315,7 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
         }
 
     consume_each(1); //one by one
-    return 0;
+    return noutput_items;
 }
 
 
diff --git a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h
index d66b8f8..645760e 100644
--- a/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h
+++ b/src/algorithms/PVT/gnuradio_blocks/gps_l1_ca_pvt_cc.h
@@ -96,6 +96,7 @@ private:
     bool d_dump;
     bool b_rinex_header_writen;
     bool b_rinex_sbs_header_writen;
+    bool b_rinex_header_updated;
     std::shared_ptr<Rinex_Printer> rp;
     unsigned int d_nchannels;
     std::string d_dump_filename;
diff --git a/src/algorithms/PVT/libs/rinex_printer.cc b/src/algorithms/PVT/libs/rinex_printer.cc
index 0bccdd2..758cbc8 100644
--- a/src/algorithms/PVT/libs/rinex_printer.cc
+++ b/src/algorithms/PVT/libs/rinex_printer.cc
@@ -501,6 +501,20 @@ void Rinex_Printer::rinex_nav_header(std::ofstream& out, const Galileo_Iono& ion
     out << line << std::endl;
 }
 
+
+void Rinex_Printer::update_nav_header(std::ofstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono)
+{
+    if (version == 2)
+        {
+
+        }
+    if (version == 3)
+        {
+
+        }
+}
+
+
 void Rinex_Printer::rinex_nav_header(std::ofstream& out, const Gps_Iono& iono, const Gps_Utc_Model& utc_model)
 {
 
diff --git a/src/algorithms/PVT/libs/rinex_printer.h b/src/algorithms/PVT/libs/rinex_printer.h
index df5829e..bf03545 100644
--- a/src/algorithms/PVT/libs/rinex_printer.h
+++ b/src/algorithms/PVT/libs/rinex_printer.h
@@ -59,6 +59,8 @@
 #include <map>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include "gps_navigation_message.h"
+#include "gps_utc_model.h"
+#include "gps_iono.h"
 #include "galileo_navigation_message.h"
 #include "sbas_telemetry_data.h"
 #include "GPS_L1_CA.h"
@@ -180,6 +182,8 @@ public:
      */
     void log_rinex_sbs(std::ofstream& out, const Sbas_Raw_Msg& sbs_message);
 
+    void update_nav_header(std::ofstream& out, const Gps_Utc_Model& gps_utc, const Gps_Iono& gps_iono);
+
     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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list