mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 07:13:03 +00:00 
			
		
		
		
	Process optimization: Moved the receiver stdout status output
(a.k.a seconds counter) from the tracking blocks to PVT block
This commit is contained in:
		| @@ -102,6 +102,8 @@ galileo_e1_pvt_cc::galileo_e1_pvt_cc(unsigned int nchannels, boost::shared_ptr<g | ||||
|     b_rtcm_writing_started = false; | ||||
|     rp = std::make_shared<Rinex_Printer>(); | ||||
|  | ||||
|     d_last_status_print_seg=0; | ||||
|  | ||||
|     // ############# ENABLE DATA FILE LOG ################# | ||||
|     if (d_dump == true) | ||||
|         { | ||||
| @@ -134,6 +136,18 @@ bool galileo_e1_pvt_cc::pseudoranges_pairCompare_min(const std::pair<int,Gnss_Sy | ||||
| } | ||||
|  | ||||
|  | ||||
| void galileo_e1_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data) | ||||
| { | ||||
|     // Print the current receiver status using std::cout every second | ||||
| 	int current_rx_seg=floor(channels_synchronization_data[0][0].Tracking_timestamp_secs); | ||||
|     if ( current_rx_seg!= d_last_status_print_seg) | ||||
| 		{ | ||||
| 			d_last_status_print_seg = current_rx_seg; | ||||
| 			std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush; | ||||
| 			//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
| 			//          << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
| 		} | ||||
| } | ||||
|  | ||||
| int galileo_e1_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | ||||
|         gr_vector_const_void_star &input_items,	gr_vector_void_star &output_items  __attribute__((unused))) | ||||
| @@ -144,6 +158,8 @@ int galileo_e1_pvt_cc::general_work (int noutput_items __attribute__((unused)), | ||||
|  | ||||
|     Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0]; //Get the input pointer | ||||
|  | ||||
|     print_receiver_status(in); | ||||
|  | ||||
|     for (unsigned int i = 0; i < d_nchannels; i++) | ||||
|         { | ||||
|             if (in[i][0].Flag_valid_pseudorange == true) | ||||
|   | ||||
| @@ -102,6 +102,9 @@ private: | ||||
|     bool b_rinex_header_updated; | ||||
|     bool b_rtcm_writing_started; | ||||
|  | ||||
|     void print_receiver_status(Gnss_Synchro** channels_synchronization_data); | ||||
|     int d_last_status_print_seg; //for status printer | ||||
|  | ||||
|     unsigned int d_nchannels; | ||||
|     std::string d_dump_filename; | ||||
|     std::ofstream d_dump_file; | ||||
|   | ||||
| @@ -115,6 +115,8 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, | ||||
|     d_last_sample_nav_output = 0; | ||||
|     d_rx_time = 0.0; | ||||
|  | ||||
|     d_last_status_print_seg = 0; | ||||
|  | ||||
|     b_rinex_header_writen = false; | ||||
|     b_rinex_header_updated = false; | ||||
|     b_rinex_sbs_header_writen = false; | ||||
| @@ -131,7 +133,7 @@ gps_l1_ca_pvt_cc::gps_l1_ca_pvt_cc(unsigned int nchannels, | ||||
|                             d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary); | ||||
|                             LOG(INFO) << "PVT dump enabled Log file: " << d_dump_filename.c_str(); | ||||
|                     } | ||||
|                     catch (std::ifstream::failure e) | ||||
|                     catch (const std::ifstream::failure & e) | ||||
|                     { | ||||
|                             LOG(INFO) << "Exception opening PVT dump file " << e.what(); | ||||
|                     } | ||||
| @@ -152,6 +154,18 @@ bool pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchro>& a, const st | ||||
| } | ||||
|  | ||||
|  | ||||
| void gps_l1_ca_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data) | ||||
| { | ||||
|     // Print the current receiver status using std::cout every second | ||||
| 	int current_rx_seg=floor(channels_synchronization_data[0][0].Tracking_timestamp_secs); | ||||
|     if ( current_rx_seg!= d_last_status_print_seg) | ||||
| 		{ | ||||
| 			d_last_status_print_seg = current_rx_seg; | ||||
| 			std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush; | ||||
| 			//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
| 			//          << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
| 		} | ||||
| } | ||||
|  | ||||
| int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | ||||
|         gr_vector_const_void_star &input_items,	gr_vector_void_star &output_items __attribute__((unused))) | ||||
| @@ -163,6 +177,8 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items __attribute__((unused)), g | ||||
|     Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0]; //Get the input pointer | ||||
|     //Gnss_Synchro **out = (Gnss_Synchro **)  &output_items[0]; //Get the output pointer | ||||
|  | ||||
|     print_receiver_status(in); | ||||
|  | ||||
|     // ############ 1. READ EPHEMERIS FROM GLOBAL MAP #### | ||||
|     d_ls_pvt->gps_ephemeris_map = global_gps_ephemeris_map.get_map_copy(); | ||||
|  | ||||
|   | ||||
| @@ -103,6 +103,9 @@ private: | ||||
|     bool b_rinex_header_updated; | ||||
|     bool b_rtcm_writing_started; | ||||
|  | ||||
|     void print_receiver_status(Gnss_Synchro** channels_synchronization_data); | ||||
|     int d_last_status_print_seg; //for status printer | ||||
|  | ||||
|     unsigned int d_nchannels; | ||||
|     std::string d_dump_filename; | ||||
|     std::ofstream d_dump_file; | ||||
|   | ||||
| @@ -105,6 +105,8 @@ hybrid_pvt_cc::hybrid_pvt_cc(unsigned int nchannels, boost::shared_ptr<gr::msg_q | ||||
|     b_rinex_header_updated = false; | ||||
|     rp = std::make_shared<Rinex_Printer>(); | ||||
|  | ||||
|     d_last_status_print_seg=0; | ||||
|  | ||||
|     // ############# ENABLE DATA FILE LOG ################# | ||||
|     if (d_dump == true) | ||||
|         { | ||||
| @@ -137,6 +139,18 @@ bool hybrid_pvt_cc::pseudoranges_pairCompare_min(const std::pair<int,Gnss_Synchr | ||||
| } | ||||
|  | ||||
|  | ||||
| void hybrid_pvt_cc::print_receiver_status(Gnss_Synchro** channels_synchronization_data) | ||||
| { | ||||
|     // Print the current receiver status using std::cout every second | ||||
| 	int current_rx_seg=floor(channels_synchronization_data[0][0].Tracking_timestamp_secs); | ||||
|     if ( current_rx_seg!= d_last_status_print_seg) | ||||
| 		{ | ||||
| 			d_last_status_print_seg = current_rx_seg; | ||||
| 			std::cout << "Current input signal time = " << current_rx_seg << " [s]" << std::endl<< std::flush; | ||||
| 			//DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
| 			//          << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
| 		} | ||||
| } | ||||
|  | ||||
| int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)), | ||||
|         gr_vector_const_void_star &input_items,	gr_vector_void_star &output_items __attribute__((unused))) | ||||
| @@ -148,6 +162,8 @@ int hybrid_pvt_cc::general_work (int noutput_items __attribute__((unused)), gr_v | ||||
|  | ||||
|     Gnss_Synchro **in = (Gnss_Synchro **)  &input_items[0]; //Get the input pointer | ||||
|  | ||||
|     print_receiver_status(in); | ||||
|  | ||||
|     for (unsigned int i = 0; i < d_nchannels; i++) | ||||
|         { | ||||
|             if (in[i][0].Flag_valid_pseudorange == true) | ||||
|   | ||||
| @@ -101,6 +101,9 @@ private: | ||||
|     bool b_rinex_header_writen; | ||||
|     bool b_rinex_header_updated; | ||||
|  | ||||
|     void print_receiver_status(Gnss_Synchro** channels_synchronization_data); | ||||
|     int d_last_status_print_seg; //for status printer | ||||
|  | ||||
|     unsigned int d_nchannels; | ||||
|     std::string d_dump_filename; | ||||
|     std::ofstream d_dump_file; | ||||
|   | ||||
| @@ -172,7 +172,6 @@ galileo_e1_dll_pll_veml_tracking_cc::galileo_e1_dll_pll_veml_tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     d_current_prn_length_samples = static_cast<int>(d_vector_length); | ||||
|  | ||||
| @@ -416,49 +415,9 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items __attri | ||||
|             current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; | ||||
|             current_synchro_data.Flag_valid_pseudorange = false; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (std::floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = std::floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|  | ||||
|                     tmp_str_stream << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                    << ", Doppler=" << d_carrier_doppler_hz << " [Hz] CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
|                     LOG(INFO) << tmp_str_stream.rdbuf() << std::flush; | ||||
|                     //if (d_channel == 0 || d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|     { | ||||
|     	// ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|     	/*! | ||||
|     	 *  \todo The stop timer has to be moved to the signal source! | ||||
|     	 */ | ||||
|     	// stream to collect cout calls to improve thread safety | ||||
|     	std::stringstream tmp_str_stream; | ||||
|     	if (std::floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|     	{ | ||||
|     		d_last_seg = std::floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|     		if (d_channel == 0) | ||||
|     		{ | ||||
|     			// debug: Second counter in channel 0 | ||||
|     			tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|     			std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|     		} | ||||
|     	} | ||||
|     	*d_Early = gr_complex(0,0); | ||||
|     	*d_Prompt = gr_complex(0,0); | ||||
|     	*d_Late = gr_complex(0,0); | ||||
|   | ||||
| @@ -119,7 +119,6 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -175,7 +175,6 @@ Galileo_E1_Tcp_Connector_Tracking_cc::Galileo_E1_Tcp_Connector_Tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     d_current_prn_length_samples = (int)d_vector_length; | ||||
|  | ||||
| @@ -420,52 +419,9 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attr | ||||
|             current_synchro_data.CN0_dB_hz = (double)d_CN0_SNV_dB_Hz; | ||||
|             current_synchro_data.Flag_valid_pseudorange = false; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             LOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             LOG(INFO) << "Tracking CH " << d_channel | ||||
|                                       <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             *d_Early = gr_complex(0,0); | ||||
|             *d_Prompt = gr_complex(0,0); | ||||
|             *d_Late = gr_complex(0,0); | ||||
|   | ||||
| @@ -124,7 +124,7 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|  | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -178,7 +178,6 @@ Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc( | ||||
|     // sample synchronization | ||||
|     d_sample_counter = 0; | ||||
|     d_acq_sample_stamp = 0; | ||||
|     d_last_seg = 0; | ||||
|     d_first_transition = false; | ||||
|  | ||||
|     d_secondary_lock = false; | ||||
| @@ -396,23 +395,7 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute | ||||
|     { | ||||
|     case 0: | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             d_Early = gr_complex(0,0); | ||||
|             d_Prompt = gr_complex(0,0); | ||||
|             d_Late = gr_complex(0,0); | ||||
| @@ -665,33 +648,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute | ||||
|                     current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz; | ||||
|                     current_synchro_data.Flag_valid_tracking = false; | ||||
|  | ||||
|                     // ########## DEBUG OUTPUT | ||||
|                     /*! | ||||
|                      *  \todo The stop timer has to be moved to the signal source! | ||||
|                      */ | ||||
|                     // debug: Second counter in channel 0 | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                                 { | ||||
|                                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                                     std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                                     std::cout  << "Galileo E5 Tracking CH " << d_channel <<  ": Satellite " | ||||
|                                             << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz] "<<"Doppler="<<d_carrier_doppler_hz<<" [Hz]"<< std::endl; | ||||
|                                     //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                                 } | ||||
|                         } | ||||
|                     else | ||||
|                         { | ||||
|                             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                                 { | ||||
|                                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                                     std::cout  << "Galileo E5 Tracking CH " << d_channel <<  ": Satellite " | ||||
|                                             << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                             << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz] "<<"Doppler="<<d_carrier_doppler_hz<<" [Hz]"<< std::endl; | ||||
|                                     //std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl; | ||||
|                                 } | ||||
|                         } | ||||
|                 } | ||||
|             else | ||||
|                 { | ||||
| @@ -704,23 +660,6 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute | ||||
|                     current_synchro_data.CN0_dB_hz = 0.0; | ||||
|                     current_synchro_data.Flag_valid_tracking = false; | ||||
|  | ||||
|                     // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|                     /*! | ||||
|                      *  \todo The stop timer has to be moved to the signal source! | ||||
|                      */ | ||||
|                     // stream to collect cout calls to improve thread safety | ||||
|                     std::stringstream tmp_str_stream; | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                             if (d_channel == 0) | ||||
|                                 { | ||||
|                                     // debug: Second counter in channel 0 | ||||
|                                     tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                                     std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                                 } | ||||
|                         } | ||||
|                 } | ||||
|             *out[0] = current_synchro_data; | ||||
|             break; | ||||
|   | ||||
| @@ -126,7 +126,6 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -179,7 +179,6 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     // CN0 estimation and lock detector buffers | ||||
|     d_cn0_estimation_counter = 0; | ||||
| @@ -597,52 +596,9 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items __attri | ||||
|                     current_synchro_data.correlation_length_ms = 1; | ||||
|                     *out[0] = current_synchro_data; | ||||
|                 } | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             DLOG(INFO)  << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                         << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                             //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             DLOG(INFO)  << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                         << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             for (int n = 0; n < d_n_correlator_taps; n++) | ||||
|                 { | ||||
|                     d_correlator_outs[n] = gr_complex(0,0); | ||||
|   | ||||
| @@ -126,7 +126,6 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -161,7 +161,6 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::gps_l1_ca_dll_pll_c_aid_tracking_sc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     // CN0 estimation and lock detector buffers | ||||
|     d_cn0_estimation_counter = 0; | ||||
| @@ -453,51 +452,10 @@ int gps_l1_ca_dll_pll_c_aid_tracking_sc::general_work (int noutput_items __attri | ||||
|             current_synchro_data.correlation_length_ms = 1; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                               << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
|                             //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             DLOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                                << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             for (int n = 0; n < d_n_correlator_taps; n++) | ||||
|                 { | ||||
|                     d_correlator_outs_16sc[n] = lv_16sc_t(0,0); | ||||
|   | ||||
| @@ -125,7 +125,7 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|  | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -155,7 +155,7 @@ Gps_L1_Ca_Dll_Pll_Tracking_cc::Gps_L1_Ca_Dll_Pll_Tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|  | ||||
|     d_current_prn_length_samples = static_cast<int>(d_vector_length); | ||||
|  | ||||
| @@ -433,51 +433,9 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items __attribute__ | ||||
|             current_synchro_data.correlation_length_ms=1; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
|                             //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             DLOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                        << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             for (int n = 0; n < d_n_correlator_taps; n++) | ||||
|                 { | ||||
|                     d_correlator_outs[n] = gr_complex(0,0); | ||||
|   | ||||
| @@ -114,7 +114,7 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|  | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -156,7 +156,6 @@ Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     // CN0 estimation and lock detector buffers | ||||
|     d_cn0_estimation_counter = 0; | ||||
| @@ -457,51 +456,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_GPU_cc::general_work (int noutput_items __attribu | ||||
|             current_synchro_data.correlation_length_ms=1; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                               << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl; | ||||
|                             //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             DLOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                                << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             for (int n = 0; n < d_n_correlator_taps; n++) | ||||
|                 { | ||||
|                     d_correlator_outs[n] = gr_complex(0,0); | ||||
|   | ||||
| @@ -115,7 +115,7 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|  | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
| @@ -162,7 +162,6 @@ Gps_L1_Ca_Tcp_Connector_Tracking_cc::Gps_L1_Ca_Tcp_Connector_Tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     d_current_prn_length_samples = (int)d_vector_length; | ||||
|  | ||||
| @@ -470,51 +469,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items __attri | ||||
|             current_synchro_data.Flag_valid_symbol_output = true; | ||||
|             current_synchro_data.correlation_length_ms=1; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             LOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             LOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]"; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             *d_Early = gr_complex(0,0); | ||||
|             *d_Prompt = gr_complex(0,0); | ||||
|             *d_Late = gr_complex(0,0); | ||||
|   | ||||
| @@ -114,7 +114,7 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|  | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|     int d_correlation_length_samples; | ||||
|   | ||||
| @@ -159,7 +159,6 @@ gps_l2_m_dll_pll_tracking_cc::gps_l2_m_dll_pll_tracking_cc( | ||||
|  | ||||
|     d_enable_tracking = false; | ||||
|     d_pull_in = false; | ||||
|     d_last_seg = 0; | ||||
|  | ||||
|     d_current_prn_length_samples = static_cast<int>(d_vector_length); | ||||
|  | ||||
| @@ -446,53 +445,9 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items __attribute__( | ||||
|             current_synchro_data.Flag_valid_symbol_output = true; | ||||
|             *out[0] = current_synchro_data; | ||||
|  | ||||
|             // ########## DEBUG OUTPUT | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // debug: Second counter in channel 0 | ||||
|             if (d_channel == 0) | ||||
|                 { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl; | ||||
|                             std::cout  << "GPS L2C M Tracking CH " << d_channel <<  ": Satellite " | ||||
|                             		<< Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz] "<<"Doppler="<<d_carrier_doppler_hz<<" [Hz]"<< std::endl; | ||||
|                             //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock! | ||||
|                         } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|                     if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                         { | ||||
|                             d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|                             std::cout  << "GPS L2C M Tracking CH " << d_channel <<  ": Satellite " | ||||
|                             << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) | ||||
|                             << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz] "<<"Doppler="<<d_carrier_doppler_hz<<" [Hz]"<< std::endl; | ||||
|                             //std::cout<<"TRK CH "<<d_channel<<" Carrier_lock_test="<<d_carrier_lock_test<< std::endl; | ||||
|                         } | ||||
|                 } | ||||
|         } | ||||
|     else | ||||
|         { | ||||
|             // ########## DEBUG OUTPUT (TIME ONLY for channel 0 when tracking is disabled) | ||||
|             /*! | ||||
|              *  \todo The stop timer has to be moved to the signal source! | ||||
|              */ | ||||
|             // stream to collect cout calls to improve thread safety | ||||
|             std::stringstream tmp_str_stream; | ||||
|             if (floor(d_sample_counter / d_fs_in) != d_last_seg) | ||||
|                 { | ||||
|                     d_last_seg = floor(d_sample_counter / d_fs_in); | ||||
|  | ||||
|                     if (d_channel == 0) | ||||
|                         { | ||||
|                             // debug: Second counter in channel 0 | ||||
|                             tmp_str_stream << "Current input signal time = " << d_last_seg << " [s]" << std::endl << std::flush; | ||||
|                             std::cout << tmp_str_stream.rdbuf() << std::flush; | ||||
|                         } | ||||
|                 } | ||||
|             for (int n = 0; n < d_n_correlator_taps; n++) | ||||
|                 { | ||||
|                     d_correlator_outs[n] = gr_complex(0,0); | ||||
|   | ||||
| @@ -114,7 +114,6 @@ private: | ||||
|  | ||||
|     Gnss_Synchro* d_acquisition_gnss_synchro; | ||||
|     unsigned int d_channel; | ||||
|     int d_last_seg; | ||||
|     long d_if_freq; | ||||
|     long d_fs_in; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Javier Arribas
					Javier Arribas