mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-08-03 20:33:49 +00:00
The Rinex Printer destructor now erases Rinex files if they are empty.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@162 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
2406a7772a
commit
2dd2a22930
@ -55,8 +55,11 @@ DEFINE_string(RINEX_version, "3.01", "Specifies the RINEX version (2.11 or 3.01)
|
|||||||
|
|
||||||
Rinex_Printer::Rinex_Printer()
|
Rinex_Printer::Rinex_Printer()
|
||||||
{
|
{
|
||||||
Rinex_Printer::navFile.open(Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV"), std::ios::out | std::ios::app);
|
navfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_GPS_NAV");
|
||||||
Rinex_Printer::obsFile.open(Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS"), std::ios::out | std::ios::app);
|
obsfilename = Rinex_Printer::createFilename("RINEX_FILE_TYPE_OBS");
|
||||||
|
|
||||||
|
Rinex_Printer::navFile.open(navfilename, std::ios::out | std::ios::app);
|
||||||
|
Rinex_Printer::obsFile.open(obsfilename, std::ios::out | std::ios::app);
|
||||||
|
|
||||||
satelliteSystem["GPS"] = "G";
|
satelliteSystem["GPS"] = "G";
|
||||||
satelliteSystem["GLONASS"] = "R";
|
satelliteSystem["GLONASS"] = "R";
|
||||||
@ -153,8 +156,20 @@ Rinex_Printer::Rinex_Printer()
|
|||||||
Rinex_Printer::~Rinex_Printer()
|
Rinex_Printer::~Rinex_Printer()
|
||||||
{
|
{
|
||||||
// close RINEX files
|
// close RINEX files
|
||||||
|
long posn, poso;
|
||||||
|
posn = navFile.tellp();
|
||||||
|
poso = obsFile.tellp();
|
||||||
Rinex_Printer::navFile.close();
|
Rinex_Printer::navFile.close();
|
||||||
Rinex_Printer::obsFile.close();
|
Rinex_Printer::obsFile.close();
|
||||||
|
// If nothing written, erase the files.
|
||||||
|
if (posn == 0)
|
||||||
|
{
|
||||||
|
remove(navfilename.c_str());
|
||||||
|
}
|
||||||
|
if (poso == 0)
|
||||||
|
{
|
||||||
|
remove(obsfilename.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,6 +148,9 @@ private:
|
|||||||
*/
|
*/
|
||||||
std::string createFilename(std::string type);
|
std::string createFilename(std::string type);
|
||||||
|
|
||||||
|
std::string navfilename;
|
||||||
|
std::string obsfilename;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generates the data for the PGM / RUN BY / DATE line
|
* Generates the data for the PGM / RUN BY / DATE line
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user