1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Only read XML assistance files if needed

This commit is contained in:
Carles Fernandez 2018-10-20 14:46:55 +02:00
parent c45ca2c0ee
commit 5ea5292166
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -209,9 +209,10 @@ 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 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::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::cout << "Trying to read GNSS ephemeris from XML file(s)..." << std::endl;
<< std::endl;
if (configuration_->property("Channels_1C.count", 0) > 0)
{
if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true) if (supl_client_ephemeris_.load_ephemeris_xml(eph_xml_filename) == true)
{ {
std::map<int, Gps_Ephemeris>::const_iterator gps_eph_iter; std::map<int, Gps_Ephemeris>::const_iterator gps_eph_iter;
@ -226,34 +227,6 @@ bool ControlThread::read_assistance_from_XML()
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++)
{
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_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_utc_xml(utc_xml_filename) == true) if (supl_client_acquisition_.load_utc_xml(utc_xml_filename) == true)
{ {
std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(supl_client_acquisition_.gps_utc); std::shared_ptr<Gps_Utc_Model> tmp_obj = std::make_shared<Gps_Utc_Model>(supl_client_acquisition_.gps_utc);
@ -269,6 +242,23 @@ bool ControlThread::read_assistance_from_XML()
std::cout << "From XML file: Read GPS iono parameters." << std::endl; std::cout << "From XML file: Read GPS iono parameters." << std::endl;
ret = true; ret = true;
} }
}
if ((configuration_->property("Channels_1B.count", 0) > 0) or (configuration_->property("Channels_5X.count", 0) > 0))
{
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) if (supl_client_acquisition_.load_gal_iono_xml(gal_iono_xml_filename) == true)
{ {
@ -285,6 +275,23 @@ bool ControlThread::read_assistance_from_XML()
std::cout << "From XML file: Read Galileo UTC parameters." << std::endl; std::cout << "From XML file: Read Galileo UTC parameters." << std::endl;
ret = true; ret = true;
} }
}
if ((configuration_->property("Channels_2S.count", 0) > 0) or (configuration_->property("Channels_L5.count", 0) > 0))
{
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_cnav_utc_xml(cnav_utc_xml_filename) == true) if (supl_client_acquisition_.load_cnav_utc_xml(cnav_utc_xml_filename) == true)
{ {
@ -293,6 +300,7 @@ bool ControlThread::read_assistance_from_XML()
std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl; std::cout << "From XML file: Read GPS CNAV UTC parameters." << std::endl;
ret = true; ret = true;
} }
}
if (ret == false) if (ret == false)
{ {