source: ntrip/trunk/BNC/src/rinex/reqcanalyze.cpp@ 6281

Last change on this file since 6281 was 6281, checked in by mervart, 9 years ago
File size: 20.3 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/* -------------------------------------------------------------------------
26 * BKG NTRIP Client
27 * -------------------------------------------------------------------------
28 *
29 * Class: t_reqcAnalyze
30 *
31 * Purpose: Analyze RINEX Files
32 *
33 * Author: L. Mervart
34 *
35 * Created: 11-Apr-2012
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42#include <iomanip>
43#include <qwt_plot_renderer.h>
44
45#include "reqcanalyze.h"
46#include "bnccore.h"
47#include "bncsettings.h"
48#include "reqcedit.h"
49#include "bncutils.h"
50#include "graphwin.h"
51#include "polarplot.h"
52#include "availplot.h"
53#include "eleplot.h"
54#include "dopplot.h"
55
56using namespace std;
57
58// Constructor
59////////////////////////////////////////////////////////////////////////////
60t_reqcAnalyze::t_reqcAnalyze(QObject* parent) : QThread(parent) {
61
62 bncSettings settings;
63
64 _logFileName = settings.value("reqcOutLogFile").toString(); expandEnvVar(_logFileName);
65 _logFile = 0;
66 _log = 0;
67 _currEpo = 0;
68 _obsFileNames = settings.value("reqcObsFile").toString().split(",", QString::SkipEmptyParts);
69 _navFileNames = settings.value("reqcNavFile").toString().split(",", QString::SkipEmptyParts);
70
71 connect(this, SIGNAL(dspSkyPlot(const QString&, const QByteArray&, QVector<t_polarPoint*>*,
72 const QByteArray&, QVector<t_polarPoint*>*,
73 const QByteArray&, double)),
74 this, SLOT(slotDspSkyPlot(const QString&, const QByteArray&, QVector<t_polarPoint*>*,
75 const QByteArray&, QVector<t_polarPoint*>*,
76 const QByteArray&, double)));
77
78 connect(this, SIGNAL(dspAvailPlot(const QString&, const QByteArray&)),
79 this, SLOT(slotDspAvailPlot(const QString&, const QByteArray&)));
80}
81
82// Destructor
83////////////////////////////////////////////////////////////////////////////
84t_reqcAnalyze::~t_reqcAnalyze() {
85 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
86 delete _rnxObsFiles[ii];
87 }
88 for (int ii = 0; ii < _ephs.size(); ii++) {
89 delete _ephs[ii];
90 }
91 delete _log; _log = 0;
92 delete _logFile; _logFile = 0;
93 if (BNC_CORE->mode() != t_bncCore::interactive) {
94 qApp->exit(0);
95 }
96}
97
98//
99////////////////////////////////////////////////////////////////////////////
100void t_reqcAnalyze::run() {
101
102 // Open Log File
103 // -------------
104 _logFile = new QFile(_logFileName);
105 if (_logFile->open(QIODevice::WriteOnly | QIODevice::Text)) {
106 _log = new QTextStream();
107 _log->setDevice(_logFile);
108 }
109
110 // Initialize RINEX Observation Files
111 // ----------------------------------
112 t_reqcEdit::initRnxObsFiles(_obsFileNames, _rnxObsFiles, _log);
113
114 // Read Ephemerides
115 // ----------------
116 t_reqcEdit::readEphemerides(_navFileNames, _ephs);
117
118 // Loop over all RINEX Files
119 // -------------------------
120 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
121 analyzeFile(_rnxObsFiles[ii]);
122 }
123
124 // Exit
125 // ----
126 emit finished();
127 deleteLater();
128}
129
130//
131////////////////////////////////////////////////////////////////////////////
132void t_reqcAnalyze::analyzeFile(t_rnxObsFile* obsFile) {
133
134 QMutexLocker lock(&_mutex);
135
136 if (_log) {
137 *_log << "\nAnalyze File\n"
138 << "------------\n"
139 << "File: " << obsFile->fileName().toAscii().data() << endl;
140 }
141
142 _qcFile.clear();
143
144 // A priori Coordinates
145 // --------------------
146 ColumnVector xyzSta = obsFile->xyz();
147
148 // Loop over all Epochs
149 // --------------------
150 try {
151 bool firstEpo = true;
152 while ( (_currEpo = obsFile->nextEpoch()) != 0) {
153 if (firstEpo) {
154 firstEpo = false;
155 _qcFile._startTime = _currEpo->tt;
156 _qcFile._antennaName = obsFile->antennaName();
157 _qcFile._markerName = obsFile->markerName();
158 _qcFile._receiverType = obsFile->receiverType();
159 _qcFile._interval = obsFile->interval();
160 }
161 _qcFile._endTime = _currEpo->tt;
162
163 t_qcEpo qcEpo;
164 qcEpo._epoTime = _currEpo->tt;
165 qcEpo._PDOP = cmpDOP(xyzSta);
166
167 // Loop over all satellites
168 // ------------------------
169 for (unsigned iObs = 0; iObs < _currEpo->rnxSat.size(); iObs++) {
170 const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iObs];
171 t_satObs satObs;
172 t_rnxObsFile::setObsFromRnx(obsFile, _currEpo, rnxSat, satObs);
173 t_qcObs& qcObs = qcEpo._qcObs[satObs._prn];
174 setQcObs(qcEpo._epoTime, xyzSta, satObs, qcObs);
175 updateQcSat(qcObs, _qcFile._qcSat[satObs._prn]);
176 }
177 _qcFile._qcEpo.push_back(qcEpo);
178 }
179
180 analyzeMultipath();
181
182 preparePlotData(obsFile);
183
184 printReport();
185 }
186 catch (QString str) {
187 if (_log) {
188 *_log << "Exception " << str << endl;
189 }
190 else {
191 qDebug() << str;
192 }
193 }
194}
195
196// Compute Dilution of Precision
197////////////////////////////////////////////////////////////////////////////
198double t_reqcAnalyze::cmpDOP(const ColumnVector& xyzSta) const {
199
200 if (xyzSta.size() != 3) {
201 return 0.0;
202 }
203
204 unsigned nSat = _currEpo->rnxSat.size();
205
206 if (nSat < 4) {
207 return 0.0;
208 }
209
210 Matrix AA(nSat, 4);
211
212 unsigned nSatUsed = 0;
213 for (unsigned iSat = 0; iSat < nSat; iSat++) {
214
215 const t_rnxObsFile::t_rnxSat& rnxSat = _currEpo->rnxSat[iSat];
216 const t_prn& prn = rnxSat.prn;
217
218 t_eph* eph = 0;
219 for (int ie = 0; ie < _ephs.size(); ie++) {
220 if (_ephs[ie]->prn() == prn) {
221 eph = _ephs[ie];
222 break;
223 }
224 }
225 if (eph) {
226 ColumnVector xSat(4);
227 ColumnVector vv(3);
228 if (eph->getCrd(_currEpo->tt, xSat, vv, false) == success) {
229 ++nSatUsed;
230 ColumnVector dx = xSat.Rows(1,3) - xyzSta;
231 double rho = dx.norm_Frobenius();
232 AA(nSatUsed,1) = dx(1) / rho;
233 AA(nSatUsed,2) = dx(2) / rho;
234 AA(nSatUsed,3) = dx(3) / rho;
235 AA(nSatUsed,4) = 1.0;
236 }
237 }
238 }
239
240 if (nSatUsed < 4) {
241 return 0.0;
242 }
243
244 AA = AA.Rows(1, nSatUsed);
245
246 SymmetricMatrix QQ;
247 QQ << AA.t() * AA;
248 QQ = QQ.i();
249
250 return sqrt(QQ.trace());
251}
252
253//
254////////////////////////////////////////////////////////////////////////////
255void t_reqcAnalyze::updateQcSat(const t_qcObs& qcObs, t_qcSat& qcSat) {
256 if (qcObs._hasL1 && qcObs._hasL2) {
257 qcSat._numObs += 1;
258 }
259 if (qcObs._slipL1 && qcObs._slipL2) {
260 qcSat._numSlipsFlagged += 1;
261 }
262}
263
264//
265////////////////////////////////////////////////////////////////////////////
266void t_reqcAnalyze::setQcObs(const bncTime& epoTime, const ColumnVector& xyzSta,
267 const t_satObs& satObs, t_qcObs& qcObs) {
268
269 t_eph* eph = 0;
270 for (int ie = 0; ie < _ephs.size(); ie++) {
271 if (_ephs[ie]->prn() == satObs._prn) {
272 eph = _ephs[ie];
273 break;
274 }
275 }
276 if (eph) {
277 ColumnVector xc(4);
278 ColumnVector vv(3);
279 if (xyzSta.size() && eph->getCrd(epoTime, xc, vv, false) == success) {
280 double rho, eleSat, azSat;
281 topos(xyzSta(1), xyzSta(2), xyzSta(3), xc(1), xc(2), xc(3), rho, eleSat, azSat);
282 qcObs._eleSet = true;
283 qcObs._azDeg = azSat * 180.0/M_PI;
284 qcObs._eleDeg = eleSat * 180.0/M_PI;
285 }
286 if (satObs._prn.system() == 'R') {
287 qcObs._slotSet = true;
288 qcObs._slotNum = eph->slotNum();
289 }
290 }
291
292 // Check Gaps
293 // ----------
294 if (qcObs._lastObsTime.valid()) {
295 double dt = epoTime - qcObs._lastObsTime;
296 if (dt > 1.5 * _qcFile._interval) {
297 qcObs._gapL1 = true;
298 qcObs._gapL2 = true;
299 }
300 }
301 qcObs._lastObsTime = epoTime;
302
303 // Availability and Slip Flags
304 // ---------------------------
305 double L1 = 0.0;
306 double L2 = 0.0;
307 double P1 = 0.0;
308 double P2 = 0.0;
309 for (unsigned iFrq = 0; iFrq < satObs._obs.size(); iFrq++) {
310 const t_frqObs* frqObs = satObs._obs[iFrq];
311 if (frqObs->_rnxType2ch[0] == '1') {
312 if (frqObs->_phaseValid) {
313 L1 = frqObs->_phase;
314 qcObs._hasL1 = true;
315 qcObs._slipL1 = frqObs->_slip;
316 }
317 if (frqObs->_codeValid) {
318 P1 = frqObs->_code;
319 }
320 if (frqObs->_snrValid) {
321 qcObs._SNR1 = frqObs->_snr;
322 }
323 }
324 else if ( (satObs._prn.system() != 'E' && frqObs->_rnxType2ch[0] == '2') ||
325 (satObs._prn.system() == 'E' && frqObs->_rnxType2ch[0] == '5') ) {
326 if (frqObs->_phaseValid) {
327 L2 = frqObs->_phase;
328 qcObs._hasL2 = true;
329 qcObs._slipL2 = frqObs->_slip;
330 }
331 if (frqObs->_codeValid) {
332 P2 = frqObs->_code;
333 }
334 if (frqObs->_snrValid) {
335 qcObs._SNR2 = frqObs->_snr;
336 }
337 }
338 }
339
340 // Compute the Multipath Linear Combination
341 // ----------------------------------------
342 if (L1 != 0.0 && L2 != 0.0 && P1 != 0.0 && P2 != 0.0) {
343 double f1 = 0.0;
344 double f2 = 0.0;
345 if (satObs._prn.system() == 'G') {
346 f1 = t_CST::freq(t_frequency::G1, 0);
347 f2 = t_CST::freq(t_frequency::G2, 0);
348 }
349 else if (satObs._prn.system() == 'R') {
350 f1 = t_CST::freq(t_frequency::R1, qcObs._slotNum);
351 f2 = t_CST::freq(t_frequency::R2, qcObs._slotNum);
352 }
353 else if (satObs._prn.system() == 'E') {
354 f1 = t_CST::freq(t_frequency::E1, 0);
355 f2 = t_CST::freq(t_frequency::E5, 0);
356 }
357
358 L1 = L1 * t_CST::c / f1;
359 L2 = L2 * t_CST::c / f2;
360
361 qcObs._rawMP1 = P1 - L1 - 2.0*f2*f2/(f1*f1-f2*f2) * (L1 - L2);
362 qcObs._rawMP2 = P2 - L2 - 2.0*f1*f1/(f1*f1-f2*f2) * (L1 - L2);
363 qcObs._mpSet = true;
364 }
365}
366
367//
368////////////////////////////////////////////////////////////////////////////
369void t_reqcAnalyze::analyzeMultipath() {
370
371 const double SLIPTRESH = 10.0; // cycle-slip threshold (meters)
372 const double chunkStep = 600.0; // 10 minutes
373
374 // Loop over all satellites available
375 // ----------------------------------
376 QMutableMapIterator<t_prn, t_qcSat> it(_qcFile._qcSat);
377 while (it.hasNext()) {
378 it.next();
379 const t_prn& prn = it.key();
380 t_qcSat& qcSat = it.value();
381
382 // Loop over all Chunks of Data
383 // ----------------------------
384 for (bncTime chunkStart = _qcFile._startTime;
385 chunkStart < _qcFile._endTime; chunkStart += chunkStep) {
386
387 bncTime chunkEnd = chunkStart + chunkStep;
388
389 QVector<t_qcObs*> obsVec;
390 QVector<double> MP1;
391 QVector<double> MP2;
392
393 // Loop over all Epochs within one Chunk of Data
394 // ---------------------------------------------
395 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
396 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
397 if (chunkStart <= qcEpo._epoTime && qcEpo._epoTime < chunkEnd) {
398 if (qcEpo._qcObs.contains(prn)) {
399 t_qcObs& qcObs = qcEpo._qcObs[prn];
400 obsVec << &qcObs;
401 if (qcObs._mpSet) {
402 MP1 << qcObs._rawMP1;
403 MP2 << qcObs._rawMP2;
404 }
405 }
406 }
407 }
408
409 // Compute the multipath mean and standard deviation
410 // -------------------------------------------------
411 if (MP1.size() > 1) {
412 double meanMP1 = 0.0;
413 double meanMP2 = 0.0;
414 for (int ii = 0; ii < MP1.size(); ii++) {
415 meanMP1 += MP1[ii];
416 meanMP2 += MP2[ii];
417 }
418 meanMP1 /= MP1.size();
419 meanMP2 /= MP2.size();
420
421 bool slipMP = false;
422
423 double stdMP1 = 0.0;
424 double stdMP2 = 0.0;
425 for (int ii = 0; ii < MP1.size(); ii++) {
426 double diff1 = MP1[ii] - meanMP1;
427 double diff2 = MP2[ii] - meanMP2;
428 if (fabs(diff1) > SLIPTRESH || fabs(diff2) > SLIPTRESH) {
429 slipMP = true;
430 break;
431 }
432 stdMP1 += diff1 * diff1;
433 stdMP2 += diff2 * diff2;
434 }
435
436 if (slipMP) {
437 stdMP1 = 0.0;
438 stdMP2 = 0.0;
439 qcSat._numSlipsFound += 1;
440 }
441 else {
442 stdMP1 = sqrt(stdMP1 / (MP1.size()-1));
443 stdMP2 = sqrt(stdMP2 / (MP2.size()-1));
444 }
445
446 for (int ii = 0; ii < obsVec.size(); ii++) {
447 t_qcObs* qcObs = obsVec[ii];
448 if (slipMP) {
449 qcObs->_slipL1 = true;
450 qcObs->_slipL2 = true;
451 }
452 else {
453 qcObs->_stdMP1 = stdMP1;
454 qcObs->_stdMP2 = stdMP2;
455 }
456 }
457 }
458 }
459 }
460}
461
462//
463////////////////////////////////////////////////////////////////////////////
464void t_reqcAnalyze::preparePlotData(const t_rnxObsFile* obsFile) {
465
466 QVector<t_polarPoint*>* dataMP1 = new QVector<t_polarPoint*>;
467 QVector<t_polarPoint*>* dataMP2 = new QVector<t_polarPoint*>;
468 QVector<t_polarPoint*>* dataSNR1 = new QVector<t_polarPoint*>;
469 QVector<t_polarPoint*>* dataSNR2 = new QVector<t_polarPoint*>;
470
471 bncSettings settings;
472 QString reqSkyPlotSystems = settings.value("reqcSkyPlotSystems").toString();
473 bool plotGPS = false;
474 bool plotGlo = false;
475 bool plotGal = false;
476 if (reqSkyPlotSystems == "GPS") {
477 plotGPS = true;
478 }
479 else if (reqSkyPlotSystems == "GLONASS") {
480 plotGlo = true;
481 }
482 else if (reqSkyPlotSystems == "Galileo") {
483 plotGal = true;
484 }
485 else {
486 plotGPS = true;
487 plotGlo = true;
488 plotGal = true;
489 }
490
491 // Loop over all observations
492 // --------------------------
493 for (int iEpo = 0; iEpo < _qcFile._qcEpo.size(); iEpo++) {
494 t_qcEpo& qcEpo = _qcFile._qcEpo[iEpo];
495 QMapIterator<t_prn, t_qcObs> it(qcEpo._qcObs);
496 while (it.hasNext()) {
497 it.next();
498 const t_prn& prn = it.key();
499 const t_qcObs& qcObs = it.value();
500 if ( (prn.system() == 'G' && plotGPS) ||
501 (prn.system() == 'R' && plotGlo) ||
502 (prn.system() == 'E' && plotGal) ) {
503
504 (*dataSNR1) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._SNR1));
505 (*dataSNR2) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._SNR2));
506
507 (*dataMP1) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._stdMP1));
508 (*dataMP2) << (new t_polarPoint(qcObs._azDeg, 90.0 - qcObs._eleDeg, qcObs._stdMP2));
509 }
510 }
511 }
512
513 // Show the plots
514 // --------------
515 if (BNC_CORE->GUIenabled()) {
516 QFileInfo fileInfo(obsFile->fileName());
517 QByteArray title = fileInfo.fileName().toAscii();
518 emit dspSkyPlot(obsFile->fileName(), "MP1", dataMP1, "MP2", dataMP2, "Meters", 2.0);
519 emit dspSkyPlot(obsFile->fileName(), "SNR1", dataSNR1, "SNR2", dataSNR2, "dbHz", 54.0);
520 emit dspAvailPlot(obsFile->fileName(), title);
521 }
522 else {
523 for (int ii = 0; ii < dataMP1->size(); ii++) {
524 delete dataMP1->at(ii);
525 }
526 delete dataMP1;
527 for (int ii = 0; ii < dataMP2->size(); ii++) {
528 delete dataMP2->at(ii);
529 }
530 delete dataMP2;
531 for (int ii = 0; ii < dataSNR1->size(); ii++) {
532 delete dataSNR1->at(ii);
533 }
534 delete dataSNR1;
535 for (int ii = 0; ii < dataSNR2->size(); ii++) {
536 delete dataSNR2->at(ii);
537 }
538 delete dataSNR2;
539 }
540}
541
542//
543////////////////////////////////////////////////////////////////////////////
544void t_reqcAnalyze::slotDspSkyPlot(const QString& fileName, const QByteArray& title1,
545 QVector<t_polarPoint*>* data1, const QByteArray& title2,
546 QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle,
547 double maxValue) {
548
549 if (BNC_CORE->GUIenabled()) {
550
551 if (maxValue == 0.0) {
552 if (data1) {
553 for (int ii = 0; ii < data1->size(); ii++) {
554 double val = data1->at(ii)->_value;
555 if (maxValue < val) {
556 maxValue = val;
557 }
558 }
559 }
560 if (data2) {
561 for (int ii = 0; ii < data2->size(); ii++) {
562 double val = data2->at(ii)->_value;
563 if (maxValue < val) {
564 maxValue = val;
565 }
566 }
567 }
568 }
569
570 QwtInterval scaleInterval(0.0, maxValue);
571
572 QVector<QWidget*> plots;
573 if (data1) {
574 t_polarPlot* plot1 = new t_polarPlot(QwtText(title1), scaleInterval,
575 BNC_CORE->mainWindow());
576 plot1->addCurve(data1);
577 plots << plot1;
578 }
579 if (data2) {
580 t_polarPlot* plot2 = new t_polarPlot(QwtText(title2), scaleInterval,
581 BNC_CORE->mainWindow());
582 plot2->addCurve(data2);
583 plots << plot2;
584 }
585
586 t_graphWin* graphWin = new t_graphWin(0, fileName, plots,
587 &scaleTitle, &scaleInterval);
588
589 graphWin->show();
590
591 bncSettings settings;
592 QString dirName = settings.value("reqcPlotDir").toString();
593 if (!dirName.isEmpty()) {
594 QByteArray ext = (scaleTitle == "Meters") ? "_M.png" : "_S.png";
595 graphWin->savePNG(dirName, ext);
596 }
597 }
598}
599
600//
601////////////////////////////////////////////////////////////////////////////
602void t_reqcAnalyze::slotDspAvailPlot(const QString& fileName, const QByteArray& title) {
603
604 t_plotData plotData;
605 QMap<t_prn, t_plotData> plotDataMap;
606
607 for (int ii = 0; ii < _qcFile._qcEpo.size(); ii++) {
608 const t_qcEpo& qcEpo = _qcFile._qcEpo[ii];
609 double mjdX24 = qcEpo._epoTime.mjddec() * 24.0;
610
611 plotData._mjdX24 << mjdX24;
612 plotData._PDOP << qcEpo._PDOP;
613 plotData._numSat << qcEpo._qcObs.size();
614
615 QMapIterator<t_prn, t_qcObs> it(qcEpo._qcObs);
616 while (it.hasNext()) {
617 it.next();
618 const t_prn& prn = it.key();
619 const t_qcObs& qcObs = it.value();
620 t_plotData& data = plotDataMap[prn];
621 if (qcObs._hasL1) data._L1ok << mjdX24;
622 if (qcObs._hasL2) data._L2ok << mjdX24;
623 if (qcObs._slipL1) data._L1slip << mjdX24;
624 if (qcObs._slipL2) data._L2slip << mjdX24;
625 if (qcObs._gapL1) data._L1gap << mjdX24;
626 if (qcObs._gapL2) data._L2gap << mjdX24;
627 data._eleDeg << qcObs._eleDeg;
628 }
629 }
630
631
632 if (BNC_CORE->GUIenabled()) {
633 t_availPlot* plotA = new t_availPlot(0, plotDataMap);
634 plotA->setTitle(title);
635
636 t_elePlot* plotZ = new t_elePlot(0, plotDataMap);
637
638 t_dopPlot* plotD = new t_dopPlot(0, plotData);
639
640 QVector<QWidget*> plots;
641 plots << plotA << plotZ << plotD;
642 t_graphWin* graphWin = new t_graphWin(0, fileName, plots, 0, 0);
643
644 int ww = QFontMetrics(graphWin->font()).width('w');
645 graphWin->setMinimumSize(120*ww, 40*ww);
646
647 graphWin->show();
648
649 bncSettings settings;
650 QString dirName = settings.value("reqcPlotDir").toString();
651 if (!dirName.isEmpty()) {
652 QByteArray ext = "_A.png";
653 graphWin->savePNG(dirName, ext);
654 }
655 }
656}
657
658// Finish the report
659////////////////////////////////////////////////////////////////////////////
660void t_reqcAnalyze::printReport() {
661
662 if (!_log) {
663 return;
664 }
665
666 *_log << "Marker name: " << _qcFile._markerName << endl
667 << "Receiver: " << _qcFile._receiverType << endl
668 << "Antenna: " << _qcFile._antennaName << endl
669 << "Start time: " << _qcFile._startTime.datestr().c_str() << ' '
670 << _qcFile._startTime.timestr().c_str() << endl
671 << "End time: " << _qcFile._endTime.datestr().c_str() << ' '
672 << _qcFile._endTime.timestr().c_str() << endl
673 << "Interval: " << _qcFile._interval << endl
674 << "# Sat.: " << _qcFile._qcSat.size() << endl;
675
676 int numObs = 0;
677 int numSlipsFlagged = 0;
678 int numSlipsFound = 0;
679 QMapIterator<t_prn, t_qcSat> it(_qcFile._qcSat);
680 while (it.hasNext()) {
681 it.next();
682 const t_qcSat& qcSat = it.value();
683 numObs += qcSat._numObs;
684 numSlipsFlagged += qcSat._numSlipsFlagged;
685 numSlipsFound += qcSat._numSlipsFound;
686 }
687 *_log << "# Obs.: " << numObs << endl
688 << "# Slips (file): " << numSlipsFlagged << endl
689 << "# Slips (found): " << numSlipsFound << endl;
690
691 _log->flush();
692}
Note: See TracBrowser for help on using the repository browser.