GPLIB++
mtugood.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "MtuFormat.h"
3 #include "Util.h"
4 
5 using namespace std;
6 using namespace gplib;
7 
8 string version = "$Id: mtugood.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
9 
10 /*!
11  * \addtogroup UtilProgs Utility Programs
12  *@{
13  * \file
14  * Remove the "bad" flag from all records of a Phoenix mtu time-series.
15  */
16 
17 void WriteInfoAndAsk(string &infilename, string &outfilename)
18  {
19  cout << "This is mtugood: mark all records of Phoenix time series as good"
20  << endl << endl;
21  cout << " Usage: mtugood infilename outfilename ! " << endl;
22  cout
23  << " If no outfilename given ending '.good' will be automatically appended to infilename"
24  << endl << endl;
25  cout << " This is Version: " << version << endl << endl;
26  infilename = AskFilename("Infilename: ");
27  outfilename = infilename + ".good";
28  }
29 
30 int main(int argc, char *argv[])
31  {
32  string infilename, outfilename;
33  switch (argc)
34  {
35  case 2:
36  infilename = argv[1];
37  outfilename = string(argv[1]) + ".good";
38  break;
39  case 3:
40  infilename = argv[1];
41  outfilename = argv[2];
42  break;
43  default:
44  WriteInfoAndAsk(infilename, outfilename);
45  break;
46  }
47  MtuFormat Data;
48  Data.GetData(infilename);
49  Data.MakeGood();
50  Data.WriteData(outfilename);
51  }
52 /*@}*/
virtual void GetData(const std::string filename)
Definition: MtuFormat.cpp:137
void MakeGood()
remove the "bad" flag from the header
Definition: MtuFormat.cpp:158
virtual void WriteData(const std::string filename)
Definition: MtuFormat.cpp:200
int main()
Definition: angleavg.cpp:12
void WriteInfoAndAsk(string &infilename, string &outfilename)
Definition: mtu2birrp.cpp:20
Read and write phoenix mtu binary files.
Definition: MtuFormat.h:13
string version
Definition: mtugood.cpp:8