Brief description of class still missing. More...
#include <StationList.h>
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< NamedPoint > | pointList () const |
| void | setComponents (StationSignals::Components c) |
| StationList () | |
| virtual | ~StationList () |
Brief description of class still missing.
Full description of class still missing
Description of constructor still missing
References TRACE, and GeopsyCore::StationSignals::UndefinedComponent.
{
TRACE;
_components=StationSignals::UndefinedComponent;
}
| GeopsyCore::StationList::~StationList | ( | ) | [virtual] |
| 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;
}
| Signal::Components GeopsyCore::StationList::component | ( | int | index | ) | const [inline] |
References GeopsyCore::StationSignals::component().
Referenced by ToolArrayBase::initStations(), and GeopsyGui::ChronogramLayer::name().
{return StationSignals::component(index, _components);}
| StationSignals::Components GeopsyCore::StationList::components | ( | ) | const [inline] |
Referenced by addSignal(), ToolLinearFKPassive::initStations(), ToolHV::initStations(), ToolSPAC::initStations(), SPACLoopTask::run(), HRFKTimeWindows::setArray(), FKTimeWindows::setArray(), and FKLoop::setParameters().
{return _components;}
| bool GeopsyCore::StationList::hasAllComponents | ( | QString * | log = 0 | ) | const |
References TRACE.
Referenced by LinearFKActiveArrayStations::addSignals(), ToolHV::initStations(), ToolArrayBase::initStations(), and Acquisition::setSignals().
| int GeopsyCore::StationList::nComponents | ( | ) | const [inline] |
References GeopsyCore::StationSignals::nComponents().
Referenced by GeopsyGui::ChronogramLayer::boundingRect(), GeopsyGui::ChronogramLayer::exportGaps(), ToolArrayBase::initStations(), GeopsyGui::ChronogramLayer::name(), GeopsyGui::ChronogramLayer::rangeUpdate(), GeopsyGui::ChronogramLayer::selection(), SPACLoop::setParameters(), SPACLoopTask::setParameters(), and ToolArrayBase::setTimeWindowLayer().
{return StationSignals::nComponents(_components);}
| QList< NamedPoint > GeopsyCore::StationList::pointList | ( | ) | const |
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;
}