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

Last change on this file since 8557 was 8557, checked in by mervart, 5 years ago

Analyze more than two signals

File size: 5.5 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 ~t_skyPlotData() {}
63 void clear() {
64 for (int ii = 0; ii < _data.size(); ii++) {
65 delete _data.at(ii);
66 }
67 }
68 QString _title;
69 QVector<t_polarPoint*> _data;
70 };
71
72 signals:
73 void finished();
74 void dspSkyPlot(const QString&, QVector<t_skyPlotData> skyPlotData,
75 const QByteArray&, double);
76 void dspAvailPlot(const QString&, const QByteArray&);
77
78 private:
79
80 class t_qcFrq {
81 public:
82 t_qcFrq() {
83 _phaseValid = false;
84 _codeValid = false;
85 _slip = false;
86 _gap = false;
87 _setMP = false;
88 _rawMP = 0.0;
89 _stdMP = 0.0;
90 _SNR = 0.0;
91 }
92 QString _rnxType2ch;
93 bool _phaseValid;
94 bool _codeValid;
95 bool _slip;
96 bool _gap;
97 bool _setMP;
98 double _rawMP;
99 double _stdMP;
100 double _SNR;
101 };
102
103 class t_qcSat {
104 public:
105 t_qcSat() {
106 _slotSet = false;
107 _eleSet = false;
108 _slotNum = 0;
109 _eleDeg = 0.0;
110 _azDeg = 0.0;
111 }
112 bool _slotSet;
113 bool _eleSet;
114 int _slotNum;
115 double _eleDeg;
116 double _azDeg;
117 QVector<t_qcFrq> _qcFrq;
118 };
119
120 class t_qcEpo {
121 public:
122 bncTime _epoTime;
123 double _PDOP;
124 QMap<t_prn, t_qcSat> _qcSat;
125 };
126
127 class t_qcFrqSum {
128 public:
129 t_qcFrqSum() {
130 _numObs = 0;
131 _numSlipsFlagged = 0;
132 _numSlipsFound = 0;
133 _numGaps = 0;
134 _numSNR = 0;
135 _sumSNR = 0.0;
136 _numMP = 0;
137 _sumMP = 0.0;
138 }
139 int _numObs;
140 int _numSlipsFlagged;
141 int _numSlipsFound;
142 int _numGaps;
143 int _numSNR;
144 double _sumSNR;
145 int _numMP;
146 double _sumMP;
147 };
148
149 class t_qcSatSum {
150 public:
151 QMap<QString, t_qcFrqSum> _qcFrqSum;
152 };
153
154 class t_qcFile {
155 public:
156 t_qcFile() {
157 clear();
158 _interval = 1.0;
159 }
160 void clear() {_qcSatSum.clear(); _qcEpo.clear();}
161 bncTime _startTime;
162 bncTime _endTime;
163 QString _antennaName;
164 QString _markerName;
165 QString _receiverType;
166 double _interval;
167 QMap<t_prn, t_qcSatSum> _qcSatSum;
168 QVector<t_qcEpo> _qcEpo;
169 };
170
171 private slots:
172 void slotDspSkyPlot(const QString& fileName, QVector<t_skyPlotData> skyPlotData,
173 const QByteArray& scaleTitle, double maxValue);
174
175 void slotDspAvailPlot(const QString& fileName, const QByteArray& title);
176
177 private:
178 void checkEphemerides();
179
180 void analyzePlotSignals();
181
182 void analyzeFile(t_rnxObsFile* obsFile);
183
184 void updateQcSat(const t_qcSat& qcSat, t_qcSatSum& qcSatSum);
185
186 void setQcObs(const bncTime& epoTime, const ColumnVector& xyzSta,
187 const t_satObs& satObs, QMap<QString, bncTime>& lastObsTime, t_qcSat& qcSat);
188
189 void setExpectedObs(const bncTime& startTime, const bncTime& endTime,
190 double interval, const ColumnVector& xyzSta);
191
192 void analyzeMultipath();
193
194 void preparePlotData(const t_rnxObsFile* obsFile);
195
196 double cmpDOP(const ColumnVector& xyzSta) const;
197
198 void printReport(const t_rnxObsFile* obsFile);
199
200 QString _logFileName;
201 QFile* _logFile;
202 QTextStream* _log;
203 QStringList _obsFileNames;
204 QVector<t_rnxObsFile*> _rnxObsFiles;
205 QStringList _navFileNames;
206 QString _reqcPlotSignals;
207 QMap<char, QVector<char> > _signalTypes;
208 QMap<t_prn, int> _numExpObs;
209 QVector<char> _navFileIncomplete;
210 QStringList _defaultSignalTypes;
211 QVector<t_eph*> _ephs;
212 t_rnxObsFile::t_rnxEpo* _currEpo;
213 t_qcFile _qcFile;
214};
215
216#endif
Note: See TracBrowser for help on using the repository browser.