1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-16 01:59:58 +00:00

Avoid throwing exceptions from destructors

Detected by clang-tidy check bugprone-exception-escape
This commit is contained in:
Carles Fernandez 2019-02-10 21:55:51 +01:00
parent 75bd492d96
commit 4b2b205e21
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
36 changed files with 897 additions and 373 deletions

View File

@ -46,6 +46,7 @@
#include <exception>
#include <iostream>
#include <map>
#include <stdexcept>
#if OLD_BOOST
#include <boost/math/common_factor_rt.hpp>
namespace bc = boost::math;
@ -588,403 +589,546 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
rtklib_pvt_cc::~rtklib_pvt_cc()
{
msgctl(sysv_msqid, IPC_RMID, nullptr);
if (d_xml_storage)
try
{
// save GPS L2CM ephemeris to XML file
std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml";
if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false)
if (d_xml_storage)
{
std::ofstream ofs;
try
// save GPS L2CM ephemeris to XML file
std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml";
if (d_pvt_solver->gps_cnav_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map);
LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_pvt_solver->gps_cnav_ephemeris_map);
LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty";
}
// save GPS L1 CA ephemeris to XML file
file_name = xml_base_path + "gps_ephemeris.xml";
if (d_pvt_solver->gps_ephemeris_map.empty() == false)
{
std::ofstream ofs;
try
// save GPS L1 CA ephemeris to XML file
file_name = xml_base_path + "gps_ephemeris.xml";
if (d_pvt_solver->gps_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map);
LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_pvt_solver->gps_ephemeris_map);
LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (const std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty";
}
// save Galileo E1 ephemeris to XML file
file_name = xml_base_path + "gal_ephemeris.xml";
if (d_pvt_solver->galileo_ephemeris_map.empty() == false)
{
std::ofstream ofs;
try
// save Galileo E1 ephemeris to XML file
file_name = xml_base_path + "gal_ephemeris.xml";
if (d_pvt_solver->galileo_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map);
LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_pvt_solver->galileo_ephemeris_map);
LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (const std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty";
}
// save GLONASS GNAV ephemeris to XML file
file_name = xml_base_path + "eph_GLONASS_GNAV.xml";
if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false)
{
std::ofstream ofs;
try
// save GLONASS GNAV ephemeris to XML file
file_name = xml_base_path + "eph_GLONASS_GNAV.xml";
if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map);
LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map);
LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty";
}
// Save GPS UTC model parameters
file_name = xml_base_path + "gps_utc_model.xml";
if (d_pvt_solver->gps_utc_model.valid)
{
std::ofstream ofs;
try
// Save GPS UTC model parameters
file_name = xml_base_path + "gps_utc_model.xml";
if (d_pvt_solver->gps_utc_model.valid)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model);
LOG(INFO) << "Saved GPS UTC model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_pvt_solver->gps_utc_model);
LOG(INFO) << "Saved GPS UTC model parameters";
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data";
}
// Save Galileo UTC model parameters
file_name = xml_base_path + "gal_utc_model.xml";
if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0)
{
std::ofstream ofs;
try
// Save Galileo UTC model parameters
file_name = xml_base_path + "gal_utc_model.xml";
if (d_pvt_solver->galileo_utc_model.Delta_tLS_6 != 0.0)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model);
LOG(INFO) << "Saved Galileo UTC model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_pvt_solver->galileo_utc_model);
LOG(INFO) << "Saved Galileo UTC model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data";
}
// Save GPS iono parameters
file_name = xml_base_path + "gps_iono.xml";
if (d_pvt_solver->gps_iono.valid == true)
{
std::ofstream ofs;
try
// Save GPS iono parameters
file_name = xml_base_path + "gps_iono.xml";
if (d_pvt_solver->gps_iono.valid == true)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono);
LOG(INFO) << "Saved GPS ionospheric model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_pvt_solver->gps_iono);
LOG(INFO) << "Saved GPS ionospheric model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data";
}
// Save GPS CNAV iono parameters
file_name = xml_base_path + "gps_cnav_iono.xml";
if (d_pvt_solver->gps_cnav_iono.valid == true)
{
std::ofstream ofs;
try
// Save GPS CNAV iono parameters
file_name = xml_base_path + "gps_cnav_iono.xml";
if (d_pvt_solver->gps_cnav_iono.valid == true)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono);
LOG(INFO) << "Saved GPS CNAV ionospheric model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_pvt_solver->gps_cnav_iono);
LOG(INFO) << "Saved GPS CNAV ionospheric model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data";
}
// Save Galileo iono parameters
file_name = xml_base_path + "gal_iono.xml";
if (d_pvt_solver->galileo_iono.ai0_5 != 0.0)
{
std::ofstream ofs;
try
// Save Galileo iono parameters
file_name = xml_base_path + "gal_iono.xml";
if (d_pvt_solver->galileo_iono.ai0_5 != 0.0)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono);
LOG(INFO) << "Saved Galileo ionospheric model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_pvt_solver->galileo_iono);
LOG(INFO) << "Saved Galileo ionospheric model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data";
}
// save GPS almanac to XML file
file_name = xml_base_path + "gps_almanac.xml";
if (d_pvt_solver->gps_almanac_map.empty() == false)
{
std::ofstream ofs;
try
// save GPS almanac to XML file
file_name = xml_base_path + "gps_almanac.xml";
if (d_pvt_solver->gps_almanac_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map);
LOG(INFO) << "Saved GPS almanac map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_pvt_solver->gps_almanac_map);
LOG(INFO) << "Saved GPS almanac map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (const std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS almanac, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save GPS almanac, map is empty";
}
// Save Galileo almanac
file_name = xml_base_path + "gal_almanac.xml";
if (d_pvt_solver->galileo_almanac_map.empty() == false)
{
std::ofstream ofs;
try
// Save Galileo almanac
file_name = xml_base_path + "gal_almanac.xml";
if (d_pvt_solver->galileo_almanac_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map);
LOG(INFO) << "Saved Galileo almanac data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_pvt_solver->galileo_almanac_map);
LOG(INFO) << "Saved Galileo almanac data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save Galileo almanac, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save Galileo almanac, not valid data";
}
// Save GPS CNAV UTC model parameters
file_name = xml_base_path + "gps_cnav_utc_model.xml";
if (d_pvt_solver->gps_cnav_utc_model.valid)
{
std::ofstream ofs;
try
// Save GPS CNAV UTC model parameters
file_name = xml_base_path + "gps_cnav_utc_model.xml";
if (d_pvt_solver->gps_cnav_utc_model.valid)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model);
LOG(INFO) << "Saved GPS CNAV UTC model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_pvt_solver->gps_cnav_utc_model);
LOG(INFO) << "Saved GPS CNAV UTC model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data";
}
// save GLONASS GNAV ephemeris to XML file
file_name = xml_base_path + "glo_gnav_ephemeris.xml";
if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false)
{
std::ofstream ofs;
try
// save GLONASS GNAV ephemeris to XML file
file_name = xml_base_path + "glo_gnav_ephemeris.xml";
if (d_pvt_solver->glonass_gnav_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map);
LOG(INFO) << "Saved GLONASS GNAV ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_pvt_solver->glonass_gnav_ephemeris_map);
LOG(INFO) << "Saved GLONASS GNAV ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty";
}
// save GLONASS UTC model parameters to XML file
file_name = xml_base_path + "glo_utc_model.xml";
if (d_pvt_solver->glonass_gnav_utc_model.valid)
{
std::ofstream ofs;
try
// save GLONASS UTC model parameters to XML file
file_name = xml_base_path + "glo_utc_model.xml";
if (d_pvt_solver->glonass_gnav_utc_model.valid)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model);
LOG(INFO) << "Saved GLONASS UTC model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_pvt_solver->glonass_gnav_utc_model);
LOG(INFO) << "Saved GLONASS UTC model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data";
}
// save BeiDou DNAV ephemeris to XML file
file_name = xml_base_path + "bds_dnav_ephemeris.xml";
if (d_pvt_solver->beidou_dnav_ephemeris_map.empty() == false)
{
std::ofstream ofs;
try
// save BeiDou DNAV ephemeris to XML file
file_name = xml_base_path + "bds_dnav_ephemeris.xml";
if (d_pvt_solver->beidou_dnav_ephemeris_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_pvt_solver->beidou_dnav_ephemeris_map);
LOG(INFO) << "Saved BeiDou DNAV Ephemeris map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_ephemeris_map", d_pvt_solver->beidou_dnav_ephemeris_map);
LOG(INFO) << "Saved BeiDou DNAV Ephemeris map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (const std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save BeiDou DNAV Ephemeris, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save BeiDou DNAV Ephemeris, map is empty";
}
// Save BeiDou DNAV iono parameters
file_name = xml_base_path + "bds_dnav_iono.xml";
if (d_pvt_solver->beidou_dnav_iono.valid)
{
std::ofstream ofs;
try
// Save BeiDou DNAV iono parameters
file_name = xml_base_path + "bds_dnav_iono.xml";
if (d_pvt_solver->beidou_dnav_iono.valid)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_pvt_solver->beidou_dnav_iono);
LOG(INFO) << "Saved BeiDou DNAV ionospheric model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_iono_model", d_pvt_solver->beidou_dnav_iono);
LOG(INFO) << "Saved BeiDou DNAV ionospheric model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save BeiDou DNAV ionospheric model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save BeiDou DNAV ionospheric model parameters, not valid data";
}
// save BeiDou DNAV almanac to XML file
file_name = xml_base_path + "bds_dnav_almanac.xml";
if (d_pvt_solver->beidou_dnav_almanac_map.empty() == false)
{
std::ofstream ofs;
try
// save BeiDou DNAV almanac to XML file
file_name = xml_base_path + "bds_dnav_almanac.xml";
if (d_pvt_solver->beidou_dnav_almanac_map.empty() == false)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_pvt_solver->beidou_dnav_almanac_map);
LOG(INFO) << "Saved BeiDou DNAV almanac map data";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_almanac_map", d_pvt_solver->beidou_dnav_almanac_map);
LOG(INFO) << "Saved BeiDou DNAV almanac map data";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (const std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (const std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save BeiDou DNAV almanac, map is empty";
}
}
else
{
LOG(INFO) << "Failed to save BeiDou DNAV almanac, map is empty";
}
// Save BeiDou UTC model parameters
file_name = xml_base_path + "bds_dnav_utc_model.xml";
if (d_pvt_solver->beidou_dnav_utc_model.valid)
{
std::ofstream ofs;
try
// Save BeiDou UTC model parameters
file_name = xml_base_path + "bds_dnav_utc_model.xml";
if (d_pvt_solver->beidou_dnav_utc_model.valid)
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_pvt_solver->beidou_dnav_utc_model);
LOG(INFO) << "Saved BeiDou DNAV UTC model parameters";
std::ofstream ofs;
try
{
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_bds_dnav_utc_model", d_pvt_solver->beidou_dnav_utc_model);
LOG(INFO) << "Saved BeiDou DNAV UTC model parameters";
}
catch (const boost::archive::archive_exception e)
{
LOG(WARNING) << e.what();
}
catch (const std::ofstream::failure& e)
{
LOG(WARNING) << "Problem opening output XML file";
}
catch (std::exception& e)
{
LOG(WARNING) << e.what();
}
}
catch (std::exception& e)
else
{
LOG(WARNING) << e.what();
LOG(INFO) << "Failed to save BeiDou DNAV UTC model parameters, not valid data";
}
}
else
{
LOG(INFO) << "Failed to save BeiDou DNAV UTC model parameters, not valid data";
}
}
catch (std::length_error& e)
{
LOG(WARNING) << e.what();
}
}

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <exception>
#include <iomanip>
#include <sstream>
@ -79,7 +80,14 @@ GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
GeoJSON_Printer::~GeoJSON_Printer()
{
GeoJSON_Printer::close_file();
try
{
GeoJSON_Printer::close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <exception>
#include <sstream>
using google::LogMessage;
@ -218,7 +219,14 @@ bool Gpx_Printer::close_file()
Gpx_Printer::~Gpx_Printer()
{
close_file();
try
{
close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed)
{
if (remove(gpx_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary GPX file";

View File

@ -36,6 +36,7 @@
#include <boost/filesystem/path.hpp> // for path, operator<<
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <exception>
#include <sstream>
using google::LogMessage;
@ -319,7 +320,14 @@ bool Kml_Printer::close_file()
Kml_Printer::~Kml_Printer()
{
close_file();
try
{
close_file();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (!positions_printed)
{
if (remove(kml_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary KML file";

View File

@ -41,6 +41,7 @@
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <cstdint>
#include <exception>
#include <fcntl.h>
#include <termios.h>
@ -118,11 +119,29 @@ Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_fi
Nmea_Printer::~Nmea_Printer()
{
if (nmea_file_descriptor.is_open())
try
{
nmea_file_descriptor.close();
if (nmea_file_descriptor.is_open())
{
nmea_file_descriptor.close();
}
}
catch (const std::ofstream::failure& e)
{
std::cerr << "Problem closing NMEA dump file: " << nmea_filename << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
try
{
close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
close_serial();
}

View File

@ -39,6 +39,7 @@
#include <algorithm> // for min and max
#include <cmath> // for floor
#include <cstdlib> // for getenv()
#include <exception>
#include <iterator>
#include <ostream>
#include <set>
@ -213,13 +214,19 @@ Rinex_Printer::~Rinex_Printer()
posmn = navMixFile.tellp();
posnr = navGloFile.tellp();
posnc = navBdsFile.tellp();
Rinex_Printer::navFile.close();
Rinex_Printer::obsFile.close();
Rinex_Printer::sbsFile.close();
Rinex_Printer::navGalFile.close();
Rinex_Printer::navGloFile.close();
Rinex_Printer::navBdsFile.close();
try
{
Rinex_Printer::navFile.close();
Rinex_Printer::obsFile.close();
Rinex_Printer::sbsFile.close();
Rinex_Printer::navGalFile.close();
Rinex_Printer::navGloFile.close();
Rinex_Printer::navBdsFile.close();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
// If nothing written, erase the files.
if (posn == 0)
{

View File

@ -38,6 +38,7 @@
#include <boost/filesystem/path_traits.hpp> // for filesystem
#include <glog/logging.h>
#include <cstdint>
#include <exception>
#include <fcntl.h> // for O_RDWR
#include <iomanip>
#include <termios.h> // for tcgetattr
@ -190,13 +191,27 @@ Rtcm_Printer::~Rtcm_Printer()
{
int64_t pos;
pos = rtcm_file_descriptor.tellp();
rtcm_file_descriptor.close();
try
{
rtcm_file_descriptor.close();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
if (pos == 0)
{
if (remove(rtcm_filename.c_str()) != 0) LOG(INFO) << "Error deleting temporary RTCM file";
}
}
close_serial();
try
{
close_serial();
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -60,6 +60,7 @@
#include "rtklib_solution.h"
#include <glog/logging.h>
#include <matio.h>
#include <exception>
#include <utility>
@ -397,6 +398,7 @@ bool rtklib_solver::save_matfile()
return true;
}
rtklib_solver::~rtklib_solver()
{
if (d_dump_file.is_open() == true)
@ -412,7 +414,14 @@ rtklib_solver::~rtklib_solver()
}
if (d_flag_dump_mat_enabled)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Exception in destructor saving the PVT .mat dump file " << ex.what();
}
}
}

View File

@ -40,6 +40,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream>
#include <utility>
@ -213,9 +214,20 @@ galileo_e5a_noncoherentIQ_acquisition_caf_cc::~galileo_e5a_noncoherentIQ_acquisi
delete d_fft_if;
delete d_ifft;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -34,6 +34,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream>
#include <utility>
@ -53,6 +54,7 @@ galileo_pcps_8ms_acquisition_cc_sptr galileo_pcps_8ms_make_acquisition_cc(
samples_per_code, dump, std::move(dump_filename)));
}
galileo_pcps_8ms_acquisition_cc::galileo_pcps_8ms_acquisition_cc(
uint32_t sampled_ms,
uint32_t max_dwells,
@ -125,9 +127,20 @@ galileo_pcps_8ms_acquisition_cc::~galileo_pcps_8ms_acquisition_cc()
delete d_ifft;
delete d_fft_if;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -38,6 +38,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream>
#include <utility>
@ -131,9 +132,20 @@ pcps_assisted_acquisition_cc::~pcps_assisted_acquisition_cc()
volk_gnsssdr_free(d_fft_codes);
delete d_ifft;
delete d_fft_if;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -40,6 +40,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream>
#include <utility>
@ -117,6 +118,7 @@ pcps_cccwsr_acquisition_cc::pcps_cccwsr_acquisition_cc(
d_channel = 0;
}
pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
{
if (d_num_doppler_bins > 0)
@ -139,12 +141,24 @@ pcps_cccwsr_acquisition_cc::~pcps_cccwsr_acquisition_cc()
delete d_ifft;
delete d_fft_if;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}
void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
std::complex<float> *code_pilot)
{
@ -165,6 +179,7 @@ void pcps_cccwsr_acquisition_cc::set_local_code(std::complex<float> *code_data,
volk_32fc_conjugate_32fc(d_fft_code_pilot, d_fft_if->get_outbuf(), d_fft_size);
}
void pcps_cccwsr_acquisition_cc::init()
{
d_gnss_synchro->Flag_valid_acquisition = false;

View File

@ -57,6 +57,7 @@
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <exception>
#include <fstream>
#include <iostream>
#include <sstream>
@ -186,9 +187,20 @@ pcps_opencl_acquisition_cc::~pcps_opencl_acquisition_cc()
delete d_fft_if;
}
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -35,6 +35,7 @@
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <sstream>
#include <utility>
@ -158,11 +159,21 @@ pcps_quicksync_acquisition_cc::~pcps_quicksync_acquisition_cc()
delete d_corr_output_f;
delete[] d_code_folded;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure& e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
// DLOG(INFO) << "END DESTROYER";
}

View File

@ -54,6 +54,7 @@
#include <gnuradio/io_signature.h>
#include <volk/volk.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <exception>
#include <sstream>
#include <utility>
@ -75,6 +76,7 @@ pcps_tong_acquisition_cc_sptr pcps_tong_make_acquisition_cc(
tong_init_val, tong_max_val, tong_max_dwells, dump, std::move(dump_filename)));
}
pcps_tong_acquisition_cc::pcps_tong_acquisition_cc(
uint32_t sampled_ms,
uint32_t doppler_max,
@ -152,12 +154,24 @@ pcps_tong_acquisition_cc::~pcps_tong_acquisition_cc()
delete d_ifft;
delete d_fft_if;
if (d_dump)
try
{
d_dump_file.close();
if (d_dump)
{
d_dump_file.close();
}
}
catch (const std::ofstream::failure &e)
{
std::cerr << "Problem closing Acquisition dump file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}
void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
{
memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
@ -168,6 +182,7 @@ void pcps_tong_acquisition_cc::set_local_code(std::complex<float> *code)
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
}
void pcps_tong_acquisition_cc::init()
{
d_gnss_synchro->Flag_valid_acquisition = false;
@ -212,6 +227,7 @@ void pcps_tong_acquisition_cc::init()
}
}
void pcps_tong_acquisition_cc::set_state(int32_t state)
{
d_state = state;
@ -244,6 +260,7 @@ void pcps_tong_acquisition_cc::set_state(int32_t state)
}
}
int pcps_tong_acquisition_cc::general_work(int noutput_items,
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items __attribute__((unused)))

View File

@ -40,6 +40,7 @@
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <limits>
#include <utility>
@ -140,7 +141,14 @@ hybrid_observables_cc::~hybrid_observables_cc()
}
if (d_dump_mat)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
}
}

View File

@ -31,6 +31,7 @@
#include "labsat23_source.h"
#include <gnuradio/io_signature.h>
#include <exception>
#include <iostream>
#include <sstream>
@ -88,9 +89,20 @@ labsat23_source::labsat23_source(const char *signal_file_basename,
labsat23_source::~labsat23_source()
{
if (binary_input_file->is_open())
try
{
binary_input_file->close();
if (binary_input_file->is_open())
{
binary_input_file->close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing input file" << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
delete binary_input_file;
}

View File

@ -58,6 +58,7 @@
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <cmath>
#include <exception>
#include <iostream>
#include <numeric>
#include <sstream>
@ -672,7 +673,14 @@ dll_pll_veml_tracking::~dll_pll_veml_tracking()
}
if (d_dump_mat)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
}
try
{

View File

@ -54,6 +54,7 @@
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <algorithm>
#include <cmath>
#include <exception>
#include <iostream>
#include <sstream>
@ -621,7 +622,14 @@ dll_pll_veml_tracking_fpga::~dll_pll_veml_tracking_fpga()
}
if (d_dump_mat)
{
save_matfile();
try
{
save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
}
try
{

View File

@ -49,6 +49,7 @@
#include <pmt/pmt.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -325,7 +326,14 @@ glonass_l1_ca_dll_pll_c_aid_tracking_cc::~glonass_l1_ca_dll_pll_c_aid_tracking_c
{
std::cout << "Writing .mat files ...";
}
glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
glonass_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -48,6 +48,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -528,7 +529,15 @@ glonass_l1_ca_dll_pll_c_aid_tracking_sc::~glonass_l1_ca_dll_pll_c_aid_tracking_s
{
std::cout << "Writing .mat files ...";
}
glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
glonass_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -47,6 +47,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -278,7 +279,15 @@ Glonass_L1_Ca_Dll_Pll_Tracking_cc::~Glonass_L1_Ca_Dll_Pll_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile();
try
{
Glonass_L1_Ca_Dll_Pll_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -47,6 +47,7 @@
#include <pmt/pmt.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -322,7 +323,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_cc::~glonass_l2_ca_dll_pll_c_aid_tracking_c
{
std::cout << "Writing .mat files ...";
}
glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
glonass_l2_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -46,6 +46,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -527,7 +528,15 @@ glonass_l2_ca_dll_pll_c_aid_tracking_sc::~glonass_l2_ca_dll_pll_c_aid_tracking_s
{
std::cout << "Writing .mat files ...";
}
glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
glonass_l2_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -47,6 +47,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -278,7 +279,15 @@ Glonass_L2_Ca_Dll_Pll_Tracking_cc::~Glonass_L2_Ca_Dll_Pll_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile();
try
{
Glonass_L2_Ca_Dll_Pll_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -40,6 +40,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -304,7 +305,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::~gps_l1_ca_dll_pll_c_aid_tracking_cc()
{
std::cout << "Writing .mat files ...";
}
gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
try
{
gps_l1_ca_dll_pll_c_aid_tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -40,6 +40,7 @@
#include <matio.h>
#include <pmt/pmt.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -305,7 +306,15 @@ gps_l1_ca_dll_pll_c_aid_tracking_sc::~gps_l1_ca_dll_pll_c_aid_tracking_sc()
{
std::cout << "Writing .mat files ...";
}
gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
try
{
gps_l1_ca_dll_pll_c_aid_tracking_sc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -48,6 +48,7 @@
#include <matio.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <memory>
#include <sstream>
@ -374,7 +375,15 @@ Gps_L1_Ca_Kf_Tracking_cc::~Gps_L1_Ca_Kf_Tracking_cc()
{
std::cout << "Writing .mat files ...";
}
Gps_L1_Ca_Kf_Tracking_cc::save_matfile();
try
{
Gps_L1_Ca_Kf_Tracking_cc::save_matfile();
}
catch (const std::exception &ex)
{
LOG(WARNING) << "Error saving the .mat file: " << ex.what();
}
if (d_channel == 0)
{
std::cout << " done." << std::endl;

View File

@ -47,6 +47,7 @@
#include <gnuradio/io_signature.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include <cmath>
#include <exception>
#include <iostream>
#include <sstream>
#include <utility>

View File

@ -29,6 +29,7 @@
*/
#include "rtklib_solver_dump_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -113,7 +114,7 @@ bool rtklib_solver_dump_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening rtklib_solver dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -126,8 +127,19 @@ bool rtklib_solver_dump_reader::open_obs_file(std::string out_file)
rtklib_solver_dump_reader::~rtklib_solver_dump_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing rtklib_solver dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -30,6 +30,7 @@
#include "spirent_motion_csv_dump_reader.h"
#include <boost/tokenizer.hpp>
#include <exception>
#include <iostream>
#include <utility>
@ -80,9 +81,20 @@ spirent_motion_csv_dump_reader::spirent_motion_csv_dump_reader()
spirent_motion_csv_dump_reader::~spirent_motion_csv_dump_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Spirent CSV dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}
@ -225,7 +237,7 @@ bool spirent_motion_csv_dump_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening Spirent CSV dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -238,8 +250,19 @@ bool spirent_motion_csv_dump_reader::open_obs_file(std::string out_file)
void spirent_motion_csv_dump_reader::close_obs_file()
{
if (d_dump_file.is_open() == false)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Spirent CSV dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -29,6 +29,7 @@
*/
#include "observables_dump_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -96,7 +97,7 @@ bool observables_dump_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening Observables dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -106,6 +107,7 @@ bool observables_dump_reader::open_obs_file(std::string out_file)
}
}
void observables_dump_reader::close_obs_file()
{
if (d_dump_file.is_open() == false)
@ -114,6 +116,7 @@ void observables_dump_reader::close_obs_file()
}
}
observables_dump_reader::observables_dump_reader(int n_channels_)
{
n_channels = n_channels_;
@ -129,9 +132,20 @@ observables_dump_reader::observables_dump_reader(int n_channels_)
observables_dump_reader::~observables_dump_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Observables dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
delete[] RX_time;
delete[] TOW_at_current_symbol_s;

View File

@ -29,6 +29,7 @@
*/
#include "tlm_dump_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -90,7 +91,7 @@ bool tlm_dump_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening TLM dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -103,8 +104,19 @@ bool tlm_dump_reader::open_obs_file(std::string out_file)
tlm_dump_reader::~tlm_dump_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing TLM dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -29,6 +29,7 @@
*/
#include "tracking_dump_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -112,7 +113,7 @@ bool tracking_dump_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -125,8 +126,19 @@ bool tracking_dump_reader::open_obs_file(std::string out_file)
tracking_dump_reader::~tracking_dump_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Tracking dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -29,6 +29,7 @@
*/
#include "tracking_true_obs_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -92,7 +93,7 @@ bool tracking_true_obs_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening Tracking dump Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -112,8 +113,19 @@ void tracking_true_obs_reader::close_obs_file()
tracking_true_obs_reader::~tracking_true_obs_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing Tracking dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}

View File

@ -29,6 +29,7 @@
*/
#include "true_observables_reader.h"
#include <exception>
#include <iostream>
#include <utility>
@ -97,7 +98,7 @@ bool true_observables_reader::open_obs_file(std::string out_file)
}
catch (const std::ifstream::failure &e)
{
std::cout << "Problem opening True observables Log file: " << d_dump_filename.c_str() << std::endl;
std::cout << "Problem opening true Observables Log file: " << d_dump_filename << std::endl;
return false;
}
}
@ -110,8 +111,19 @@ bool true_observables_reader::open_obs_file(std::string out_file)
true_observables_reader::~true_observables_reader()
{
if (d_dump_file.is_open() == true)
try
{
d_dump_file.close();
if (d_dump_file.is_open() == true)
{
d_dump_file.close();
}
}
catch (const std::ifstream::failure &e)
{
std::cerr << "Problem closing true Observables dump Log file: " << d_dump_filename << '\n';
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
}