Public Member Functions | Static Public Member Functions
FKMaxEntry Class Reference

Brief description of class still missing. More...

#include <FKMaxEntry.h>

Inheritance diagram for FKMaxEntry:
MaxEntry

List of all members.

Public Member Functions

double absolutePower () const
void includePower (double &minRelPow, double &maxRelPow, double &minAbsPow, double &maxAbsPow)
virtual bool readLine (QTextStream &s)
double relativePower () const
double slowness () const
virtual double value () const
double wavenumber () 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 FKMaxEntry::absolutePower ( ) const [inline]

Referenced by MaxEntryList::rejectPower(), and MaxEntryList::unselectPower().

{return _absolutePower;}
QByteArray FKMaxEntry::fields ( ) [static]

References TRACE.

Referenced by readLine(), and writeHeader().

{
  TRACE;
  return "seconds from start | cfreq | slow | az | math-phi | semblance | beampow";
}
void FKMaxEntry::includePower ( double &  minRelPow,
double &  maxRelPow,
double &  minAbsPow,
double &  maxAbsPow 
)

References TRACE.

{
  TRACE;
  if(_relativePower < minRelPow) minRelPow=_relativePower;
  if(_relativePower > maxRelPow) maxRelPow=_relativePower;
  if(_absolutePower < minAbsPow) minAbsPow=_absolutePower;
  if(_absolutePower > maxAbsPow) maxAbsPow=_absolutePower;
}
bool FKMaxEntry::isHeaderLine ( QString  f) [static]

References TRACE.

Referenced by MaxEntryList::load().

{
  TRACE;
  if(f.contains("secondsfromstart|cfreq|slow|az|math-phi|semblance|beampow")) return true;
  if(f.contains("secondsfromstart|cfreq|slow|baz|math-phi|semblance|beampow")) return true;
  if(f.contains("secondsfromstart|cfreq|slow/appvel|baz|math-phi|semblance|beampow")) return true;
  return false;
}
bool FKMaxEntry::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);
    _slowness=field.toDouble();
    field=fields.nextField(ptr);
    _azimuth=field.toDouble();
    fields.nextField(ptr); // Azimuth
    field=fields.nextField(ptr);
    _relativePower=field.toDouble();
    field=fields.nextField(ptr);
    _absolutePower=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
    _slowness*=0.001;
    return true;
  } else {
    return false;
  }
}
double FKMaxEntry::relativePower ( ) const [inline]

Referenced by MaxEntryList::rejectPower(), and MaxEntryList::unselectPower().

{return _relativePower;}
double FKMaxEntry::slowness ( ) const [inline]
{return _slowness;}
virtual double FKMaxEntry::value ( ) const [inline, virtual]

Implements MaxEntry.

{return _slowness;}
double FKMaxEntry::wavenumber ( ) const [inline]

References MaxEntry::_x.

Referenced by MaxEntryList::unselectWavenumber().

{return 2*M_PI*_x*_slowness;}
void FKMaxEntry::writeHeader ( QTextStream &  s) const [virtual]

Implements MaxEntry.

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

{
  TRACE;
  s << "# File generated by max2curve, FK post-processing\n";
  s << QString( "# %1 | selected").arg(fields().data()) << endl;
}
void FKMaxEntry::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 %8");
  double a=90.0-_azimuth;
  if(a<0.0) a+=360.0;
  s << fmt.arg(_time).arg(_x).arg(_slowness*1000.0).arg(_azimuth).arg(a)
          .arg(_relativePower).arg(_absolutePower).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