#include <ToolLinearFKActive.h>
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 |
ToolLinearFKActive::ToolLinearFKActive | ( | QWidget * | parent | ) |
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()) ); }
void ToolLinearFKActive::addArray | ( | SubSignalPool & | arraySubPool | ) | [protected] |
References _arrays, LinearFKActiveArrayStations::addSignals(), GeopsyCore::SubSignalPool::removeAll(), LinearFKActiveArrayStations::setRelativeCoordinates(), and TRACE.
Referenced by initStations().
{ TRACE; LinearFKActiveArrayStations * array=new LinearFKActiveArrayStations; array->addSignals(&arraySubPool); if(!array->isEmpty()) { array->setRelativeCoordinates(); _arrays << array; } else delete array; arraySubPool.removeAll(); }
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.
QList<LinearFKActiveArrayStations *> ToolLinearFKActive::_arrays [protected] |
Referenced by addArray(), initStations(), and ~ToolLinearFKActive().
ToolLinearFKActived* ToolLinearFKActive::_d [protected] |
Referenced by initStations(), ToolLinearFKActive(), and updateAllFields().