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>
|
---|
29 | #include "satObs.h"
|
---|
30 |
|
---|
31 | class latencyChecker : public QObject {
|
---|
32 | Q_OBJECT
|
---|
33 |
|
---|
34 | public:
|
---|
35 | latencyChecker(QByteArray staID);
|
---|
36 | ~latencyChecker();
|
---|
37 | void checkReconnect();
|
---|
38 | void checkOutage(bool decoded);
|
---|
39 | void checkObsLatency(const QList<t_satObs>& obsList);
|
---|
40 | void checkCorrLatency(int corrGPSEpochTime, int type);
|
---|
41 | double currentLatency() { return _curLat;}
|
---|
42 | //QByteArray currentLatencyType() {return l._type;}
|
---|
43 |
|
---|
44 | class t_latency {
|
---|
45 | public:
|
---|
46 | t_latency() {
|
---|
47 | _oldSec = -1;
|
---|
48 | _newSec = -1;
|
---|
49 | _numGaps = 0;
|
---|
50 | _diffSec = 0;
|
---|
51 | _numLat = 0;
|
---|
52 | _sumLat = 0.0;
|
---|
53 | _sumLatQ = 0.0;
|
---|
54 | _meanDiff = 0.0;
|
---|
55 | _minLat = 1000.0;
|
---|
56 | _maxLat = -1000.0;
|
---|
57 | _curLat = 0.0;
|
---|
58 | _type = "";
|
---|
59 | _followSec = false;
|
---|
60 | }
|
---|
61 | void init() {
|
---|
62 | _diffSec = 0;
|
---|
63 | _numGaps = 0;
|
---|
64 | _sumLat = 0.0;
|
---|
65 | _sumLatQ = 0.0;
|
---|
66 | _numLat = 0;
|
---|
67 | _minLat = 1000.0;
|
---|
68 | _maxLat = -1000.0;
|
---|
69 | };
|
---|
70 | void print() {
|
---|
71 | qDebug() << _type;
|
---|
72 | qDebug() << "_oldSec: " << _oldSec;
|
---|
73 | qDebug() << "_newSec: " << _newSec;
|
---|
74 | qDebug() << "_numGaps: " << _numGaps;
|
---|
75 | qDebug() << "_diffSec: " << _diffSec;
|
---|
76 | qDebug() << "_numLat: " << _numLat;
|
---|
77 | qDebug() << "_sumLat: " << _sumLat;
|
---|
78 | qDebug() << "_sumLatQ: " << _sumLatQ;
|
---|
79 | qDebug() << "_meanDiff: " << _meanDiff;
|
---|
80 | qDebug() << "_minLat: " << _minLat;
|
---|
81 | qDebug() << "_maxLat: " << _maxLat;
|
---|
82 | qDebug() << "_curLat: " << _curLat;
|
---|
83 | qDebug() << "_followSec" << _followSec;
|
---|
84 | };
|
---|
85 | int _oldSec;
|
---|
86 | int _newSec;
|
---|
87 | int _numGaps;
|
---|
88 | int _diffSec;
|
---|
89 | int _numLat;
|
---|
90 | double _sumLat;
|
---|
91 | double _sumLatQ;
|
---|
92 | double _meanDiff;
|
---|
93 | double _minLat;
|
---|
94 | double _maxLat;
|
---|
95 | double _curLat;
|
---|
96 | QByteArray _type;
|
---|
97 | bool _followSec;
|
---|
98 |
|
---|
99 | };
|
---|
100 |
|
---|
101 | t_latency _lObs;
|
---|
102 | t_latency _lOrb;
|
---|
103 | t_latency _lClk;
|
---|
104 | t_latency _lClkOrb;
|
---|
105 | t_latency _lPb;
|
---|
106 | t_latency _lCb;
|
---|
107 | t_latency _lVtec;
|
---|
108 | t_latency _lUra;
|
---|
109 | t_latency _lHr;
|
---|
110 | void setCurrentLatency(double lat) {
|
---|
111 | _curLat = lat;
|
---|
112 | }
|
---|
113 |
|
---|
114 | signals:
|
---|
115 | void newMessage(QByteArray msg, bool showOnScreen);
|
---|
116 |
|
---|
117 | private:
|
---|
118 | void callScript(const char* comment);
|
---|
119 | int _inspSegm;
|
---|
120 | int _adviseFail;
|
---|
121 | int _adviseReco;
|
---|
122 | int _miscIntr;
|
---|
123 | int _numSucc;
|
---|
124 | int _secSucc;
|
---|
125 | int _secFail;
|
---|
126 | int _initPause;
|
---|
127 | int _currPause;
|
---|
128 | bool _wrongEpoch;
|
---|
129 | bool _checkSeg;
|
---|
130 | bool _begCorrupt;
|
---|
131 | bool _endCorrupt;
|
---|
132 | bool _fromReconnect;
|
---|
133 | bool _fromCorrupt;
|
---|
134 | QByteArray _staID;
|
---|
135 | QString _adviseScript;
|
---|
136 | QString _checkMountPoint;
|
---|
137 | QString _begDateCorr;
|
---|
138 | QString _begTimeCorr;
|
---|
139 | QString _begDateOut;
|
---|
140 | QString _begTimeOut;
|
---|
141 | QString _endDateCorr;
|
---|
142 | QString _endTimeCorr;
|
---|
143 | QString _endDateOut;
|
---|
144 | QString _endTimeOut;
|
---|
145 | QDateTime _checkTime;
|
---|
146 | QDateTime _decodeSucc;
|
---|
147 | QDateTime _decodeFailure;
|
---|
148 | QDateTime _decodeStart;
|
---|
149 | QDateTime _decodeStop;
|
---|
150 | QDateTime _decodeStartCorr;
|
---|
151 | QDateTime _decodeStopCorr;
|
---|
152 | QDateTime _checkPause;
|
---|
153 | QDateTime _begDateTimeOut;
|
---|
154 | QDateTime _endDateTimeOut;
|
---|
155 | QDateTime _begDateTimeCorr;
|
---|
156 | QDateTime _endDateTimeCorr;
|
---|
157 | double _curLat;
|
---|
158 | };
|
---|
159 |
|
---|
160 | #endif
|
---|