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 REQCANALYZE_H
|
---|
26 | #define REQCANALYZE_H
|
---|
27 |
|
---|
28 | #include <QtCore>
|
---|
29 | #include "rnxobsfile.h"
|
---|
30 | #include "rnxnavfile.h"
|
---|
31 | #include "RTCM/GPSDecoder.h"
|
---|
32 | #include "RTCM3/ephemeris.h"
|
---|
33 |
|
---|
34 | class t_polarPoint;
|
---|
35 |
|
---|
36 | class t_availData {
|
---|
37 | public:
|
---|
38 | QVector<double> _L1ok;
|
---|
39 | QVector<double> _L2ok;
|
---|
40 | QVector<double> _L1slip;
|
---|
41 | QVector<double> _L2slip;
|
---|
42 | QVector<double> _L1gap;
|
---|
43 | QVector<double> _L2gap;
|
---|
44 | QVector<double> _eleDeg;
|
---|
45 | QVector<double> _eleTim;
|
---|
46 | };
|
---|
47 |
|
---|
48 | class t_prnStat {
|
---|
49 | public:
|
---|
50 | t_prnStat() {
|
---|
51 | _numObs = 0;
|
---|
52 | _numSlipsFlagged = 0;
|
---|
53 | _numSlipsFound = 0;
|
---|
54 | _numGaps = 0;
|
---|
55 | }
|
---|
56 | int _numObs;
|
---|
57 | int _numSlipsFlagged;
|
---|
58 | int _numSlipsFound;
|
---|
59 | int _numGaps;
|
---|
60 | };
|
---|
61 |
|
---|
62 | class t_obsStat {
|
---|
63 | public:
|
---|
64 | void reset() {
|
---|
65 | _mjdX24.clear();
|
---|
66 | _numSat.clear();
|
---|
67 | _PDOP.clear();
|
---|
68 | _prnStat.clear();
|
---|
69 | }
|
---|
70 | QVector<double> _mjdX24;
|
---|
71 | QVector<double> _numSat;
|
---|
72 | QVector<double> _PDOP;
|
---|
73 | bncTime _startTime;
|
---|
74 | bncTime _endTime;
|
---|
75 | QString _antennaName;
|
---|
76 | QString _markerName;
|
---|
77 | QString _receiverType;
|
---|
78 | double _interval;
|
---|
79 | QMap<QString, t_prnStat> _prnStat;
|
---|
80 | };
|
---|
81 |
|
---|
82 | class t_reqcAnalyze : public QThread {
|
---|
83 | Q_OBJECT
|
---|
84 |
|
---|
85 | public:
|
---|
86 | t_reqcAnalyze(QObject* parent);
|
---|
87 |
|
---|
88 | protected:
|
---|
89 | ~t_reqcAnalyze();
|
---|
90 |
|
---|
91 | signals:
|
---|
92 | void finished();
|
---|
93 | void dspSkyPlot(const QString&,
|
---|
94 | const QByteArray&,
|
---|
95 | QVector<t_polarPoint*>*,
|
---|
96 | const QByteArray&,
|
---|
97 | QVector<t_polarPoint*>*,
|
---|
98 | const QByteArray&, double);
|
---|
99 |
|
---|
100 | void dspAvailPlot(const QString&, const QByteArray&);
|
---|
101 |
|
---|
102 | private slots:
|
---|
103 | void slotDspSkyPlot(const QString& fileName,
|
---|
104 | const QByteArray& title1,
|
---|
105 | QVector<t_polarPoint*>* data1,
|
---|
106 | const QByteArray& title2,
|
---|
107 | QVector<t_polarPoint*>* data2,
|
---|
108 | const QByteArray& scaleTitle, double maxValue);
|
---|
109 |
|
---|
110 | void slotDspAvailPlot(const QString& fileName, const QByteArray& title);
|
---|
111 |
|
---|
112 | public:
|
---|
113 | virtual void run();
|
---|
114 |
|
---|
115 | private:
|
---|
116 | class t_oneObs {
|
---|
117 | public:
|
---|
118 | t_oneObs(int GPSWeek, double GPSWeeks) {
|
---|
119 | _GPSWeek = GPSWeek;
|
---|
120 | _GPSWeeks = GPSWeeks;
|
---|
121 | _hasL1 = false;
|
---|
122 | _hasL2 = false;
|
---|
123 | _slipL1 = false;
|
---|
124 | _slipL2 = false;
|
---|
125 | _MP1 = 0.0;
|
---|
126 | _MP2 = 0.0;
|
---|
127 | _SNR1 = 0.0;
|
---|
128 | _SNR2 = 0.0;
|
---|
129 | _slotSet = false;
|
---|
130 | }
|
---|
131 | int _GPSWeek;
|
---|
132 | double _GPSWeeks;
|
---|
133 | bool _hasL1;
|
---|
134 | bool _hasL2;
|
---|
135 | bool _slipL1;
|
---|
136 | bool _slipL2;
|
---|
137 | double _MP1;
|
---|
138 | double _MP2;
|
---|
139 | double _SNR1;
|
---|
140 | double _SNR2;
|
---|
141 | bool _slotSet;
|
---|
142 | };
|
---|
143 |
|
---|
144 | class t_allObs {
|
---|
145 | public:
|
---|
146 | t_allObs() {}
|
---|
147 | ~t_allObs() {
|
---|
148 | for (int ii = 0; ii < _oneObsVec.size(); ii++) {
|
---|
149 | delete _oneObsVec[ii];
|
---|
150 | }
|
---|
151 | }
|
---|
152 | t_irc addObs(const t_obs& obs);
|
---|
153 | QVector<t_oneObs*> _oneObsVec;
|
---|
154 | };
|
---|
155 |
|
---|
156 | void analyzeFile(t_rnxObsFile* obsFile);
|
---|
157 | void preparePlotData(const QString& prn, const ColumnVector& xyzSta,
|
---|
158 | double obsInterval,
|
---|
159 | QVector<t_polarPoint*>* dataMP1,
|
---|
160 | QVector<t_polarPoint*>* dataMP2,
|
---|
161 | QVector<t_polarPoint*>* dataSNR1,
|
---|
162 | QVector<t_polarPoint*>* dataSNR2);
|
---|
163 | void prepareObsStat(unsigned iEpo, double obsInterval,
|
---|
164 | const ColumnVector& xyzSta);
|
---|
165 | double cmpDOP(const ColumnVector& xyzSta) const;
|
---|
166 | void printReport(QVector<t_polarPoint*>* dataMP1,
|
---|
167 | QVector<t_polarPoint*>* dataMP2,
|
---|
168 | QVector<t_polarPoint*>* dataSNR1,
|
---|
169 | QVector<t_polarPoint*>* dataSNR2);
|
---|
170 |
|
---|
171 | QString _logFileName;
|
---|
172 | QFile* _logFile;
|
---|
173 | QTextStream* _log;
|
---|
174 | QStringList _obsFileNames;
|
---|
175 | QVector<t_rnxObsFile*> _rnxObsFiles;
|
---|
176 | QStringList _navFileNames;
|
---|
177 | QVector<t_eph*> _ephs;
|
---|
178 | t_rnxObsFile::t_rnxEpo* _currEpo;
|
---|
179 | QMap<QString, t_allObs> _allObsMap;
|
---|
180 | QMap<QString, t_availData> _availDataMap;
|
---|
181 | t_obsStat _obsStat;
|
---|
182 | QMutex _mutex;
|
---|
183 | };
|
---|
184 |
|
---|
185 | #endif
|
---|