All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
ArrayCore::ArrayStations Class Reference

Brief description of class still missing. More...

#include <ArrayStations.h>

Inheritance diagram for ArrayCore::ArrayStations:
GeopsyCore::StationList LinearFKActiveArrayStations

List of all members.

Public Member Functions

 ArrayStations ()
bool hasCompatibleStations (QString *log=0) const
Rect rectangle () const
const Point2DrelativeCoordinates (int station) const
void setRelativeCoordinates ()
 ~ArrayStations ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References TRACE.

{
  TRACE;
  _relativeCoordinates=0;
}

Description of destructor still missing

References TRACE.

{
  TRACE;
  delete _relativeCoordinates;
}

Member Function Documentation

bool ArrayCore::ArrayStations::hasCompatibleStations ( QString *  log = 0) const

Check compatibility of stations (t0 and deltaT). No longer usefull with sparse time range: returns always true

References TRACE.

Referenced by LinearFKActiveArrayStations::addSignals(), ToolArrayBase::initStations(), and Acquisition::setSignals().

{
  TRACE;
  /*if(isEmpty()) return true;
  const_iterator it=begin();
  double refDeltaT=(*it)->deltaT();
  double refT0=(*it)->t0();
  for(it++;it!=end();++it) {
    StationSignals * stat=*it;
    if(refDeltaT!=stat->deltaT()) {
      if(log)
        (*log) += tr("Checking station compatibility: the sampling rate is not compatible for station %1.\n" )
                  .arg(stat->name());
      else
        Message::warning(MSG_ID, tr("Checking station compatibility"),
                              tr( "The sampling rate is not compatible for station %1." )
                              .arg(stat->name()), Message::cancel());
      return false;
    }
    double nDeltaT0=fabs(refT0 - stat->t0())/refDeltaT;
    if(nDeltaT0 - round(nDeltaT0) > 0.01 * refDeltaT) {
      if(log)
        (*log) += tr("Checking station compatibility: the differences between t0s must be a multiple of "
                     "the sampling period for station %1.\n" ).arg(stat->name());
      else
        Message::warning(MSG_ID, tr("Checking station compatibility"),
                            tr( "The differences between t0s must be a multiple of "
                                "the sampling period for station %1" ).arg(stat->name()),
                            Message::cancel());
      return false;
    }
  }*/
  return true;
}

Return enclosing rectangle

References QGpCoreTools::Rect::add(), and TRACE.

{
  TRACE;
  Rect r;
  for(const_iterator it=begin();it!=end();++it) {
    const Point& p=( *it) ->coordinates();
    r.add(p);
  }
  return r;
}
const Point2D& ArrayCore::ArrayStations::relativeCoordinates ( int  station) const [inline]

Get array central point The center is usefull to use relative coordinates and hence to avoid big number computations

Reimplemented in LinearFKActiveArrayStations.

References TRACE.

Referenced by ToolFK::initStations().

{
  TRACE;
  Point2D c;
  for(const_iterator it=begin();it!=end();++it) {
    c += ( *it) ->coordinates();
  }
  c /= (double) count();
  delete _relativeCoordinates;
  _relativeCoordinates=new Point2D[count()];
  for(int i=count()-1; i>=0; i-- ) {
    _relativeCoordinates[i]=at(i)->coordinates();
    _relativeCoordinates[i] -= c;
  }
}

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