mtu2birrp.cpp
Go to the documentation of this file.00001 #include <iostream>
00002 #include <string>
00003 #include "Util.h"
00004 #include "TimeSeriesData.h"
00005 #include "FatalException.h"
00006
00007 using namespace std;
00008 using namespace gplib;
00009
00010 string version = "$Id: mtu2birrp.cpp 1816 2009-09-07 11:28:35Z mmoorkamp $";
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 void WriteInfoAndAsk(string &infilename, string &outfilename)
00021 {
00022 cout << "This is mtu2birrp: Convert Phoenix time series to birrp-ascii"
00023 << endl << endl;
00024 cout << "Usage: mtu2birrp infilename outfilename" << endl;
00025 cout << "Ending .asc will be automatically assigned to outfilename" << endl
00026 << endl;
00027 cout << "This is Version: " << version << endl << endl;
00028 infilename = AskFilename("Input Filename: ");
00029 cout << "Birrp-Ascii-Filename without extension: ";
00030 cin >> outfilename;
00031 }
00032 int main(int argc, char *argv[])
00033 {
00034 string infilename, outfilename;
00035 switch (argc)
00036 {
00037 case 2:
00038 infilename = argv[1];
00039 outfilename = argv[1];
00040 break;
00041 case 3:
00042 infilename = argv[1];
00043 outfilename = argv[2];
00044 break;
00045 default:
00046 WriteInfoAndAsk(infilename, outfilename);
00047 break;
00048 }
00049
00050 TimeSeriesData Data;
00051 try
00052 {
00053 Data.GetData(infilename);
00054 Data.WriteAsBirrp(outfilename);
00055 } catch (const FatalException &e)
00056 {
00057 cerr << e.what() << endl;
00058 }
00059 }
00060