mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-16 12:12:57 +00:00
catching exceptions
This commit is contained in:
parent
4dbf73acb3
commit
62f9bcc2b0
@ -282,7 +282,7 @@ int main(int argc, char** argv)
|
|||||||
// 1. Load configuration parameters from config file
|
// 1. Load configuration parameters from config file
|
||||||
|
|
||||||
std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(FLAGS_config_file);
|
std::shared_ptr<ConfigurationInterface> configuration = std::make_shared<FileConfiguration>(FLAGS_config_file);
|
||||||
//configuration = new FileConfiguration(FLAGS_config_file);
|
|
||||||
front_end_cal.set_configuration(configuration);
|
front_end_cal.set_configuration(configuration);
|
||||||
|
|
||||||
|
|
||||||
@ -369,6 +369,7 @@ int main(int argc, char** argv)
|
|||||||
std::map<int,double> cn0_measurements_map;
|
std::map<int,double> cn0_measurements_map;
|
||||||
|
|
||||||
boost::thread ch_thread;
|
boost::thread ch_thread;
|
||||||
|
|
||||||
// record startup time
|
// record startup time
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
@ -383,7 +384,14 @@ int main(int argc, char** argv)
|
|||||||
acquisition->init();
|
acquisition->init();
|
||||||
acquisition->reset();
|
acquisition->reset();
|
||||||
stop = false;
|
stop = false;
|
||||||
ch_thread = boost::thread(wait_message);
|
try
|
||||||
|
{
|
||||||
|
ch_thread = boost::thread(wait_message);
|
||||||
|
}
|
||||||
|
catch(const boost::thread_resource_error & e)
|
||||||
|
{
|
||||||
|
LOG(INFO) << "Exception catched (thread resource error)";
|
||||||
|
}
|
||||||
top_block->run();
|
top_block->run();
|
||||||
if (start_msg == true)
|
if (start_msg == true)
|
||||||
{
|
{
|
||||||
@ -448,7 +456,6 @@ int main(int argc, char** argv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl;
|
std::cout << "Unable to get Ephemeris SUPL assistance. TOW is unknown!" << std::endl;
|
||||||
//delete configuration;
|
|
||||||
delete acquisition;
|
delete acquisition;
|
||||||
delete gnss_synchro;
|
delete gnss_synchro;
|
||||||
google::ShutDownCommandLineFlags();
|
google::ShutDownCommandLineFlags();
|
||||||
@ -470,7 +477,6 @@ int main(int argc, char** argv)
|
|||||||
if (doppler_measurements_map.size() == 0)
|
if (doppler_measurements_map.size() == 0)
|
||||||
{
|
{
|
||||||
std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl;
|
std::cout << "Sorry, no GPS satellites detected in the front-end capture, please check the antenna setup..." << std::endl;
|
||||||
//delete configuration;
|
|
||||||
delete acquisition;
|
delete acquisition;
|
||||||
delete gnss_synchro;
|
delete gnss_synchro;
|
||||||
google::ShutDownCommandLineFlags();
|
google::ShutDownCommandLineFlags();
|
||||||
@ -552,6 +558,14 @@ int main(int argc, char** argv)
|
|||||||
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m);
|
doppler_estimated_hz = front_end_cal.estimate_doppler_from_eph(it->first, current_TOW, lat_deg, lon_deg, altitude_m);
|
||||||
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl;
|
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " " << doppler_estimated_hz << std::endl;
|
||||||
}
|
}
|
||||||
|
catch(const std::logic_error & e)
|
||||||
|
{
|
||||||
|
std::cout << "Logic error catched: " << e.what() << std::endl;
|
||||||
|
}
|
||||||
|
catch(const boost::lock_error & e)
|
||||||
|
{
|
||||||
|
std::cout << "Exception catched while reading ephemeris" << std::endl;
|
||||||
|
}
|
||||||
catch(int ex)
|
catch(int ex)
|
||||||
{
|
{
|
||||||
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " (Eph not found)" << std::endl;
|
std::cout << " " << it->first << " " << it->second - mean_f_if_Hz << " (Eph not found)" << std::endl;
|
||||||
@ -560,7 +574,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// 8. Generate GNSS-SDR config file.
|
// 8. Generate GNSS-SDR config file.
|
||||||
|
|
||||||
//delete configuration;
|
|
||||||
delete acquisition;
|
delete acquisition;
|
||||||
delete gnss_synchro;
|
delete gnss_synchro;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user