14 std::cout <<
" CocoaDaqReaderText::CocoaDaqReaderText from file " << fileName << std::endl;
26 std::vector<ALIstring> wordlist;
31 if (theFilein.getWordsInLine(wordlist) == 0) {
33 std::cout <<
"@@@@ No more measurements left" << std::endl;
42 if (wordlist[0] ==
"DATE:") {
49 std::cout <<
" Reading " << nMeas <<
" measurements from file " << theFilein.name() <<
" DATE: " << wordlist[1]
50 <<
" " << wordlist[1] << std::endl;
52 for (
ALIint im = 0; im < nMeas; im++) {
53 theFilein.getWordsInLine(wordlist);
55 wordlist[0] ==
ALIstring(
"DISTANCEMETER") || wordlist[0] ==
ALIstring(
"DISTANCEMETER1DIM") ||
57 if (wordlist.size() != 2) {
58 std::cerr <<
"!!!EXITING Model::readMeasurementsFromFile. number of words should be 2 instead of "
59 << wordlist.size() << std::endl;
63 std::vector<Measurement*>::const_iterator vmcite;
72 ALIint fcolon = (*vmcite)->name().find(
':');
74 oname = oname.substr(fcolon + 1, oname.length());
76 if (oname == wordlist[1]) {
79 if ((*vmcite)->type() != wordlist[0]) {
80 std::cerr <<
"!!! Reading measurement from file: type in file is " << wordlist[0] <<
" and should be "
81 << (*vmcite)->type() << std::endl;
89 for (
unsigned int ii = 0;
ii < meastemp->
dim();
ii++) {
90 theFilein.getWordsInLine(wordlist);
99 theFilein.ErrorInLine();
100 std::cerr <<
"!!!FATAL ERROR: Measurement value type is " << wordlist[0]
101 <<
" while in setup definition was " << meastemp->
valueType(
ii) << std::endl;
115 std::cerr <<
"MEAS: " << (*vmcite)->name() <<
" " << (*vmcite)->type() << std::endl;
117 std::cerr <<
"!!! Reading measurement from file: measurement not found in list: type in file is " << wordlist[1]
122 std::cerr <<
" wrong type of measurement: " << wordlist[0] << std::endl
123 <<
" Available types are SENSOR2D, TILTMETER, DISTANCEMETER, DISTANCEMETER1DIM, COPS" << std::endl;
129 if (theFilein.eof()) {
static ALIFileIn & getInstance(const ALIstring &name)
const ALIuint dim() const
const ALIstring valueType(ALIuint ii) const
static GlobalOptionMgr * getInstance()
~CocoaDaqReaderText() override
void fillData(ALIuint coor, const std::vector< ALIstring > &wl)
CocoaDaqReaderText(const std::string &fileName)
void setSigma(ALIint coor, ALIdouble val)
void BuildMeasurementsFromOptAlign(std::vector< OpticalAlignMeasurementInfo > &measList) override
const ALIdouble * sigma() const
bool ReadNextEvent() override
static void SetDaqReader(CocoaDaqReader *reader)
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
virtual void correctValueAndSigma()
static std::vector< Measurement * > & MeasurementList()
static void setCurrentDate(const std::vector< ALIstring > &wl)
set the date of the current measurement