[1558] | 1 | // Part of BNC, a utility for retrieving decoding and
|
---|
| 2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
| 3 | //
|
---|
| 4 | // Copyright (C) 2007
|
---|
| 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 6 | // http://www.bkg.bund.de
|
---|
| 7 | // Czech Technical University Prague, Department of Geodesy
|
---|
| 8 | // http://www.fsv.cvut.cz
|
---|
| 9 | //
|
---|
| 10 | // Email: euref-ip@bkg.bund.de
|
---|
| 11 | //
|
---|
| 12 | // This program is free software; you can redistribute it and/or
|
---|
| 13 | // modify it under the terms of the GNU General Public License
|
---|
| 14 | // as published by the Free Software Foundation, version 2.
|
---|
| 15 | //
|
---|
| 16 | // This program is distributed in the hope that it will be useful,
|
---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | // GNU General Public License for more details.
|
---|
| 20 | //
|
---|
| 21 | // You should have received a copy of the GNU General Public License
|
---|
| 22 | // along with this program; if not, write to the Free Software
|
---|
| 23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
| 24 |
|
---|
| 25 | #ifndef LATENCYCHECKER_H
|
---|
| 26 | #define LATENCYCHECKER_H
|
---|
| 27 |
|
---|
| 28 | #include <QDateTime>
|
---|
[6137] | 29 | #include "satObs.h"
|
---|
[1558] | 30 |
|
---|
| 31 | class latencyChecker : public QObject {
|
---|
| 32 | Q_OBJECT
|
---|
| 33 |
|
---|
| 34 | public:
|
---|
| 35 | latencyChecker(QByteArray staID);
|
---|
| 36 | ~latencyChecker();
|
---|
[1568] | 37 | void checkReconnect();
|
---|
[1562] | 38 | void checkOutage(bool decoded);
|
---|
[6137] | 39 | void checkObsLatency(const QList<t_satObs>& obsList);
|
---|
[8082] | 40 | void checkCorrLatency(int corrGPSEpochTime, int type);
|
---|
| 41 | double currentLatency() { return _curLat;}
|
---|
[1558] | 42 |
|
---|
[8082] | 43 | class t_latency {
|
---|
| 44 | public:
|
---|
| 45 | t_latency() {
|
---|
[8689] | 46 | _oldSec = 0;
|
---|
| 47 | _newSec = 0;
|
---|
| 48 | _numGaps = 0;
|
---|
| 49 | _diffSec = 0;
|
---|
| 50 | _numLat = 0;
|
---|
| 51 | _sumLat = 0.0;
|
---|
| 52 | _sumLatQ = 0.0;
|
---|
| 53 | _meanDiff = 0.0;
|
---|
[8082] | 54 | _minLat = 1000.0;
|
---|
| 55 | _maxLat = -1000.0;
|
---|
[8689] | 56 | _curLat = 0.0;
|
---|
| 57 | _type = "";
|
---|
| 58 | _followSec = false;
|
---|
[8082] | 59 | }
|
---|
| 60 | void init() {
|
---|
| 61 | _diffSec = 0;
|
---|
| 62 | _numGaps = 0;
|
---|
| 63 | _sumLat = 0.0;
|
---|
| 64 | _sumLatQ = 0.0;
|
---|
| 65 | _numLat = 0;
|
---|
| 66 | _minLat = 1000.0;
|
---|
| 67 | _maxLat = -1000.0;
|
---|
| 68 | };
|
---|
| 69 | void print() {
|
---|
| 70 | qDebug() << _type;
|
---|
| 71 | qDebug() << "_oldSec: " << _oldSec;
|
---|
| 72 | qDebug() << "_newSec: " << _newSec;
|
---|
| 73 | qDebug() << "_numGaps: " << _numGaps;
|
---|
| 74 | qDebug() << "_diffSec: " << _diffSec;
|
---|
| 75 | qDebug() << "_numLat: " << _numLat;
|
---|
| 76 | qDebug() << "_sumLat: " << _sumLat;
|
---|
| 77 | qDebug() << "_sumLatQ: " << _sumLatQ;
|
---|
| 78 | qDebug() << "_meanDiff: " << _meanDiff;
|
---|
| 79 | qDebug() << "_minLat: " << _minLat;
|
---|
| 80 | qDebug() << "_maxLat: " << _maxLat;
|
---|
| 81 | qDebug() << "_curLat: " << _curLat;
|
---|
| 82 | qDebug() << "_followSec" << _followSec;
|
---|
| 83 | };
|
---|
| 84 | int _oldSec;
|
---|
| 85 | int _newSec;
|
---|
| 86 | int _numGaps;
|
---|
| 87 | int _diffSec;
|
---|
| 88 | int _numLat;
|
---|
| 89 | double _sumLat;
|
---|
| 90 | double _sumLatQ;
|
---|
| 91 | double _meanDiff;
|
---|
| 92 | double _minLat;
|
---|
| 93 | double _maxLat;
|
---|
| 94 | double _curLat;
|
---|
| 95 | QByteArray _type;
|
---|
| 96 | bool _followSec;
|
---|
| 97 |
|
---|
| 98 | };
|
---|
| 99 |
|
---|
| 100 | t_latency _lObs;
|
---|
| 101 | t_latency _lOrb;
|
---|
| 102 | t_latency _lClk;
|
---|
| 103 | t_latency _lClkOrb;
|
---|
| 104 | t_latency _lPb;
|
---|
| 105 | t_latency _lCb;
|
---|
| 106 | t_latency _lVtec;
|
---|
| 107 | t_latency _lUra;
|
---|
| 108 | t_latency _lHr;
|
---|
| 109 | void setCurrentLatency(double lat) {
|
---|
| 110 | _curLat = lat;
|
---|
| 111 | }
|
---|
| 112 |
|
---|
[1558] | 113 | signals:
|
---|
| 114 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
| 115 |
|
---|
| 116 | private:
|
---|
| 117 | void callScript(const char* comment);
|
---|
| 118 | int _inspSegm;
|
---|
| 119 | int _adviseFail;
|
---|
| 120 | int _adviseReco;
|
---|
[7421] | 121 | int _miscIntr;
|
---|
[1558] | 122 | int _numSucc;
|
---|
| 123 | int _secSucc;
|
---|
| 124 | int _secFail;
|
---|
| 125 | int _initPause;
|
---|
| 126 | int _currPause;
|
---|
| 127 | bool _wrongEpoch;
|
---|
[1568] | 128 | bool _checkSeg;
|
---|
[1558] | 129 | bool _begCorrupt;
|
---|
| 130 | bool _endCorrupt;
|
---|
[6759] | 131 | bool _fromReconnect;
|
---|
[6821] | 132 | bool _fromCorrupt;
|
---|
[1558] | 133 | QByteArray _staID;
|
---|
| 134 | QString _adviseScript;
|
---|
| 135 | QString _checkMountPoint;
|
---|
[6821] | 136 | QString _begDateCorr;
|
---|
| 137 | QString _begTimeCorr;
|
---|
[1558] | 138 | QString _begDateOut;
|
---|
| 139 | QString _begTimeOut;
|
---|
[6821] | 140 | QString _endDateCorr;
|
---|
| 141 | QString _endTimeCorr;
|
---|
[1558] | 142 | QString _endDateOut;
|
---|
| 143 | QString _endTimeOut;
|
---|
[1568] | 144 | QDateTime _checkTime;
|
---|
[1558] | 145 | QDateTime _decodeSucc;
|
---|
| 146 | QDateTime _decodeFailure;
|
---|
| 147 | QDateTime _decodeStart;
|
---|
| 148 | QDateTime _decodeStop;
|
---|
[6821] | 149 | QDateTime _decodeStartCorr;
|
---|
| 150 | QDateTime _decodeStopCorr;
|
---|
[1568] | 151 | QDateTime _checkPause;
|
---|
[6806] | 152 | QDateTime _begDateTimeOut;
|
---|
| 153 | QDateTime _endDateTimeOut;
|
---|
[6821] | 154 | QDateTime _begDateTimeCorr;
|
---|
| 155 | QDateTime _endDateTimeCorr;
|
---|
[8082] | 156 | double _curLat;
|
---|
[1558] | 157 | };
|
---|
| 158 |
|
---|
| 159 | #endif
|
---|