34 #define HPMOTEST_VERSION \ 35 "HPMOTEST V1.0 test hpmo reading functions" 39 #include <tfxx/commandline.h> 41 #include <datrwxx/readhpmo.h> 54 int main(
int iargc,
char* argv[])
61 "usage: hpmotest [-v] [-s1] [-s2] [-s3] [-x] filename" "\n" 62 " or: hpmotest --help|-h" "\n" 68 "filename file to read" "\n" 70 "-s1 test reading functions of stage 1" "\n" 71 "-s2 test reading functions of stage 2" "\n" 72 "-s3 test reading functions of stage 3" "\n" 73 "-s4 test reading functions of stage 4" "\n" 74 "-x extract samples in stage 3 and 4" "\n" 78 using namespace tfxx::cmdline;
79 static Declare options[]=
101 cerr << usage_text << endl;
106 Commandline cmdline(iargc, argv, options);
109 if (cmdline.optset(0))
111 cerr << usage_text << endl;
112 cerr << help_text << endl;
141 opt.
stage1=cmdline.optset(2);
142 opt.
stage2=cmdline.optset(3);
143 opt.
stage3=cmdline.optset(4);
145 opt.
stage4=cmdline.optset(6);
148 std::string infile=cmdline.next();
150 if (opt.
verbose) { cout <<
"reading file " << infile << endl; }
158 cout << endl <<
"TEST: stage 1" << endl
159 <<
"=============" << endl;
161 std::ifstream ifs(infile.c_str());
166 while (ifs.good() && hot)
172 cout <<
"End of file!" << endl;
177 if (opt.
verbose) { cout << header; }
181 if (opt.
verbose) { cout << samples; }
193 cout << endl <<
"TEST: stage 2" << endl
194 <<
"=============" << endl;
196 std::ifstream ifs(infile.c_str());
200 cout << endl <<
"read whole file" << endl;
206 cout << endl <<
"read " << blocks.size() <<
" blocks" << endl;
208 datrw::hpmo::Tvecofblocks::const_iterator I(blocks.begin());
209 while (I!=blocks.end())
222 cout << endl <<
"TEST: stage 3" << endl
223 <<
"=============" << endl;
225 std::ifstream ifs(infile.c_str());
243 cout << std::endl <<
"next trace: " << std::endl;
259 cout << endl <<
"TEST: stage 4" << endl
260 <<
"=============" << endl;
262 std::ifstream ifs(infile.c_str());
280 cout << std::endl <<
"next trace: " << std::endl;
int main(int iargc, char *argv[])
provides all specific data reading classes (prototypes)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
aff::Series< float > Tfseries
std::vector< MinuteBlock > Tvecofblocks
within the inner reading functions, we use vector to hold minute blocks
exception class declaration for libdatrwxx (prototypes)
const char *const data
keywords for consistency checks
Class to read any type of data file.
hold samples of one minute-block
Tvecofblocks readfile(std::istream &is, const bool &verbose)
read a full data file
provide data from HP Mo (BFO data acquisition system) (prototypes)