Public Member Functions | Static Public Member Functions
SPACMaxEntry Class Reference

Brief description of class still missing. More...

#include <SPACMaxEntry.h>

Inheritance diagram for SPACMaxEntry:
MaxEntry

List of all members.

Public Member Functions

double autocorr () const
int component () const
virtual bool readLine (QTextStream &s)
int ring () const
virtual double value () const
virtual void writeHeader (QTextStream &s) const
virtual void writeLine (QTextStream &s) const

Static Public Member Functions

static QByteArray fields ()
static bool isHeaderLine (QString f)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Function Documentation

double SPACMaxEntry::autocorr ( ) const [inline]
{return _autocorr;}
int SPACMaxEntry::component ( ) const [inline]

Referenced by MaxEntryList::keepComponent().

{return _component;}
QByteArray SPACMaxEntry::fields ( ) [static]

References TRACE.

Referenced by readLine(), and writeHeader().

{
  TRACE;
  return "seconds from start | cfreq | icomp | iring | autocorr";
}
bool SPACMaxEntry::isHeaderLine ( QString  f) [static]

References TRACE.

Referenced by MaxEntryList::load().

{
  TRACE;
  return f.contains("secondsfromstart|cfreq|icomp|iring|autocorr");
}
bool SPACMaxEntry::readLine ( QTextStream &  s) [virtual]

Implements MaxEntry.

References MaxEntry::_selected, MaxEntry::_time, MaxEntry::_x, fields(), QGpCoreTools::StringSection::isValid(), QGpCoreTools::StringSection::nextField(), QGpCoreTools::StringSection::toDouble(), QGpCoreTools::StringSection::toInt(), and TRACE.

{
  TRACE;
  QString line;
  do {
    line=s.readLine();
  } while(!line.isEmpty() && line[0]=='#');
  if(!line.isEmpty()) {
    const QChar * ptr=0;
    StringSection field,fields(line);
    field=fields.nextField(ptr);
    _time=field.toDouble();
    field=fields.nextField(ptr);
    _x=field.toDouble();
    field=fields.nextField(ptr);
    _component=field.toInt();
    field=fields.nextField(ptr);
    _ring=field.toInt();
    field=fields.nextField(ptr);
    _autocorr=field.toDouble();
    field=fields.nextField(ptr);
    if(field.isValid())
      _selected=field.toInt()>0 ? true : false;
    else
      _selected=true; // compatibility with format out of Geopsy and Cap
    return true;
  } else {
    return false;
  }
}
int SPACMaxEntry::ring ( ) const [inline]

Referenced by MaxEntryList::keepRing().

{return _ring;}
virtual double SPACMaxEntry::value ( ) const [inline, virtual]

Implements MaxEntry.

{return _autocorr;}
void SPACMaxEntry::writeHeader ( QTextStream &  s) const [virtual]

Implements MaxEntry.

References QGpCoreTools::endl(), fields(), and TRACE.

{
  TRACE;
  s << "# File generated by max2curve, SPAC post-processing\n";
  s << QString( "# %1 | selected").arg(fields().data()) << endl;
}
void SPACMaxEntry::writeLine ( QTextStream &  s) const [virtual]

Implements MaxEntry.

References MaxEntry::_selected, MaxEntry::_time, MaxEntry::_x, QGpCoreTools::endl(), and TRACE.

{
  TRACE;
  static const QString fmt("%1 %2 %3 %4 %5 %6");
  s << fmt.arg(_time).arg(_x).arg(_component).arg(_ring).arg(_autocorr).arg(_selected) << endl;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines