Commit 03c29ee7 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

undetval is now handled as double, not as string - since there is now string equality

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2895
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 1cc0e9c2
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.cc,v 1.16 2009-11-12 16:21:39 tforb Exp $
* $Id: tsoftdata.cc,v 1.17 2009-11-12 17:02:06 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -35,7 +35,7 @@
#define DATREAD_TSOFTDATA_CC_VERSION \
"DATREAD_TSOFTDATA_CC V1.0 "
#define DATREAD_TSOFTDATA_CC_CVSID \
"$Id: tsoftdata.cc,v 1.16 2009-11-12 16:21:39 tforb Exp $"
"$Id: tsoftdata.cc,v 1.17 2009-11-12 17:02:06 tforb Exp $"
#include <datreadxx/error.h>
#include <datreadxx/tsoftdata.h>
......@@ -126,7 +126,7 @@ namespace datread {
std::istringstream iss(Mline);
iss >> year >> month >> day >> hour >> minute >> second;
Mtime=libtime::TAbsoluteTime(year,month,day,hour,minute,second);
std::string sample;
double sample;
while (iss.good())
{
iss >> sample;
......@@ -139,7 +139,7 @@ namespace datread {
/*----------------------------------------------------------------------*/
//! return one sample and check index
std::string Dataline::sample(const int& i) const
double Dataline::sample(const int& i) const
{
DATREAD_assert(((i>=0)&&(i<this->nsamples())),
"index out of range");
......@@ -223,8 +223,8 @@ namespace datread {
/*----------------------------------------------------------------------*/
void Channeldata::push_sample(const libtime::TAbsoluteTime& time,
const std::string& value,
const std::string& undetval,
const double& value,
const double& undetval,
const libtime::TRelativeTime& dt,
const bool& debug)
{
......@@ -234,9 +234,6 @@ namespace datread {
{
std::cout << " yes, take this sample" << std::endl;
}
std::istringstream iss(value);
double value;
iss >> value;
// check, whether collector is already in use
bool insequence = (Mcollector.nsamples() > 0);
// if collector is in use, then check is current value matches
......@@ -260,12 +257,10 @@ namespace datread {
// class Datacontainer
void Datacontainer::push_data(const std::string& line,
const std::string& undetval,
const double& theundetval,
const libtime::TRelativeTime& dt,
const bool& debug)
{
std::string theundetval(undetval);
trimws(theundetval);
Dataline thedata(line);
if (debug)
{
......@@ -277,8 +272,7 @@ namespace datread {
// std::cout << "nsamples " << thedata.nsamples() << std::endl;
for (int ich=0; ich<thedata.nsamples(); ++ich)
{
std::string thesample(thedata.sample(ich));
trimws(thesample);
double thesample=thedata.sample(ich);
// std::cout << "ich " << ich << " sample " << thesample << std::endl;
if (debug)
{
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftdata.h,v 1.16 2009-11-12 16:21:39 tforb Exp $
* $Id: tsoftdata.h,v 1.17 2009-11-12 17:02:06 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -39,7 +39,7 @@
#define DATREAD_TSOFTDATA_H_VERSION \
"DATREAD_TSOFTDATA_H V1.0 "
#define DATREAD_TSOFTDATA_H_CVSID \
"$Id: tsoftdata.h,v 1.16 2009-11-12 16:21:39 tforb Exp $"
"$Id: tsoftdata.h,v 1.17 2009-11-12 17:02:06 tforb Exp $"
#include<iostream>
#include<string>
......@@ -218,18 +218,18 @@ namespace datread {
//! return time
libtime::TAbsoluteTime time() const { return Mtime; }
//! return vector of samples
Tvos vectorofsamples() const { return Msamples; }
Tvod vectorofsamples() const { return Msamples; }
//! return number of samples in line
int nsamples() const { return Msamples.size(); }
//! return specific sample
std::string sample(const int& i) const;
double sample(const int& i) const;
private:
//! the data line
std::string Mline;
//! time
libtime::TAbsoluteTime Mtime;
//! vector of data values
Tvos Msamples;
Tvod Msamples;
}; // class Dataline
/*----------------------------------------------------------------------*/
......@@ -321,8 +321,8 @@ namespace datread {
Channeldata();
//! push a sample
void push_sample(const libtime::TAbsoluteTime& time,
const std::string& values,
const std::string& undetval,
const double& value,
const double& undetval,
const libtime::TRelativeTime& dt,
const bool& debug=false);
//! return data trace
......@@ -383,7 +383,7 @@ namespace datread {
public:
//! push a data line
void push_data(const std::string& line,
const std::string& undetval,
const double& undetval,
const libtime::TRelativeTime& dt,
const bool& debug=false);
//! return data for specific channel
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftreader.cc,v 1.14 2009-11-12 16:34:25 tforb Exp $
* $Id: tsoftreader.cc,v 1.15 2009-11-12 17:02:06 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -35,7 +35,7 @@
#define DATREAD_TSOFTREADER_CC_VERSION \
"DATREAD_TSOFTREADER_CC V1.0 "
#define DATREAD_TSOFTREADER_CC_CVSID \
"$Id: tsoftreader.cc,v 1.14 2009-11-12 16:34:25 tforb Exp $"
"$Id: tsoftreader.cc,v 1.15 2009-11-12 17:02:06 tforb Exp $"
#include <iostream>
#include <sstream>
......@@ -162,7 +162,8 @@ namespace datread {
Mchecklist.undetval=true;
DATREAD_assert(theline.hascontent(),
"missing content in tagged line");
Mundetval=theline.thecontent();
std::istringstream iss(theline.thecontent());
iss >> Mundetval;
if (debug)
{ cout << "found undetval tag " << theline.thetag() << endl; }
}
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: tsoftreader.h,v 1.11 2009-11-11 16:21:46 tforb Exp $
* $Id: tsoftreader.h,v 1.12 2009-11-12 17:02:06 tforb Exp $
* \author Thomas Forbriger
* \date 16/09/2009
*
......@@ -39,7 +39,7 @@
#define DATREAD_TSOFTREADER_H_VERSION \
"DATREAD_TSOFTREADER_H V1.0 "
#define DATREAD_TSOFTREADER_H_CVSID \
"$Id: tsoftreader.h,v 1.11 2009-11-11 16:21:46 tforb Exp $"
"$Id: tsoftreader.h,v 1.12 2009-11-12 17:02:06 tforb Exp $"
#include<datreadxx/tsoftdata.h>
......@@ -107,7 +107,7 @@ namespace datread {
//! sampling interval
libtime::TRelativeTime Mincrement;
//! store undetval
std::string Mundetval;
double Mundetval;
//! my checklist
Checklist Mchecklist;
}; // class TSOFTfile
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment