1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00

Catch exception

This commit is contained in:
Carles Fernandez 2018-05-22 00:29:33 +02:00
parent 588edaef66
commit bdce3c20d1
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -471,25 +471,14 @@ int main(int argc, char** argv)
<< elapsed_seconds.count() << elapsed_seconds.count()
<< " [seconds]" << std::endl; << " [seconds]" << std::endl;
//6. find TOW from SUPL assistance // 6. find TOW from SUPL assistance
double current_TOW = 0; double current_TOW = 0;
try
{
if (global_gps_ephemeris_map.size() > 0) if (global_gps_ephemeris_map.size() > 0)
{ {
std::map<int, Gps_Ephemeris> Eph_map; std::map<int, Gps_Ephemeris> Eph_map;
try
{
Eph_map = global_gps_ephemeris_map.get_map_copy(); Eph_map = global_gps_ephemeris_map.get_map_copy();
}
catch (const boost::exception& e)
{
std::cout << "Exception in getting Global ephemeris map" << std::endl;
delete acquisition;
delete gnss_synchro;
google::ShutDownCommandLineFlags();
std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl;
return 0;
}
current_TOW = Eph_map.begin()->second.d_TOW; current_TOW = Eph_map.begin()->second.d_TOW;
time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW); time_t t = utc_time(Eph_map.begin()->second.i_GPS_week, (long int)current_TOW);
@ -509,8 +498,18 @@ int main(int argc, char** argv)
std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl; std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl;
return 0; return 0;
} }
}
catch (const boost::exception& e)
{
std::cout << "Exception in getting Global ephemeris map" << std::endl;
delete acquisition;
delete gnss_synchro;
google::ShutDownCommandLineFlags();
std::cout << "GNSS-SDR Front-end calibration program ended." << std::endl;
return 0;
}
//Get user position from config file (or from SUPL using GSM Cell ID) // Get user position from config file (or from SUPL using GSM Cell ID)
double lat_deg = configuration->property("GNSS-SDR.init_latitude_deg", 41.0); double lat_deg = configuration->property("GNSS-SDR.init_latitude_deg", 41.0);
double lon_deg = configuration->property("GNSS-SDR.init_longitude_deg", 2.0); double lon_deg = configuration->property("GNSS-SDR.init_longitude_deg", 2.0);
double altitude_m = configuration->property("GNSS-SDR.init_altitude_m", 100); double altitude_m = configuration->property("GNSS-SDR.init_altitude_m", 100);