99 "usage: thiesdl1test [-v] [-h] [-f] [-trs] [-twt] [-stream] [-count]\n" 100 " [-int] [-np n] [-modifiers m]\n" 101 " file [file ...]" "\n" 102 " or: thiesdl1test --help|-h" "\n" 110 "-h read file header and report entries\n" 111 "-f read complete file and report entries\n" 112 "-trs tolerate redundant samples\n" 113 "-twt tolerate wrong time\n" 114 "-stream use stream interface\n" 115 "-count only count samples in stream mode\n" 116 "-int use integer reading in stream mode\n" 117 "-np n display n samples in stream mode\n" 118 "-modifiers m use modifiers m in stream mode\n" 122 using namespace tfxx::cmdline;
123 static Declare options[]=
138 {
"stream",arg_no,
"-"},
140 {
"count",arg_no,
"-"},
146 {
"modifiers",arg_yes,
""},
153 cerr << usage_text << endl;
158 Commandline cmdline(iargc, argv, options);
161 if (cmdline.optset(0))
163 cerr << usage_text << endl;
164 cerr << help_text << endl;
177 opt.
nprint=cmdline.int_arg(9);
202 while (cmdline.extra())
204 std::string filename=cmdline.next();
205 cout <<
"process file " << filename << endl;
211 cout <<
" read header\n" 212 <<
" -----------" << endl;
223 cout <<
" read file\n" 224 <<
" ---------" << endl;
230 file.readwithheader(ifs);
242 std::ifstream ifs(filename.c_str());
248 cout <<
"file FREE block:" << endl;
249 is.free().write(std::cout);
253 cout <<
"file has FREE block" << endl;
258 cout <<
"file has no FREE block" << endl;
264 cout <<
"file SRCE line:" << endl;
265 cout << is.srce().line() << endl;;
269 cout <<
"file has SRCE line" << endl;
274 cout <<
"file has no SRCE line" << endl;
298 cout <<
"trace FREE block:" << endl;
299 is.free().write(std::cout);
303 cout <<
"trace has FREE block" << endl;
308 cout <<
"trace has no FREE block" << endl;
314 cout <<
"trace INFO line:" << endl;
315 cout << is.info().line() << endl;;
319 cout <<
"trace has INFO line" << endl;
324 cout <<
"trace has no INFO line" << endl;
326 std::cout << is.wid2().line() << std::endl;
332 opt.
nprint < int(iseries.size()/2) ?
333 opt.
nprint : iseries.size()/2;
334 for (
int i=0; i<npr; ++i)
335 { std::cout << i <<
" " << iseries(i) << std::endl; }
336 std::cout <<
" ... " << std::endl;
337 for (
int i=iseries.size()-npr; i<int(iseries.size()); ++i)
338 { std::cout << i <<
" " << iseries(i) << std::endl; }
343 opt.
nprint < int(fseries.size()/2) ?
344 opt.
nprint : fseries.size()/2;
345 for (
int i=0; i<npr; ++i)
346 { std::cout << i <<
" " << fseries(i) << std::endl; }
347 std::cout <<
" ... " << std::endl;
348 for (
int i=fseries.size()-npr; i<int(fseries.size()); ++i)
349 { std::cout << i <<
" " << fseries(i) << std::endl; }
void reportheader(const datrw::thiesdl1::FileHeader &header)
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
FileHeader readheader(std::istream &is)
Read and parse a file header.
aff::Series< float > Tfseries
class to read Thies DL1 data
void tolerateredundant(const bool flag=true)
set tolerance for redundant samples
aff::Series< double > Tdseries
void reportfilled(const datrw::thiesdl1::File &f)
#define THIESDL1TEST_VERSION
aff::Series< int > Tiseries
void dump(std::ostream &os, const SampleBlock &block)
dump one block of samples
static const std::ios_base::openmode openmode