[hamradio-commits] [gnss-sdr] 19/60: fixing IONO and UTC reading

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 1176361e7987d6e16a08f12260c5bc6f30a9566e
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Sun Mar 1 14:49:55 2015 +0100

    fixing IONO and UTC reading
---
 .../adapters/gps_l1_ca_telemetry_decoder.cc        | 10 ++---
 .../gps_l1_ca_telemetry_decoder_cc.cc              | 43 +++++++++++-----------
 .../system_parameters/gps_navigation_message.cc    | 14 ++++---
 3 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
index e27ad19..701fa77 100644
--- a/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
+++ b/src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.cc
@@ -77,7 +77,7 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu
     telemetry_decoder_->set_utc_model_queue(&global_gps_utc_model_queue);
 
     //decimation factor
-    int decimation_factor=configuration->property(role + ".decimation_factor", 1);
+    int decimation_factor = configuration->property(role + ".decimation_factor", 1);
     telemetry_decoder_->set_decimation(decimation_factor);
     DLOG(INFO) << "global navigation message queue assigned to telemetry_decoder ("<< telemetry_decoder_->unique_id() << ")";
 }
@@ -97,16 +97,16 @@ void GpsL1CaTelemetryDecoder::set_satellite(Gnss_Satellite satellite)
 
 void GpsL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block)
 {
-	if(top_block) { /* top_block is not null */};
-	// Nothing to connect internally
+    if(top_block) { /* top_block is not null */};
+    // Nothing to connect internally
     DLOG(INFO) << "nothing to connect internally";
 }
 
 
 void GpsL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
 {
-	if(top_block) { /* top_block is not null */};
-	// Nothing to disconnect
+    if(top_block) { /* top_block is not null */};
+    // Nothing to disconnect
 }
 
 
diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc
index 0375e80..d800373 100644
--- a/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc
+++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.cc
@@ -130,7 +130,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
     d_TOW_at_Preamble = 0;
     d_TOW_at_current_symbol = 0;
     flag_TOW_set = false;
-    d_average_count=0;
+    d_average_count = 0;
     //set_history(d_samples_per_bit*8); // At least a history of 8 bits are needed to correlate with the preamble
 }
 
@@ -235,7 +235,7 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
                             LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite << " preamble_diff= " << preamble_diff;
                             d_stat = 0; //lost of frame sync
                             d_flag_frame_sync = false;
-                            flag_TOW_set=false;
+                            flag_TOW_set = false;
                         }
                 }
         }
@@ -302,11 +302,11 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
     current_synchro_data = in[0][0];
     //2. Add the telemetry decoder information
     if (this->d_flag_preamble == true and d_GPS_FSM.d_nav.d_TOW > 0)
-    	//update TOW at the preamble instant (todo: check for valid d_TOW)
-    	// JAVI: 30/06/2014
-    	// TOW, in GPS, is referred to the START of the SUBFRAME, that is, THE FIRST SYMBOL OF THAT SUBFRAME, NOT THE PREAMBLE.
-    	// thus, no correction should be done. d_TOW_at_Preamble should be renamed to d_TOW_at_subframe_start.
-    	// Sice we detected the preable, then, we are in the last symbol of that preamble, or just at the start of the first subframe symbol.
+        //update TOW at the preamble instant (todo: check for valid d_TOW)
+        // JAVI: 30/06/2014
+        // TOW, in GPS, is referred to the START of the SUBFRAME, that is, THE FIRST SYMBOL OF THAT SUBFRAME, NOT THE PREAMBLE.
+        // thus, no correction should be done. d_TOW_at_Preamble should be renamed to d_TOW_at_subframe_start.
+        // Sice we detected the preable, then, we are in the last symbol of that preamble, or just at the start of the first subframe symbol.
         {
             d_TOW_at_Preamble = d_GPS_FSM.d_nav.d_TOW + GPS_SUBFRAME_SECONDS; //we decoded the current TOW when the last word of the subframe arrive, so, we have a lag of ONE SUBFRAME
             d_TOW_at_current_symbol = d_TOW_at_Preamble;//GPS_L1_CA_CODE_PERIOD;// + (double)GPS_CA_PREAMBLE_LENGTH_BITS/(double)GPS_CA_TELEMETRY_RATE_BITS_SECOND;
@@ -324,8 +324,8 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
     current_synchro_data.d_TOW = d_TOW_at_Preamble;
     current_synchro_data.d_TOW_at_current_symbol = d_TOW_at_current_symbol;
 
-    current_synchro_data.d_TOW_hybrid_at_current_symbol= current_synchro_data.d_TOW_at_current_symbol; // to be  used in the hybrid configuration
-    current_synchro_data.Flag_valid_word = (d_flag_frame_sync == true and d_flag_parity == true and flag_TOW_set==true);
+    current_synchro_data.d_TOW_hybrid_at_current_symbol = current_synchro_data.d_TOW_at_current_symbol; // to be  used in the hybrid configuration
+    current_synchro_data.Flag_valid_word = (d_flag_frame_sync == true and d_flag_parity == true and flag_TOW_set == true);
     current_synchro_data.Flag_preamble = d_flag_preamble;
     current_synchro_data.Prn_timestamp_ms = in[0][0].Tracking_timestamp_secs * 1000.0;
     current_synchro_data.Prn_timestamp_at_preamble_ms = Prn_timestamp_at_preamble_ms;
@@ -352,23 +352,24 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
     //todo: implement averaging
 
     d_average_count++;
-    if (d_average_count==d_decimation_output_factor)
-    {
-    	d_average_count=0;
-        //3. Make the output (copy the object contents to the GNURadio reserved memory)
-        *out[0] = current_synchro_data;
-        //std::cout<<"GPS TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl;
-        return 1;
-    }else{
-    	return 0;
-    }
-
+    if (d_average_count == d_decimation_output_factor)
+        {
+            d_average_count = 0;
+            //3. Make the output (copy the object contents to the GNURadio reserved memory)
+            *out[0] = current_synchro_data;
+            //std::cout<<"GPS TLM output on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter/d_decimation_output_factor<<std::endl;
+            return 1;
+        }
+    else
+        {
+            return 0;
+        }
 }
 
 
 void gps_l1_ca_telemetry_decoder_cc::set_decimation(int decimation)
 {
-	d_decimation_output_factor=decimation;
+    d_decimation_output_factor = decimation;
 }
 
 void gps_l1_ca_telemetry_decoder_cc::set_satellite(Gnss_Satellite satellite)
diff --git a/src/core/system_parameters/gps_navigation_message.cc b/src/core/system_parameters/gps_navigation_message.cc
index 84e9efb..704eac2 100644
--- a/src/core/system_parameters/gps_navigation_message.cc
+++ b/src/core/system_parameters/gps_navigation_message.cc
@@ -102,8 +102,8 @@ void Gps_Navigation_Message::reset()
     b_antispoofing_flag = false;
 
     // Ionosphere and UTC
-    flag_iono_valid = false;
-    flag_utc_model_valid = false;
+    flag_iono_valid = true;
+    flag_utc_model_valid = true;
     d_alpha0 = 0;
     d_alpha1 = 0;
     d_alpha2 = 0;
@@ -558,6 +558,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
         if (SV_page > 24 && SV_page < 33) // Page 4 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
             {
                 //! \TODO read almanac
+                if(SV_data_ID){}
             }
 
         if (SV_page == 52) // Page 13 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
@@ -633,6 +634,7 @@ int Gps_Navigation_Message::subframe_decoder(char *subframe)
         if (SV_page_5 < 25)
             {
                 //! \TODO read almanac
+                if(SV_data_ID){}
             }
         if (SV_page_5 == 51) // Page 25 (from Table 20-V. Data IDs and SV IDs in Subframes 4 and 5, IS-GPS-200H, page 110)
             {
@@ -788,6 +790,7 @@ Gps_Ephemeris Gps_Navigation_Message::get_ephemeris()
     return ephemeris;
 }
 
+
 Gps_Iono Gps_Navigation_Message::get_iono()
 {
     Gps_Iono iono;
@@ -801,14 +804,14 @@ Gps_Iono Gps_Navigation_Message::get_iono()
     iono.d_beta3 = d_beta3;
     iono.valid = flag_iono_valid;
     //WARNING: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
-    flag_iono_valid = false;
+    // flag_iono_valid = false;
     return iono;
 }
 
+
 Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
 {
     Gps_Utc_Model utc_model;
-
     utc_model.valid = flag_utc_model_valid;
     // UTC parameters
     utc_model.d_A1 = d_A1;
@@ -820,10 +823,11 @@ Gps_Utc_Model Gps_Navigation_Message::get_utc_model()
     utc_model.i_DN = i_DN;
     utc_model.d_DeltaT_LSF = d_DeltaT_LSF;
     // warning: We clear flag_utc_model_valid in order to not re-send the same information to the ionospheric parameters queue
-    flag_utc_model_valid = false;
+    // flag_utc_model_valid = false;
     return utc_model;
 }
 
+
 bool Gps_Navigation_Message::satellite_validation()
 {
     bool flag_data_valid = false;

-- 
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