Public Member Functions | Static Public Member Functions
TFAMaxEntry Class Reference

Brief description of class still missing. More...

#include <TFAMaxEntry.h>

Inheritance diagram for TFAMaxEntry:
MaxEntry

List of all members.

Public Member Functions

double delay () const
double hAmplitude () const
double hv () const
void includeAmplitude (double &minVAmplitude, double &maxVAmplitude)
virtual bool operator< (const MaxEntry &o) const
virtual bool readLine (QTextStream &s)
virtual double value () const
double vAmplitude () 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 TFAMaxEntry::delay ( ) const [inline]

Referenced by MaxEntryList::rejectDelay().

{return _delay;}
QByteArray TFAMaxEntry::fields ( ) [static]

References TRACE.

Referenced by readLine(), and writeHeader().

{
  TRACE;
  return "seconds from start | cfreq | H/V | AmpZ | AmpH | Delay";
}
double TFAMaxEntry::hAmplitude ( ) const [inline]

Referenced by MaxEntryList::rejectAmplitudeHorizontalAbsolute().

{return _hAmplitude;}
double TFAMaxEntry::hv ( ) const [inline]
{return _hv;}
void TFAMaxEntry::includeAmplitude ( double &  minVAmplitude,
double &  maxVAmplitude 
)

References TRACE.

{
  TRACE;
  if(_vAmplitude < minVAmplitude) minVAmplitude=_vAmplitude;
  if(_vAmplitude > maxVAmplitude) maxVAmplitude=_vAmplitude;
}
bool TFAMaxEntry::isHeaderLine ( QString  f) [static]

References TRACE.

Referenced by MaxEntryList::load().

{
  TRACE;
  return f.contains("secondsfromstart|cfreq|h/v|ampz|amph|delay");
}
bool TFAMaxEntry::operator< ( const MaxEntry o) const [virtual]

Reimplemented from MaxEntry.

References TRACE, value(), MaxEntry::value(), and MaxEntry::x().

{
  TRACE;
  if(x()<o.x()) return true;
  else if(x()>o.x()) return false;
  const TFAMaxEntry& m=static_cast<const TFAMaxEntry&>(*this);
  const TFAMaxEntry& mo=static_cast<const TFAMaxEntry&>(o);
  if(m._vAmplitude>mo._vAmplitude) return true;
  else if(m._vAmplitude<mo._vAmplitude) return false;
  if(value()<o.value()) return true;
  else return false;
}
bool TFAMaxEntry::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);
    _hv=field.toDouble();
    field=fields.nextField(ptr);
    _vAmplitude=field.toDouble();
    field=fields.nextField(ptr);
    _hAmplitude=field.toDouble();
    field=fields.nextField(ptr);
    _delay=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;
  }
}
virtual double TFAMaxEntry::value ( ) const [inline, virtual]

Implements MaxEntry.

Referenced by operator<().

{return _hv;}
double TFAMaxEntry::vAmplitude ( ) const [inline]
void TFAMaxEntry::writeHeader ( QTextStream &  s) const [virtual]

Implements MaxEntry.

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

{
  TRACE;
  s << "# File generated by max2curve, TFA post-processing\n";
  s << QString( "# %1 | selected").arg(fields().data()) << endl;
}
void TFAMaxEntry::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 %7");
  s << fmt.arg(_time).arg(_x).arg(_hv).arg(_vAmplitude).arg(_hAmplitude).arg(_delay).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