1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-17 23:34:56 +00:00

Return WORK_DONE when throwing an exception

This commit is contained in:
Antonio Ramos 2018-02-14 16:24:29 +01:00
parent 28cc4a1a05
commit ab6e62af72

View File

@ -83,6 +83,7 @@ hybrid_observables_cc::hybrid_observables_cc(unsigned int nchannels_in, unsigned
catch (const std::ifstream::failure & e) catch (const std::ifstream::failure & e)
{ {
LOG(WARNING) << "Exception opening observables dump file " << e.what(); LOG(WARNING) << "Exception opening observables dump file " << e.what();
d_dump = false;
} }
} }
} }
@ -105,7 +106,7 @@ hybrid_observables_cc::~hybrid_observables_cc()
if(d_dump == true) if(d_dump == true)
{ {
std::cout << "Writing observables .mat files ..."; std::cout << "Writing observables .mat files ...";
hybrid_observables_cc::save_matfile(); save_matfile();
std::cout << " done." << std::endl; std::cout << " done." << std::endl;
} }
} }
@ -509,12 +510,7 @@ int hybrid_observables_cc::general_work(int noutput_items, gr_vector_int &ninput
// two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1) // two points linear interpolation using adjacent (adj) values: y=y1+(x-x1)*(y2-y1)/(x2-x1)
// TOW at the selected receiver time T_rx_s // TOW at the selected receiver time T_rx_s
int element_key = gnss_synchro_map_iter->second.Channel_ID; int element_key = gnss_synchro_map_iter->second.Channel_ID;
try{
adj_obs = adjacent_gnss_synchro_map.at(element_key); adj_obs = adjacent_gnss_synchro_map.at(element_key);
}catch(const std::exception & ex)
{
continue;
}
double adj_T_rx_s = static_cast<double>(adj_obs.Tracking_sample_counter) / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz; double adj_T_rx_s = static_cast<double>(adj_obs.Tracking_sample_counter) / channel_fs_hz + adj_obs.Code_phase_samples / channel_fs_hz;
@ -566,6 +562,7 @@ int hybrid_observables_cc::general_work(int noutput_items, gr_vector_int &ninput
catch (const std::ifstream::failure& e) catch (const std::ifstream::failure& e)
{ {
LOG(WARNING) << "Exception writing observables dump file " << e.what(); LOG(WARNING) << "Exception writing observables dump file " << e.what();
d_dump = false;
} }
} }
@ -593,15 +590,17 @@ int hybrid_observables_cc::general_work(int noutput_items, gr_vector_int &ninput
} }
}// End of try{...} }// End of try{...}
catch(std::out_of_range& e) catch(const std::out_of_range& e)
{ {
LOG(WARNING) << "Out of range exception thrown by Hybrid Observables block. Exception message: " << e.what(); LOG(WARNING) << "Out of range exception thrown by Hybrid Observables block. Exception message: " << e.what();
std::cout << "Out of range exception thrown by Hybrid Observables block. Exception message: " << e.what() << std::endl; std::cout << "Out of range exception thrown by Hybrid Observables block. Exception message: " << e.what() << std::endl;
return gr::block::WORK_DONE;
} }
catch(...) catch(const std::exception& e)
{ {
LOG(WARNING) << "Undefined exception thrown by Hybrid Observables block."; LOG(WARNING) << "Exception thrown by Hybrid Observables block. Exception message: " << e.what();
std::cout << "Undefined exception thrown by Hybrid Observables block." << std::endl; std::cout << "Exception thrown by Hybrid Observables block. Exception message: " << e.what() << std::endl;
return gr::block::WORK_DONE;
} }
}while(channel_history_ok == true && noutput_items > n_outputs); }while(channel_history_ok == true && noutput_items > n_outputs);