Public Member Functions | Protected Member Functions | Protected Attributes
ToolLinearFKActive Class Reference

#include <ToolLinearFKActive.h>

Inheritance diagram for ToolLinearFKActive:
GeopsyGui::ToolBase

List of all members.

Public Member Functions

virtual bool initStations (SubSignalPool *)
virtual void setParameters (int &argc, char **argv)
 ToolLinearFKActive (QWidget *parent)
 ~ToolLinearFKActive ()

Protected Member Functions

void addArray (SubSignalPool &arraySubPool)
virtual const char * toolName ()
virtual void updateAllFields ()

Protected Attributes

QList
< LinearFKActiveArrayStations * > 
_arrays
ToolLinearFKActived_d

Constructor & Destructor Documentation

References _d, GeopsyGui::ToolBase::loadLogParameters(), GeopsyGui::ToolBase::saveLogParameters(), GeopsyGui::ToolBase::setWindowTitle(), QGpCoreTools::tr(), and TRACE.

                                                       :
    ToolBase(parent, 1)
{
  TRACE;
  setWindowIcon(QIcon(":/images/linearfkactive-22x22.png"));
  setObjectName("ToolLinearFKActive");
  QVBoxLayout * baseLayout=new QVBoxLayout(this);
  _d=new ToolLinearFKActived(this);
  baseLayout->addWidget(_d);
  setWindowTitle("Linear FK toolbox");

  connect(_d->startBut, SIGNAL(clicked()), this, SLOT(start()));
  connect(_d->currentSource, SIGNAL(currentIndexChanged(int)),
           this, SLOT(on_currentSource_currentIndexChanged(int)));
  connect(_d->minDistance, SIGNAL(valueChanged(double)), this, SLOT(timeWindowChanged()));
  connect(_d->maxDistance, SIGNAL(valueChanged(double)), this, SLOT(timeWindowChanged()));
  connect(_d->xSampling, SIGNAL(parametersChanged()), this, SLOT(setResultXAxis()));
  connect(_d->ySampling, SIGNAL(parametersChanged()), this, SLOT(setResultYAxis()));
  connect(_d, SIGNAL(slowTypeChanged()), this, SLOT(setResultYAxis()));
  connect(_d->timeLimits, SIGNAL(parametersChanged()), this, SLOT(timeWindowChanged()));
  connect(_d->loadParam, SIGNAL(clicked()), this, SLOT(loadLogParameters()));
  connect(_d->saveParam, SIGNAL(clicked()), this, SLOT(saveLogParameters()));
  connect(_d->wavelengthLimit, SIGNAL(valueChanged(double)), this, SLOT(setWavelengthLimit(double)));

  QAction * a=_d->curves->addCurveAction(tr("&Adjust"), tr("Adjust current curve to the closest maximum"), true);
  connect(a, SIGNAL(triggered()), this, SLOT(adjustCurve()) );
}

References _arrays, and TRACE.

{
  TRACE;
  qDeleteAll(_arrays);
}

Member Function Documentation

void ToolLinearFKActive::addArray ( SubSignalPool arraySubPool) [protected]
bool ToolLinearFKActive::initStations ( SubSignalPool subPool) [virtual]

Reimplemented from GeopsyGui::ToolBase.

References _arrays, GeopsyGui::ToolBase::_childrenList, _d, _linearFKResults, GeopsyGui::ToolBase::_subPool, addArray(), GeopsyCore::SubSignalPool::addSignal(), GeopsyCore::SubSignalPool::begin(), GeopsyCore::Signal::compare(), GeopsyCore::SubSignalPool::count(), GeopsyCore::SubSignalPool::end(), geopsyGui, GeopsyCore::SubSignalPool::isEmpty(), GeopsyCore::SubSignalPool::sort(), GeopsyCore::Signal::source(), GeopsyCore::Signal::t0(), GeopsyCore::Signal::timeReference(), QGpCoreTools::tr(), TRACE, and GeopsyGui::ToolBase::updateSubPool().

{
  TRACE;
  _subPool=subPool;
  // Sorting by source
  SortKey::clear();
  SortKey::add(MetaDataFactory::SourceX);
  SortKey::add(MetaDataFactory::SourceY);
  SortKey::add(MetaDataFactory::SourceZ);
  SortKey::add(MetaDataFactory::T0);
  SortKey::add(MetaDataFactory::TimeReference);
  SortKey::add(MetaDataFactory::SourceReceiverRoughAzimuth);
  SortKey::add(MetaDataFactory::SourceReceiverDistance);
  _subPool->sort();
  // Split subPool into distinct arrays
  SubSignalPool::iterator itPool=_subPool->begin();
  Signal * sig=*itPool;
  Signal * refSig=sig;
  Point s=sig->source();
  double t0=sig->t0();
  QDateTime refTime=sig->timeReference();
  SubSignalPool arraySubPool;
  arraySubPool.addSignal(sig);
  SortKey::clear();
  SortKey::add(MetaDataFactory::SourceReceiverRoughAzimuth);
  for( ++itPool;itPool!=_subPool->end();++itPool) {
    sig=*itPool;
    if(s!=sig->source() || t0!=sig->t0() || refTime!=sig->timeReference() || sig->compare(*refSig)!=0) {
      if(arraySubPool.count()>1) {
        addArray(arraySubPool);
      }
      refSig=sig;
      s=sig->source();
      t0=sig->t0();
      refTime=sig->timeReference();
    }
    arraySubPool.addSignal(sig);
  }
  if(!arraySubPool.isEmpty()) addArray(arraySubPool);
  _d->timeLimits->setPicks(_subPool);
  // setup results graphs
  _childrenList[ 0 ]=new LinearFKActiveResults;
  _childrenList[ 0 ] ->setObjectName( "LinearFKActiveResults" );
  _linearFKResults->createObjects(_arrays);
  _linearFKResults->setWindowTitle(tr("Linear fk results (%1 arrays)").arg(_arrays.count()));
  connect(_linearFKResults, SIGNAL(newPlot(LineLayer *, QString)),
           this, SLOT(addCurvePlot(LineLayer *, QString)) );
  connect(_linearFKResults, SIGNAL(newCurve(int)), this, SLOT(newLine(int)));
  geopsyGui->addWindow(_linearFKResults);
  geopsyGui->showWindow(_linearFKResults);
  for(int i=0; i<_arrays.count();i++) {
    _d->currentSource->addItem(_arrays.at(i)->name());
    _d->curves->initLayer(_linearFKResults->curveLayer(i));
    connect(_linearFKResults->sheet(), SIGNAL(activeSelectionChanged(GraphicObject *)),
             this, SLOT(graphSelected(GraphicObject *)));
  }
  emit updateSubPool();
  return true;
}
void ToolLinearFKActive::setParameters ( int &  argc,
char **  argv 
) [virtual]

By default loads parameters values from current settings. If you redefine this function do not forget to call this version before doing anything else.

Reimplemented from GeopsyGui::ToolBase.

References GeopsyGui::ToolBase::loadLogParameters(), and TRACE.

{
  TRACE;
  ToolBase::setParameters(argc, argv);
  int i, j=1;
  for(i=1; i<argc; i++) {
    QByteArray arg=argv[i];
    if(arg[0]=='-') {
      if(arg=="-param") {
        CoreApplication::checkOptionArg(i, argc, argv);
        loadLogParameters(argv[i] );
      } else {
        argv[j++]=argv[i];
      }
    } else {
      argv[j++]=argv[i];
    }
  }
  if(j < argc) {
    argv[j]=0;
    argc=j;
  }
}
const char * ToolLinearFKActive::toolName ( ) [protected, virtual]
{
  return "Linear FK Array analysis for active sources";
}
void ToolLinearFKActive::updateAllFields ( ) [protected, virtual]

Reimplemented from GeopsyGui::ToolBase.

References _d, ToolLinearFKActived::setSlownessType(), and TRACE.

{
  TRACE;
  _d->timeLimits->updateAllFields();
  _d->windowShape->updateAllFields();
  _d->ySampling->setInversed(_d->slowType->currentIndex()==1, false);
  _d->setSlownessType();
  setResultXAxis();
  timeWindowChanged();
}

Member Data Documentation


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