36 #define DATRW_TSOFTREADER_CC_VERSION \ 37 "DATRW_TSOFTREADER_CC V1.1" 42 #include <datrwxx/tsoftreader.h> 57 fileid(false), timeformat(false), increment(false), channels(false),
58 units(false), undetval(false),
data(false)
80 os <<
"tag " << tag <<
" is";
81 if (!flag) { os <<
" NOT"; }
82 os <<
" present" << std::endl;
100 bool inchannels=
false;
102 std::string inputline;
104 if (debug) { std::cout <<
"<" << inputline <<
">" << endl; }
108 int linelength=theline.
theline().length();
109 if ((!indata) && (linelength > 0))
111 if (theline.
hastag() && (linelength > 0))
123 { cout <<
"found data tag " << theline.
thetag() << endl; }
130 { cout <<
"found channels tag " << theline.
thetag() << endl; }
137 { cout <<
"found units tag " << theline.
thetag() << endl; }
143 "missing content in tagged line");
145 "file ID is not TSOFT or not supported");
147 { cout <<
"found fileid tag " << theline.
thetag() << endl; }
153 "missing content in tagged line");
155 "time format is not supported");
157 { cout <<
"found timeformat tag " << theline.
thetag() << endl; }
163 "missing content in tagged line");
167 { cout <<
"found undetval tag " << theline.
thetag() << endl; }
173 "missing content in tagged line");
180 { cout <<
"found increment tag " << theline.
thetag() << endl; }
183 else if (indata && (linelength>0))
186 cout <<
"go for data line #" << count+1 << endl;
194 cout <<
"go for info for channel #" << count+1 << endl;
198 cout <<
"have access to channelinfo for channel " << count+1 << endl;
204 cout <<
"read info for channel #" << count << endl;
212 cout <<
"read units for channel #" << count << endl;
216 if (debug) { std::cout <<
"<" << inputline <<
">" << endl; }
223 std::cerr <<
"mandatory fields in input file are missing!" 228 "mandatory fields are missed");
std::string thetag() const
return tag
bool allchecked() const
check whether all are checked
#define DATRW_assert(C, M)
Check an assertion and report by throwing an exception.
libtime::TRelativeTime Mincrement
sampling interval
const char * tagdata
TSOFT data tag.
Checklist Mchecklist
my checklist
Datacontainer Mdatacontainer
store channel info
contains takes one line and splits it into tag and information.
void setunits(const std::string &line)
set unit info
double Mundetval
store undetval
libtime::TRelativeTime dt()
return sampling interval of HPMO data acquisition (i.e. 5 sec)
const char * tagtimeformat
TSOFT timeformat tag.
exception class declaration for libdatrwxx (prototypes)
static void reportitem(std::ostream &os, const char *tag, const bool &flag)
void read(std::istream &is, const bool &debug=false)
read from stream
const char *const data
keywords for consistency checks
std::string thecontent() const
return content
const char * tagunits
TSOFT units tag.
const char * tagincrement
TSOFT increment tag.
Root namespace of library.
void report(std::ostream &os) const
report check status
void setchannelinfo(const std::string &line)
set channel info
const char * tagfileid
TSOFT fileid tag.
void push_data(const std::string &line, const double &undetval, const libtime::TRelativeTime &dt, const bool &debug=false)
push a data line
void flushchannels()
flush all channels
const char * tagchannels
TSOFT channels tag.
Checklist()
default constructor
bool hascontent() const
check whether this line has a content
bool hastag() const
check whether this line has a tag
const char * TSOFTID
string constant to check TSOFT file id
std::string getDOSline(std::istream &is)
helper function getDOSline
const char * tagundetval
TSOFT undetval tag.
std::string theline() const
return line