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

Brief description of class still missing. More...

#include <SPACLoop.h>

Inheritance diagram for SPACLoop:
QGpCoreTools::ParallelLoop

List of all members.

Public Member Functions

void addLog (const QString &s) const
const ArrayStationsarray () const
void lockOutputMax () const
void lockOutputStmap (int iComp) const
QFile * outputMax () const
QFile * outputStmap (int iComp) const
const RingCouplesring (int index) const
void setArray (const ArrayStations *a)
void setLog (QString *l)
bool setParameters (SPACParameters *p)
 SPACLoop ()
AutocorrCurvestarget () const
void unlockOutputMax () const
void unlockOutputStmap (int iComp) const
 ~SPACLoop ()

Protected Member Functions

virtual LoopTasknewTask ()

Protected Attributes

const ArrayStations_array
const SPACParameters_param

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References _array, _param, and TRACE.

{
  TRACE;
  _target=0;
  for(int i=0; i<3; i++) {
    _dotstmaps[i]=0;
  }
  _dotmax=0;
  _log=0;
  _param=0;
  _array=0;
}

Description of destructor still missing

References _param, DinverDCCore::TargetList::autocorrTarget(), ArrayCore::ArrayParameters::outputFile(), DinverDCCore::AutocorrTarget::setCurves(), TRACE, and QGpCoreTools::XMLHeader::xml_saveFile().

{
  TRACE;
  if(_target) {
    TargetList tl;
    tl.autocorrTarget().setCurves( *_target);
    XMLHeader hdr(&tl);
    hdr.xml_saveFile(_param->outputFile()+".target");
    delete _target;
  }
  for(int i=0; i<3; i++) {
    delete _dotstmaps[i];
  }
  delete _dotmax;
  delete _param;
}

Member Function Documentation

void SPACLoop::addLog ( const QString &  s) const

References TRACE.

Referenced by SPACLoopTask::run(), and setParameters().

{
  TRACE;
  if(_log) {
    _logMutex.lock();
    (*_log) += s;
    _logMutex.unlock();
  }
}
const ArrayStations* SPACLoop::array ( ) const [inline]

References _array.

Referenced by SPACLoopTask::run(), setArray(), and SPACLoopTask::setParameters().

{return _array;}
void SPACLoop::lockOutputMax ( ) const [inline]
{_outputMutex[3].lock();}
void SPACLoop::lockOutputStmap ( int  iComp) const [inline]

Referenced by SPACLoopTask::run().

{_outputMutex[iComp].lock();}
LoopTask * SPACLoop::newTask ( ) [protected, virtual]
QFile* SPACLoop::outputMax ( ) const [inline]
{return _dotmax;}
QFile* SPACLoop::outputStmap ( int  iComp) const [inline]

Referenced by SPACLoopTask::run().

{return _dotstmaps[iComp];}
const RingCouples& SPACLoop::ring ( int  index) const [inline]

References _param, and ArrayCore::SPACParameters::ring().

{return _param->ring(index);}
void SPACLoop::setArray ( const ArrayStations a)

References _array, array(), and TRACE.

void SPACLoop::setLog ( QString *  l) [inline]
{_log=l;}

References _array, _param, addLog(), ArrayCore::RingCouples::log(), MSG_ID, GeopsyCore::StationList::nComponents(), ArrayCore::ArrayParameters::outputFile(), ArrayCore::SPACParameters::outputTypes(), ArrayCore::SPACParameters::overWrite(), ArrayCore::SPACParameters::ring(), ArrayCore::SPACParameters::ringCount(), QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  ASSERT(_array);
  _param=p;
  if(_param->outputFile().isEmpty() || !p->overWrite(_array->nComponents())) {
    return false;
  }
  if(_param->ringCount()==0) {
    Message::warning(MSG_ID, tr("SPAC toolbox"),
                         tr("You forgot to define the rings\n"), Message::cancel());
    return false;
  }
  if(_param->outputTypes() & SPACParameters::Target) {
    setTarget();
  }
  if(_param->outputTypes() & SPACParameters::Stmap) {
    setStmap();
  }
  if(_param->outputTypes() & SPACParameters::Max) {
    setMax();
  }
  // Write ring log
  int nRings=_param->ringCount();
  for(int iRing=0;iRing < nRings;iRing++ ) {
    addLog(_param->ring(iRing).log());
  }
  return true;
}
AutocorrCurves* SPACLoop::target ( ) const [inline]

Referenced by SPACLoopTask::run().

{return _target;}
void SPACLoop::unlockOutputMax ( ) const [inline]
{_outputMutex[3].unlock();}
void SPACLoop::unlockOutputStmap ( int  iComp) const [inline]

Referenced by SPACLoopTask::run().

{_outputMutex[iComp].unlock();}

Member Data Documentation

const ArrayStations* SPACLoop::_array [protected]
const SPACParameters* SPACLoop::_param [protected]

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