Warn if output files cannot be written.

This commit is contained in:
Carles Fernandez 2018-10-28 02:02:28 +02:00
parent b183fe63ba
commit 19dca87427
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
7 changed files with 23 additions and 6 deletions

View File

@ -594,16 +594,16 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
}
// Save GPS CNAV iono parameters
file_name = xml_base_path + "gps_iono.xml";
if (d_ls_pvt->gps_iono.valid == true)
file_name = xml_base_path + "gps_cnav_iono.xml";
if (d_ls_pvt->gps_cnav_iono.valid == true)
{
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_ls_pvt->gps_iono);
LOG(INFO) << "Saved GPS ionospheric model parameters";
xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_ls_pvt->gps_cnav_iono);
LOG(INFO) << "Saved GPS CNAV ionospheric model parameters";
}
catch (std::exception& e)
{
@ -612,10 +612,9 @@ rtklib_pvt_cc::~rtklib_pvt_cc()
}
else
{
LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data";
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_ls_pvt->galileo_iono.ai0_5 != 0.0)

View File

@ -159,6 +159,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}

View File

@ -149,6 +149,7 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}

View File

@ -161,6 +161,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}

View File

@ -92,6 +92,10 @@ Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, boo
{
DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str();
}
else
{
std::cout << "File " << nmea_filename << " cannot be saved. Wrong permissions?" << std::endl;
}
}
nmea_devname = nmea_dump_devname;

View File

@ -97,6 +97,13 @@ Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path)
Rinex_Printer::navMixFile.open(navMixfilename, std::ios::out | std::ios::in | std::ios::app);
Rinex_Printer::navGloFile.open(navGlofilename, std::ios::out | std::ios::in | std::ios::app);
if (!Rinex_Printer::navFile.is_open() or !Rinex_Printer::obsFile.is_open() or
!Rinex_Printer::sbsFile.is_open() or !Rinex_Printer::navGalFile.is_open() or
!Rinex_Printer::navMixFile.is_open() or !Rinex_Printer::navGloFile.is_open())
{
std::cout << "RINEX files cannot be saved. Wrong permissions?" << std::endl;
}
// RINEX v3.02 codes
satelliteSystem["GPS"] = "G";
satelliteSystem["GLONASS"] = "R";

View File

@ -135,6 +135,10 @@ Rtcm_Printer::Rtcm_Printer(std::string filename, bool flag_rtcm_file_dump, bool
{
DLOG(INFO) << "RTCM printer writing on " << rtcm_filename.c_str();
}
else
{
std::cout << "File " << rtcm_filename << "cannot be saved. Wrong permissions?" << std::endl;
}
}
rtcm_devname = rtcm_dump_devname;