source: ntrip/trunk/BNC/src/latencychecker.h@ 8082

Last change on this file since 8082 was 8082, checked in by stuerze, 7 years ago

the latency checker is now able to check ssr data streams with messages containing different update rates

File size: 4.4 KB
Line 
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
31class latencyChecker : public QObject {
32Q_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 = 0;
48 _newSec = 0;
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 void setLatencyObjekt(t_latency& lat, QByteArray type) {
115 qDebug() << "set " << type;
116 l= lat;
117 l._type = type;
118 l.print();
119 }
120
121 void getLatencyObjekt(t_latency& lat) {
122 lat =l;
123 }
124
125*/
126 signals:
127 void newMessage(QByteArray msg, bool showOnScreen);
128
129 private:
130 void callScript(const char* comment);
131 int _inspSegm;
132 int _adviseFail;
133 int _adviseReco;
134 int _miscIntr;
135 int _numSucc;
136 int _secSucc;
137 int _secFail;
138 int _initPause;
139 int _currPause;
140 bool _wrongEpoch;
141 bool _checkSeg;
142 bool _begCorrupt;
143 bool _endCorrupt;
144 bool _fromReconnect;
145 bool _fromCorrupt;
146 QByteArray _staID;
147 QString _adviseScript;
148 QString _checkMountPoint;
149 QString _begDateCorr;
150 QString _begTimeCorr;
151 QString _begDateOut;
152 QString _begTimeOut;
153 QString _endDateCorr;
154 QString _endTimeCorr;
155 QString _endDateOut;
156 QString _endTimeOut;
157 QDateTime _checkTime;
158 QDateTime _decodeSucc;
159 QDateTime _decodeFailure;
160 QDateTime _decodeStart;
161 QDateTime _decodeStop;
162 QDateTime _decodeStartCorr;
163 QDateTime _decodeStopCorr;
164 QDateTime _checkPause;
165 QDateTime _begDateTimeOut;
166 QDateTime _endDateTimeOut;
167 QDateTime _begDateTimeCorr;
168 QDateTime _endDateTimeCorr;
169 double _curLat;
170};
171
172#endif
Note: See TracBrowser for help on using the repository browser.