mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Only read XML assistance files if needed
This commit is contained in:
		| @@ -209,89 +209,97 @@ bool ControlThread::read_assistance_from_XML() | ||||
|     std::string gal_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_gal_utc_model.xml", gal_utc_default_xml_filename); | ||||
|     std::string cnav_utc_xml_filename = configuration_->property("GNSS-SDR.SUPL_cnav_utc_model.xml", cnav_utc_default_xml_filename); | ||||
|  | ||||
|     std::cout << "Trying to read GNSS ephemeris from XML file(s)..." | ||||
|               << std::endl; | ||||
|     std::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl; | ||||
|  | ||||
|     if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) | ||||
|     if (configuration_->property("Channels_1C.count", 0) > 0) | ||||
|         { | ||||
|             std::map<int, Gps_Ephemeris>::const_iterator gps_eph_iter; | ||||
|             for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); | ||||
|                  gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); | ||||
|                  gps_eph_iter++) | ||||
|             if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) | ||||
|                 { | ||||
|                     std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                     std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(gps_eph_iter->second); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::map<int, Gps_Ephemeris>::const_iterator gps_eph_iter; | ||||
|                     for (gps_eph_iter = supl_client_ephemeris_.gps_ephemeris_map.cbegin(); | ||||
|                          gps_eph_iter != supl_client_ephemeris_.gps_ephemeris_map.cend(); | ||||
|                          gps_eph_iter++) | ||||
|                         { | ||||
|                             std::cout << "From XML file: Read NAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                             std::shared_ptr<Gps_Ephemeris> tmp_obj = std::make_shared<Gps_Ephemeris>(gps_eph_iter->second); | ||||
|                             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                         } | ||||
|                     ret = true; | ||||
|                 } | ||||
|             ret = true; | ||||
|         } | ||||
|  | ||||
|     if (supl_client_ephemeris_.load_gal_ephemeris_xml(eph_gal_xml_filename) == true) | ||||
|         { | ||||
|             std::map<int, Galileo_Ephemeris>::const_iterator gal_eph_iter; | ||||
|             for (gal_eph_iter = supl_client_ephemeris_.gal_ephemeris_map.cbegin(); | ||||
|                  gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend(); | ||||
|                  gal_eph_iter++) | ||||
|             if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) | ||||
|                 { | ||||
|                     std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                     std::shared_ptr<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(gal_eph_iter->second); | ||||
|                     std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(supl_client_acquisition_.gps_utc); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::cout << "From XML file: Read GPS UTC parameters." << std::endl; | ||||
|                     ret = true; | ||||
|                 } | ||||
|             ret = true; | ||||
|         } | ||||
|  | ||||
|     if (supl_client_ephemeris_.load_cnav_ephemeris_xml(eph_cnav_xml_filename) == true) | ||||
|         { | ||||
|             std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_eph_iter; | ||||
|             for (gps_cnav_eph_iter = supl_client_ephemeris_.gps_cnav_ephemeris_map.cbegin(); | ||||
|                  gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend(); | ||||
|                  gps_cnav_eph_iter++) | ||||
|             if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) | ||||
|                 { | ||||
|                     std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                     std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(gps_cnav_eph_iter->second); | ||||
|                     std::shared_ptr<Gps_Iono> tmp_obj = std::make_shared<Gps_Iono>(supl_client_acquisition_.gps_iono); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::cout << "From XML file: Read GPS iono parameters." << std::endl; | ||||
|                     ret = true; | ||||
|                 } | ||||
|             ret = true; | ||||
|         } | ||||
|  | ||||
|     if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true) | ||||
|     if ((configuration_->property("Channels_1B.count", 0) > 0) or (configuration_->property("Channels_5X.count", 0) > 0)) | ||||
|         { | ||||
|             std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(supl_client_acquisition_.gps_utc); | ||||
|             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|             std::cout << "From XML file: Read GPS UTC parameters." << std::endl; | ||||
|             ret = true; | ||||
|             if (supl_client_ephemeris_.load_gal_ephemeris_xml(eph_gal_xml_filename) == true) | ||||
|                 { | ||||
|                     std::map<int, Galileo_Ephemeris>::const_iterator gal_eph_iter; | ||||
|                     for (gal_eph_iter = supl_client_ephemeris_.gal_ephemeris_map.cbegin(); | ||||
|                          gal_eph_iter != supl_client_ephemeris_.gal_ephemeris_map.cend(); | ||||
|                          gal_eph_iter++) | ||||
|                         { | ||||
|                             std::cout << "From XML file: Read ephemeris for satellite " << Gnss_Satellite("Galileo", gal_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                             std::shared_ptr<Galileo_Ephemeris> tmp_obj = std::make_shared<Galileo_Ephemeris>(gal_eph_iter->second); | ||||
|                             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                         } | ||||
|                     ret = true; | ||||
|                 } | ||||
|  | ||||
|             if (supl_client_acquisition_.load_gal_iono_xml(gal_iono_xml_filename) == true) | ||||
|                 { | ||||
|                     std::shared_ptr<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(supl_client_acquisition_.gal_iono); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::cout << "From XML file: Read Galileo iono parameters." << std::endl; | ||||
|                     ret = true; | ||||
|                 } | ||||
|  | ||||
|             if (supl_client_acquisition_.load_gal_utc_xml(gal_utc_xml_filename) == true) | ||||
|                 { | ||||
|                     std::shared_ptr<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(supl_client_acquisition_.gal_utc); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::cout << "From XML file: Read Galileo UTC parameters." << std::endl; | ||||
|                     ret = true; | ||||
|                 } | ||||
|         } | ||||
|  | ||||
|     if (supl_client_acquisition_.load_iono_xml(iono_xml_filename) == true) | ||||
|     if ((configuration_->property("Channels_2S.count", 0) > 0) or (configuration_->property("Channels_L5.count", 0) > 0)) | ||||
|         { | ||||
|             std::shared_ptr<Gps_Iono> tmp_obj = std::make_shared<Gps_Iono>(supl_client_acquisition_.gps_iono); | ||||
|             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|             std::cout << "From XML file: Read GPS iono parameters." << std::endl; | ||||
|             ret = true; | ||||
|         } | ||||
|             if (supl_client_ephemeris_.load_cnav_ephemeris_xml(eph_cnav_xml_filename) == true) | ||||
|                 { | ||||
|                     std::map<int, Gps_CNAV_Ephemeris>::const_iterator gps_cnav_eph_iter; | ||||
|                     for (gps_cnav_eph_iter = supl_client_ephemeris_.gps_cnav_ephemeris_map.cbegin(); | ||||
|                          gps_cnav_eph_iter != supl_client_ephemeris_.gps_cnav_ephemeris_map.cend(); | ||||
|                          gps_cnav_eph_iter++) | ||||
|                         { | ||||
|                             std::cout << "From XML file: Read CNAV ephemeris for satellite " << Gnss_Satellite("GPS", gps_cnav_eph_iter->second.i_satellite_PRN) << std::endl; | ||||
|                             std::shared_ptr<Gps_CNAV_Ephemeris> tmp_obj = std::make_shared<Gps_CNAV_Ephemeris>(gps_cnav_eph_iter->second); | ||||
|                             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                         } | ||||
|                     ret = true; | ||||
|                 } | ||||
|  | ||||
|     if (supl_client_acquisition_.load_gal_iono_xml(gal_iono_xml_filename) == true) | ||||
|         { | ||||
|             std::shared_ptr<Galileo_Iono> tmp_obj = std::make_shared<Galileo_Iono>(supl_client_acquisition_.gal_iono); | ||||
|             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|             std::cout << "From XML file: Read Galileo iono parameters." << std::endl; | ||||
|             ret = true; | ||||
|         } | ||||
|  | ||||
|     if (supl_client_acquisition_.load_gal_utc_xml(gal_utc_xml_filename) == true) | ||||
|         { | ||||
|             std::shared_ptr<Galileo_Utc_Model> tmp_obj = std::make_shared<Galileo_Utc_Model>(supl_client_acquisition_.gal_utc); | ||||
|             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|             std::cout << "From XML file: Read Galileo UTC parameters." << std::endl; | ||||
|             ret = true; | ||||
|         } | ||||
|  | ||||
|     if (supl_client_acquisition_.load_cnav_utc_xml(cnav_utc_xml_filename) == true) | ||||
|         { | ||||
|             std::shared_ptr<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(supl_client_acquisition_.gps_cnav_utc); | ||||
|             flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|             std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; | ||||
|             ret = true; | ||||
|             if (supl_client_acquisition_.load_cnav_utc_xml(cnav_utc_xml_filename) == true) | ||||
|                 { | ||||
|                     std::shared_ptr<Gps_CNAV_Utc_Model> tmp_obj = std::make_shared<Gps_CNAV_Utc_Model>(supl_client_acquisition_.gps_cnav_utc); | ||||
|                     flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); | ||||
|                     std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; | ||||
|                     ret = true; | ||||
|                 } | ||||
|         } | ||||
|  | ||||
|     if (ret == false) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez