Public Member Functions | Protected Member Functions
MagnetoTelluricReader Class Reference

Brief description of class still missing. More...

#include <MagnetoTelluricReader.h>

Inheritance diagram for MagnetoTelluricReader:
QGpCoreTools::ArgumentStdinReader

List of all members.

Public Member Functions

 MagnetoTelluricReader ()
bool setOptions (int &argc, char **argv)

Protected Member Functions

virtual bool parse (QTextStream &s)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References QGpCoreTools::LogScale, and TRACE.

    : ArgumentStdinReader()
{
  TRACE;
  _samplingType=LogScale;
  _nSamples=10;
  _minRange=1000;
  _maxRange=100000;
  _outputMode=MagnetoTelluricPointOptions::ApparentResistivity;
}

Member Function Documentation

bool MagnetoTelluricReader::parse ( QTextStream &  s) [protected, virtual]
bool MagnetoTelluricReader::setOptions ( int &  argc,
char **  argv 
)

References QGpCoreTools::endl(), QGpCoreTools::InversedScale, QGpCoreTools::LinearScale, QGpCoreTools::LogScale, QGpCoreTools::tr(), and TRACE.

Referenced by main().

{
  TRACE;
  // Check arguments
  int i, j=1;
  for(i=1; i<argc; i++) {
    QByteArray arg=argv[i];
    if(arg[0]=='-') {
      if(arg=="-s") {
        CoreApplication::checkOptionArg(i, argc, argv);
        if(strcmp(argv[i],"period")==0) {
          _samplingType=InversedScale;
        } else if(strcmp(argv[i],"frequency")==0) {
          _samplingType=LinearScale;
        } else {
          _samplingType=LogScale;
        }
      } else if(arg=="-min") {
        CoreApplication::checkOptionArg(i, argc, argv);
        _minRange=atof(argv[i]);
        if(_minRange<=0) {
          App::stream() << tr("gpmt: negative or null value for -min") << endl;
          return false;
        }
      } else if(arg=="-max") {
        CoreApplication::checkOptionArg(i, argc, argv);
        _maxRange=atof(argv[i]);
        if(_maxRange<=0) {
          App::stream() << tr("gpmt: negative or null value for -max") << endl;
          return false;
        }
      } else if(arg=="-n") {
        CoreApplication::checkOptionArg(i, argc, argv);
        _nSamples=atoi(argv[i]);
        if(_nSamples<=0) {
          App::stream() << tr("gpmt: negative or null number of samples (option -n)") << endl;
          return false;
        }
      } else if(arg=="-apparent-resistivity") {
        _outputMode=MagnetoTelluricPointOptions::ApparentResistivity;
      } else if(arg=="-phase" || arg=="-phase-degrees") {
        _outputMode=MagnetoTelluricPointOptions::PhaseDegrees;
      } else if(arg=="-phase-radians") {
        _outputMode=MagnetoTelluricPointOptions::PhaseDegrees;
      } else if(arg=="-abs") {
        _outputMode=MagnetoTelluricPointOptions::AbsoluteValue;
      } else if(arg=="-real") {
        _outputMode=MagnetoTelluricPointOptions::Real;
      } else if(arg=="-imaginary") {
        _outputMode=MagnetoTelluricPointOptions::Imaginary;
      } else {
        App::stream() << tr("gpmt: bad option %1, see -help").arg(argv[i]) << endl;
        return false;
      }
    } else {
      argv[j++]=argv[i];
    }
  }
  if(j < argc) {
    argv[j]=0;
    argc=j;
  }
  return true;
}

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