Brief description of class still missing. More...
#include <Station.h>
Public Types | |
| enum | Status { Unknown, ToSort, Valid, Rejected } |
| enum | Type { AcquisitionUnit, ProcessingUnit, RepeaterUnit } |
Signals | |
| void | commentsRefreshed (int index) |
| void | dataChanged (int index) |
| void | rawFileError () |
| void | rawFileReady () |
| void | rawFileSize (int size) |
Public Member Functions | |
| void | abortDownloadGps () |
| void | addComment (const QString &c) |
| bool | addComponent (QChar c, const QString &file) |
| const QString & | address () const |
| double | battery () const |
| QString | buddies () const |
| bool | checkComponents () const |
| void | clearUsb () |
| QString | comments () const |
| QString | currentGpsFileName () const |
| double | diskSpace () const |
| double | distance (bool &ok) const |
| void | downloadGps () |
| SubSignalPool * | filter1 () |
| SubSignalPool * | filter2 () |
| int | frequency () const |
| QString | gpsFileName () |
| const QString & | gpsState () const |
| int | hardwareGain () const |
| int | index () const |
| bool | isAvailable () |
| QString | linkState () const |
| double | magnitude (bool &ok) const |
| const QString & | name () const |
| const QString & | name () const |
| void | navigationGps () |
| double | numberOfBits () const |
| void | powerOff () |
| SubSignalPool * | raw () |
| void | reboot () |
| void | requestComments () |
| void | rollStatus () |
| const QString & | seismicState () const |
| void | setAddress (const QString &a) |
| void | setBattery (double b) |
| void | setBuddies (const QString &b) |
| void | setComments (const QString &c) |
| void | setDiskSpace (double s) |
| void | setFrequency (int f) |
| void | setGpsState (const QString &s) |
| void | setHardwareGain (int g) |
| void | setIndex (int i) |
| void | setName (const QString &n) |
| void | setName (const QString &n) |
| void | setNumberOfBits (double n) |
| void | setSeismicParameters (const SeismicParameters ¶m) |
| void | setSeismicState (const QString &s) |
| void | setStatus (Status s) |
| void | setStatus (QString s) |
| void | setTemperature (double t) |
| void | setType (Type t) |
| void | startGps () |
| void | startSeismic () |
| Station () | |
| Station () | |
| Status | status () const |
| void | stopGps () |
| void | stopSeismic () |
| double | temperature () const |
| Type | type () const |
| ~Station () | |
| ~Station () | |
Static Public Member Functions | |
| static bool | lessThan (const Station *s1, const Station *s2) |
| static void | setSortIndex (int index) |
| static QString | statusToString (Status s) |
Brief description of class still missing.
Full description of class still missing
| enum Station::Status |
| enum Station::Type |
| Station::Station | ( | ) |
| Station::Station | ( | ) |
| void Station::abortDownloadGps | ( | ) |
References GpsLink::abortRaw(), DaemonLink::isAvailable(), and TRACE.
{
TRACE;
if(_gpsLink->isAvailable()) {
_gpsLink->abortRaw();
}
}
| void Station::addComment | ( | const QString & | c | ) |
References SystemLink::addComment(), and TRACE.
{
TRACE;
_systemLink->addComment(c);
}
| bool Station::addComponent | ( | QChar | c, |
| const QString & | file | ||
| ) |
References QGpCoreTools::endl(), index(), QGpCoreTools::tr(), and TRACE.
Referenced by Event::setId().
{
TRACE;
int index;
switch(c.unicode()) {
case '1':
case 'Z':
index=0;
break;
case '2':
case 'N':
index=1;
break;
case '3':
case 'E':
index=2;
break;
default:
App::stream() << tr("Bad component: %1").arg(c) << endl;
return false;
}
if(_components[index].isEmpty()) {
_components[index]=file;
return readDistance(file);
} else {
App::stream() << tr("Component already added with file %1 (new file %2").arg(_components[index]).arg(file) << endl;
return false;
}
}
| const QString& Station::address | ( | ) | const [inline] |
{return _address;}
| double Station::battery | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _battery;}
| QString Station::buddies | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _buddies;}
| bool Station::checkComponents | ( | ) | const |
| void Station::clearUsb | ( | ) |
References SystemLink::clearUsb(), DaemonLink::isAvailable(), and TRACE.
{
TRACE;
if(_systemLink->isAvailable()) {
_systemLink->clearUsb();
}
}
| QString Station::comments | ( | ) | const [inline] |
{return _comments;}
| void Station::commentsRefreshed | ( | int | index | ) | [signal] |
Referenced by setComments().
| QString Station::currentGpsFileName | ( | ) | const [inline] |
Referenced by DownloadGpsRaw::toRinex().
{return _currentGpsFileName;}
| void Station::dataChanged | ( | int | index | ) | [signal] |
Referenced by setBattery(), setBuddies(), setComments(), setDiskSpace(), setFrequency(), setGpsState(), setHardwareGain(), setNumberOfBits(), setSeismicState(), and setTemperature().
| double Station::diskSpace | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _diskSpace;}
| double Station::distance | ( | bool & | ok | ) | const |
Referenced by StationListModel::data(), and lessThan().
{
ok=_hasDistance;
return _distance;
}
| void Station::downloadGps | ( | ) |
References DaemonLink::isAvailable(), GpsLink::raw(), and TRACE.
{
TRACE;
if(_gpsLink->isAvailable()) {
_gpsLink->raw();
}
}
References GeopsyCore::SubSignalPool::copy(), GeopsyCore::SubSignalPool::filter(), raw(), GeopsyCore::FilterParameters::setBand(), GeopsyCore::FilterParameters::setCausal(), GeopsyCore::FilterParameters::setMaximumFrequency(), GeopsyCore::FilterParameters::setMethod(), GeopsyCore::FilterParameters::setMinimumFrequency(), GeopsyCore::SubSignalPool::setName(), GeopsyCore::FilterParameters::setOrder(), GeopsyCore::SubSignalPool::subtractValue(), and TRACE.
{
TRACE;
if(!_filter1) {
if(!_raw) {
raw();
}
FilterParameters param;
param.setMethod(FilterParameters::Butterworth);
param.setBand(FilterParameters::BandPass);
param.setMinimumFrequency(1.0);
param.setMaximumFrequency(15.0);
param.setCausal(true);
param.setOrder(4);
_filter1=new SubSignalPool;
*_filter1=_raw->copy();
_filter1->subtractValue();
_filter1->filter(param);
_filter1->setName(_name+"-filter1");
}
return _filter1;
}
References GeopsyCore::SubSignalPool::copy(), GeopsyCore::SubSignalPool::filter(), raw(), GeopsyCore::FilterParameters::setBand(), GeopsyCore::FilterParameters::setCausal(), GeopsyCore::FilterParameters::setMaximumFrequency(), GeopsyCore::FilterParameters::setMethod(), GeopsyCore::FilterParameters::setMinimumFrequency(), GeopsyCore::SubSignalPool::setName(), GeopsyCore::FilterParameters::setOrder(), GeopsyCore::SubSignalPool::subtractValue(), and TRACE.
{
TRACE;
if(!_filter2) {
if(!_raw) {
raw();
}
FilterParameters param;
param.setMethod(FilterParameters::Butterworth);
param.setBand(FilterParameters::BandPass);
param.setMinimumFrequency(0.05);
param.setMaximumFrequency(2.0);
param.setCausal(true);
param.setOrder(4);
_filter2=new SubSignalPool;
*_filter2=_raw->copy();
_filter2->subtractValue();
_filter2->filter(param);
_filter2->setName(_name+"-filter2");
}
return _filter2;
}
| int Station::frequency | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _frequency;}
| QString Station::gpsFileName | ( | ) |
References fileName, and TRACE.
Referenced by GpsLink::raw().
{
TRACE;
QString fileName=_name;
fileName.replace("WAU", "WA");
fileName="/tmp/waran/"+fileName;
QDate d=QDate::currentDate();
fileName+=QString("%1").arg(d.dayOfYear(), 3, 10, QChar('0'));
fileName+="0.";
fileName+=QString::number(d.year()).right(2);
_currentGpsFileName=fileName;
return fileName;
}
| const QString& Station::gpsState | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _gpsState;}
| int Station::hardwareGain | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _hardwareGain;}
| int Station::index | ( | ) | const [inline] |
Referenced by addComponent(), and setSortIndex().
{return _index;}
| bool Station::isAvailable | ( | ) |
References DaemonLink::isAvailable(), and TRACE.
{
TRACE;
if(!_systemLink->isAvailable()) {
clear();
return false;
}
return true;
}
| bool Station::lessThan | ( | const Station * | s1, |
| const Station * | s2 | ||
| ) | [static] |
References QGpCoreTools::abs(), COMPARE_ITEMS, distance(), name(), status(), and statusToString().
{
bool trueValue=_sortIndex>=0 ? true : false;
switch(abs(_sortIndex)) {
default: {
QString v1=s1->name();
QString v2=s2->name();
COMPARE_ITEMS;
}
case 2: {
bool ok1, ok2;
double v1=s1->distance(ok1);
double v2=s2->distance(ok2);
if(ok1 && ok2) {
COMPARE_ITEMS;
} else if(ok1) {
return trueValue;
} else {
return false;
}
}
break;
case 3: {
QString v1=Station::statusToString(s1->status());
QString v2=Station::statusToString(s2->status());
COMPARE_ITEMS;
}
}
}
| QString Station::linkState | ( | ) | const |
References AcquisitionUnit, DaemonLink::isAvailable(), and TRACE.
Referenced by StationItem::data().
{
TRACE;
QString msg;
if(!_systemLink->isAvailable()) {
if(!msg.isEmpty()) msg+="\n";
msg+="System daemon not active";
}
if(!_netLink->isAvailable()) {
if(!msg.isEmpty()) msg+="\n";
msg+="Network daemon not active";
}
if(_type==AcquisitionUnit) {
if(!_gpsLink->isAvailable()) {
if(!msg.isEmpty()) msg+="\n";
msg+="GPS daemon not active";
}
if(!_cubeLink->isAvailable()) {
if(!msg.isEmpty()) msg+="\n";
msg+="Cube deamon not active";
}
}
return msg;
}
| double Station::magnitude | ( | bool & | ok | ) | const |
{
ok=_hasMagnitude;
return _magnitude;
}
| const QString& Station::name | ( | ) | const [inline] |
Referenced by DownloadGpsRaw::addStation(), StationListModel::data(), StationItem::data(), lessThan(), Event::save(), DistanceWidget::setStations(), and DownloadGpsRaw::toRinex().
{return _name;}
| const QString& Station::name | ( | ) | const [inline] |
{return _name;}
| void Station::navigationGps | ( | ) |
References DaemonLink::isAvailable(), GpsLink::navigation(), and TRACE.
{
TRACE;
if(_gpsLink->isAvailable()) {
_gpsLink->navigation();
}
}
| double Station::numberOfBits | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _numberOfBits;}
| void Station::powerOff | ( | ) |
References DaemonLink::isAvailable(), SystemLink::powerOff(), and TRACE.
{
TRACE;
if(_systemLink->isAvailable()) {
_systemLink->powerOff();
}
}
| SubSignalPool * Station::raw | ( | ) |
References GeopsyCore::SubSignalPool::addSubPool(), GeopsyCore::geopsyCore, GeopsyCore::GeopsyCoreEngine::load(), GeopsyCore::SubSignalPool::setName(), and TRACE.
Referenced by filter1(), and filter2().
{
TRACE;
if(!_raw) {
_raw=new SubSignalPool;
for(int i=0; i<3; i++) {
SubSignalPool s=geopsyCore->load(_components[i]);
_raw->addSubPool(s);
setTimePicks();
}
_raw->setName(_name);
}
return _raw;
}
| void Station::rawFileError | ( | ) | [signal] |
Referenced by setType().
| void Station::rawFileReady | ( | ) | [signal] |
Referenced by setType().
| void Station::rawFileSize | ( | int | size | ) | [signal] |
Referenced by setType().
| void Station::reboot | ( | ) |
References DaemonLink::isAvailable(), SystemLink::reboot(), and TRACE.
{
TRACE;
if(_systemLink->isAvailable()) {
_systemLink->reboot();
}
}
| void Station::requestComments | ( | ) |
References SystemLink::comments(), and TRACE.
| void Station::rollStatus | ( | ) |
| const QString& Station::seismicState | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _seismicState;}
| void Station::setAddress | ( | const QString & | a | ) | [inline] |
{_address=a;}
| void Station::setBattery | ( | double | b | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(b!=_battery) {
_battery=b;
emit dataChanged(_index);
}
}
| void Station::setBuddies | ( | const QString & | b | ) |
References dataChanged(), and TRACE.
Referenced by NetLink::bytesAvailable().
{
TRACE;
if(b!=_buddies) {
_buddies=b;
emit dataChanged(_index);
}
}
| void Station::setComments | ( | const QString & | c | ) |
References commentsRefreshed(), dataChanged(), and TRACE.
{
TRACE;
if(c!=_comments) {
_comments=c;
emit dataChanged(_index);
}
emit commentsRefreshed(_index);
}
| void Station::setDiskSpace | ( | double | s | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(s!=_diskSpace) {
_diskSpace=s;
emit dataChanged(_index);
}
}
| void Station::setFrequency | ( | int | f | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(f!=_frequency) {
_frequency=f;
emit dataChanged(_index);
}
}
| void Station::setGpsState | ( | const QString & | s | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(s!=_gpsState) {
_gpsState=s;
emit dataChanged(_index);
}
}
| void Station::setHardwareGain | ( | int | g | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(g!=_hardwareGain) {
_hardwareGain=g;
emit dataChanged(_index);
}
}
| void Station::setIndex | ( | int | i | ) | [inline] |
{_index=i;}
| void Station::setName | ( | const QString & | n | ) | [inline] |
Referenced by Event::setId().
{_name=n;}
| void Station::setName | ( | const QString & | n | ) | [inline] |
{_name=n;}
| void Station::setNumberOfBits | ( | double | n | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(n!=_numberOfBits) {
_numberOfBits=n;
emit dataChanged(_index);
}
}
| void Station::setSeismicParameters | ( | const SeismicParameters & | param | ) |
References SeismicParameters::frequency(), SeismicParameters::hardwareGain(), DaemonLink::isAvailable(), MSG_ID, CubeLink::setFrequency(), CubeLink::setGains(), QGpCoreTools::tr(), and TRACE.
{
TRACE;
if(_cubeLink->isAvailable()) {
if(_seismicState.startsWith("stopped")) {
_cubeLink->setFrequency(param.frequency());
// General user mode cannot use a software level other than 1 (maximum bit dynamic).
_cubeLink->setGains(param.hardwareGain(), 1);
} else {
Message::warning(MSG_ID, tr("Changing seismic parameters"),
tr("Station '%1' must be stopped before any modification of its acquisition parameters").arg(_name),
Message::ok(), true);
}
}
}
| void Station::setSeismicState | ( | const QString & | s | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(s!=_seismicState) {
_seismicState=s;
emit dataChanged(_index);
}
}
| static void Station::setSortIndex | ( | int | index | ) | [inline, static] |
| void Station::setStatus | ( | Status | s | ) | [inline] |
Referenced by EventListModel::load().
{_status=s;}
| void Station::setStatus | ( | QString | s | ) |
| void Station::setTemperature | ( | double | t | ) |
References dataChanged(), and TRACE.
{
TRACE;
if(t!=_temperature) {
_temperature=t;
emit dataChanged(_index);
}
}
| void Station::setType | ( | Type | t | ) |
References AcquisitionUnit, QGpCoreTools::endl(), rawFileError(), rawFileReady(), rawFileSize(), QGpCoreTools::tr(), and TRACE.
{
TRACE;
if(_netLink || _systemLink) {
App::stream() << tr("Type of station cannot be modified") << endl;
return;
}
_type=t;
if(_type==AcquisitionUnit) {
_cubeLink=new CubeLink(this);
_gpsLink=new GpsLink(this);
connect(_gpsLink, SIGNAL(rawFileSize(int)), this, SIGNAL(rawFileSize(int)));
connect(_gpsLink, SIGNAL(rawFileReady()), this, SIGNAL(rawFileReady()));
connect(_gpsLink, SIGNAL(rawFileError()), this, SIGNAL(rawFileError()));
}
_netLink=new NetLink(this);
_systemLink=new SystemLink(this);
}
| void Station::startGps | ( | ) |
References DaemonLink::isAvailable(), GpsLink::start(), and TRACE.
{
TRACE;
if(_gpsLink->isAvailable()) {
_gpsLink->start();
}
}
| void Station::startSeismic | ( | ) |
References DaemonLink::isAvailable(), CubeLink::start(), and TRACE.
{
TRACE;
if(_cubeLink->isAvailable()) {
_cubeLink->start();
}
}
| Status Station::status | ( | ) | const [inline] |
Referenced by StationListModel::data(), lessThan(), and Event::save().
{return _status;}
| QString Station::statusToString | ( | Status | s | ) | [static] |
References Rejected, ToSort, QGpCoreTools::tr(), Unknown, and Valid.
Referenced by StationListModel::data(), EventListModel::data(), lessThan(), Event::lessThan(), and Event::save().
| void Station::stopGps | ( | ) |
References DaemonLink::isAvailable(), GpsLink::stop(), and TRACE.
{
TRACE;
if(_gpsLink->isAvailable()) {
_gpsLink->stop();
}
}
| void Station::stopSeismic | ( | ) |
References DaemonLink::isAvailable(), CubeLink::stop(), and TRACE.
{
TRACE;
if(_cubeLink->isAvailable()) {
_cubeLink->stop();
}
}
| double Station::temperature | ( | ) | const [inline] |
Referenced by StationItem::data().
{return _temperature;}
| Type Station::type | ( | ) | const [inline] |
Referenced by DistanceWidget::setStations().
{return _type;}