source: ntrip/trunk/BNC/src/rinex/reqcanalyze.h@ 10937

Last change on this file since 10937 was 10937, checked in by stuerze, 2 months ago

minor changes

File size: 5.7 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 REQCANALYZE_H
26#define REQCANALYZE_H
27
28#include <QtCore>
29#include "rnxobsfile.h"
30#include "rnxnavfile.h"
31#include "ephemeris.h"
32#include "satObs.h"
33#include "polarplot.h"
34
35class t_plotData {
36 public:
37 struct t_hlpStatus {
38 QVector<double> _ok;
39 QVector<double> _slip;
40 QVector<double> _gap;
41 };
42 QVector<double> _mjdX24;
43 QVector<double> _numSat;
44 QVector<double> _PDOP;
45 QVector<double> _eleDeg;
46 QMap<char, t_hlpStatus> _status;
47};
48
49class t_reqcAnalyze : public QThread {
50Q_OBJECT
51
52 public:
53 t_reqcAnalyze(QObject* parent);
54 virtual void run();
55
56 protected:
57 ~t_reqcAnalyze();
58
59 class t_skyPlotData {
60 public:
61 t_skyPlotData() {
62 _sys = ' ';
63 _data = new QVector<t_polarPoint*>;
64 }
65 t_skyPlotData(char sys) {
66 _sys = sys;
67 _data = new QVector<t_polarPoint*>;
68 }
69 ~t_skyPlotData() {
70 qDeleteAll(*_data);
71 delete _data;
72 }
73 char _sys;
74 QString _title;
75 QVector<t_polarPoint*>* _data;
76 };
77
78 signals:
79 void finished();
80 void dspSkyPlot(const QString&, QVector<t_skyPlotData> skyPlotData,
81 const QByteArray&, double);
82 void dspAvailPlot(const QString&, const QByteArray&);
83
84 private:
85
86 class t_qcFrq {
87 public:
88 t_qcFrq() {
89 _phaseValid = false;
90 _codeValid = false;
91 _slip = false;
92 _gap = false;
93 _setMP = false;
94 _rawMP = 0.0;
95 _stdMP = 0.0;
96 _SNR = 0.0;
97 }
98 QString _rnxType2ch;
99 bool _phaseValid;
100 bool _codeValid;
101 bool _slip;
102 bool _gap;
103 bool _setMP;
104 double _rawMP;
105 double _stdMP;
106 double _SNR;
107 };
108
109 class t_qcSat {
110 public:
111 t_qcSat() {
112 _slotSet = false;
113 _eleSet = false;
114 _slotNum = 0;
115 _eleDeg = 0.0;
116 _azDeg = 0.0;
117 }
118 bool _slotSet;
119 bool _eleSet;
120 int _slotNum;
121 double _eleDeg;
122 double _azDeg;
123 QVector<t_qcFrq> _qcFrq;
124 };
125
126 class t_qcEpo {
127 public:
128 bncTime _epoTime;
129 double _PDOP;
130 QMap<t_prn, t_qcSat> _qcSat;
131 };
132
133 class t_qcFrqSum {
134 public:
135 t_qcFrqSum() {
136 _numObs = 0;
137 _numSlipsFlagged = 0;
138 _numSlipsFound = 0;
139 _numGaps = 0;
140 _numSNR = 0;
141 _sumSNR = 0.0;
142 _numMP = 0;
143 _sumMP = 0.0;
144 }
145 int _numObs;
146 int _numSlipsFlagged;
147 int _numSlipsFound;
148 int _numGaps;
149 int _numSNR;
150 double _sumSNR;
151 int _numMP;
152 double _sumMP;
153 };
154
155 class t_qcSatSum {
156 public:
157 QMap<QString, t_qcFrqSum> _qcFrqSum;
158 };
159
160 class t_qcFile {
161 public:
162 t_qcFile() {
163 clear();
164 _interval = 1.0;
165 }
166 void clear() {_qcSatSum.clear(); _qcEpo.clear();}
167 bncTime _startTime;
168 bncTime _endTime;
169 QString _antennaName;
170 QString _markerName;
171 QString _receiverType;
172 double _interval;
173 QMap<t_prn, t_qcSatSum> _qcSatSum;
174 QVector<t_qcEpo> _qcEpo;
175 };
176
177 private slots:
178 void slotDspSkyPlot(const QString& fileName, QVector<t_skyPlotData> skyPlotData,
179 const QByteArray& scaleTitle, double maxValue);
180
181 void slotDspAvailPlot(const QString& fileName, const QByteArray& title);
182
183 private:
184
185 void analyzePlotSignals();
186
187 void analyzeFile(t_rnxObsFile* obsFile);
188
189 void updateQcSat(const t_qcSat& qcSat, t_qcSatSum& qcSatSum);
190
191 void setQcObs(const bncTime& epoTime, const ColumnVector& xyzSta,
192 const t_satObs& satObs, QMap<QString, bncTime>& lastObsTime, t_qcSat& qcSat);
193
194 void setExpectedObs(const bncTime& startTime, const bncTime& endTime,
195 double interval, const ColumnVector& xyzSta);
196
197 void analyzeMultipath();
198
199 void preparePlotData(const t_rnxObsFile* obsFile);
200
201 double cmpDOP(const ColumnVector& xyzSta) const;
202
203 void printReport(const t_rnxObsFile* obsFile);
204
205 static bool mpLessThan(const t_polarPoint* p1, const t_polarPoint* p2);
206
207 QString _logFileName;
208 QFile* _logFile;
209 QTextStream* _logStream;
210 bool _checkEph;
211 QStringList _obsFileNames;
212 QVector<t_rnxObsFile*> _rnxObsFiles;
213 QStringList _navFileNames;
214 QString _reqcPlotSignals;
215 QMap<char, QVector<char> > _signalTypes;
216 QMap<t_prn, int> _numExpObs;
217 QVector<char> _navFileIncomplete;
218 QStringList _defaultSignalTypes;
219 QVector<t_eph*> _ephs;
220 t_rnxObsFile::t_rnxEpo* _currEpo;
221 t_qcFile _qcFile;
222};
223
224#endif
Note: See TracBrowser for help on using the repository browser.