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

Brief description of class still missing. More...

#include <StationList.h>

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

List of all members.

Public Member Functions

bool addSignal (Signal *sig, QString *log=0)
bool addSignals (SubSignalPool *subPool, QString *log=0)
Signal::Components component (int index) const
StationSignals::Components components () const
bool hasAllComponents (QString *log=0) const
int nComponents () const
QList< NamedPointpointList () const
void setComponents (StationSignals::Components c)
 StationList ()
virtual ~StationList ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References TRACE, and GeopsyCore::StationSignals::UndefinedComponent.

Description of destructor still missing

References TRACE.

{
  TRACE;
  qDeleteAll( *this);
}

Member Function Documentation

bool GeopsyCore::StationList::addSignal ( Signal sig,
QString *  log = 0 
)

Add signal sig to list

References GeopsyCore::StationSignals::addSignal(), GeopsyCore::StationSignals::AnySingleComponent, GeopsyCore::StationSignals::component(), GeopsyCore::Signal::component(), components(), GeopsyCore::Signal::componentUserName(), GeopsyCore::StationSignals::coordinates(), GeopsyCore::Signal::East, GeopsyCore::StationSignals::HorizontalComponent, MSG_ID, GeopsyCore::StationSignals::name(), GeopsyCore::Signal::name(), GeopsyCore::Signal::North, GeopsyCore::Signal::receiver(), QGpCoreTools::tr(), TRACE, GeopsyCore::Signal::Vertical, and GeopsyCore::StationSignals::VerticalComponent.

Referenced by addSignals().

{
  TRACE;
  // Check for new components
  if(_components!=StationSignals::AnySingleComponent) {
    StationSignals::Components components=_components;
    switch (sig->component()) {
    case Signal::Vertical:
      components |= StationSignals::VerticalComponent;
      break;
    case Signal::North:
    case Signal::East:
      components |= StationSignals::HorizontalComponent;
      break;
    default:
      if(log)
        (*log) += tr( "Only Vertical, East or North components are allowed (%1).\n" )
                  .arg(sig->componentUserName());
      else
        Message::warning(MSG_ID, tr("Checking components"),
                              tr( "Only Vertical, East or North components are allowed (%1)." )
                              .arg(sig->componentUserName()), Message::cancel());
      return false;
    }
    if(components!=_components) {
      // Correct number of components
      for(iterator it=begin();it!=end();++it) {
        ( *it)->setComponents(components);
      }
      _components=components;
    }
    // Try to find a matching station or if it is a new station
    for(iterator it=begin();it!=end();++it) {
      StationSignals * stat=*it;
      if(stat->name()==sig->name() && stat->coordinates()==sig->receiver()) {
        return stat->addSignal(sig, log);
      }
    }
  } else {
    // Try to find a matching station or if it is a new station
    // For AnySingleComponent mode, the component must also be the same for all signals in a station
    for(iterator it=begin();it!=end();++it) {
      StationSignals * stat=*it;
      if(stat->name()==sig->name() &&
         stat->coordinates()==sig->receiver() &&
         stat->component()==sig->component()) {
        return stat->addSignal(sig, log);
      }
    }
  }
  // No station match this signal, add a new one
  StationSignals * stat=new StationSignals(_components);
  append(stat);
  return stat->addSignal(sig, log);
}
bool GeopsyCore::StationList::addSignals ( SubSignalPool subPool,
QString *  log = 0 
)

Add signals of subPool to list

References addSignal(), GeopsyCore::SubSignalPool::begin(), GeopsyCore::SubSignalPool::end(), and TRACE.

Referenced by ToolSpectrum::initStations(), ToolHV::initStations(), ToolArrayBase::initStations(), Acquisition::setSignals(), and GeopsyGui::ChronogramLayer::subPoolUpdate().

{
  TRACE;
  for(SubSignalPool::iterator it=subPool->begin(); it!=subPool->end(); it++) {
    if( !addSignal( *it, log) ) {
      return false;
    }
  }
  return true;
}
StationSignals::Components GeopsyCore::StationList::components ( ) const [inline]
bool GeopsyCore::StationList::hasAllComponents ( QString *  log = 0) const

References TRACE.

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

{
  TRACE;
  for(const_iterator it=begin();it!=end();++it) {
    if( !( *it)->hasAllComponents(log) ) return false;
  }
  return true;
}
int GeopsyCore::StationList::nComponents ( ) const [inline]

References GeopsyCore::StationSignals::coordinates(), GeopsyCore::StationSignals::name(), and TRACE.

{
  TRACE;
  QList<NamedPoint> points;
  for(const_iterator it=begin(); it!=end(); it++) {
    StationSignals& stat=**it;
    points.append(NamedPoint(stat.name(), stat.coordinates()));
  }
  return points;
}
void GeopsyCore::StationList::setComponents ( StationSignals::Components  c)

Referenced by ToolSpectrum::ToolSpectrum().

{
  _components=c;
}

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