| 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 | 
 | 
|---|
| 34 | class t_polarPoint;
 | 
|---|
| 35 | 
 | 
|---|
| 36 | class t_qcObs {
 | 
|---|
| 37 |  public:
 | 
|---|
| 38 |   t_qcObs() {
 | 
|---|
| 39 |     _hasL1    = false;
 | 
|---|
| 40 |     _hasL2    = false;
 | 
|---|
| 41 |     _slipL1   = false;
 | 
|---|
| 42 |     _slipL2   = false;
 | 
|---|
| 43 |     _gapL1    = false;
 | 
|---|
| 44 |     _gapL2    = false;
 | 
|---|
| 45 |     _slotSet  = false;
 | 
|---|
| 46 |     _slotNum  = 0;
 | 
|---|
| 47 |     _MP1      = 0.0;
 | 
|---|
| 48 |     _MP2      = 0.0;
 | 
|---|
| 49 |     _SNR1     = 0.0;
 | 
|---|
| 50 |     _SNR2     = 0.0;
 | 
|---|
| 51 |   }
 | 
|---|
| 52 |   t_irc set(const t_satObs& obs);
 | 
|---|
| 53 |   double _eleDeg;
 | 
|---|
| 54 |   double _azDeg;
 | 
|---|
| 55 |   bool   _hasL1;
 | 
|---|
| 56 |   bool   _hasL2;
 | 
|---|
| 57 |   bool   _slipL1;
 | 
|---|
| 58 |   bool   _slipL2;
 | 
|---|
| 59 |   bool   _gapL1;
 | 
|---|
| 60 |   bool   _gapL2;
 | 
|---|
| 61 |   bool   _slotSet;
 | 
|---|
| 62 |   int    _slotNum;
 | 
|---|
| 63 |   double _MP1;
 | 
|---|
| 64 |   double _MP2;
 | 
|---|
| 65 |   double _SNR1;
 | 
|---|
| 66 |   double _SNR2;
 | 
|---|
| 67 | };
 | 
|---|
| 68 | 
 | 
|---|
| 69 | class t_qcEpo {
 | 
|---|
| 70 |  public:
 | 
|---|
| 71 |   bncTime              _epoTime;
 | 
|---|
| 72 |   double               _PDOP;
 | 
|---|
| 73 |   QMap<t_prn, t_qcObs> _qcObs;
 | 
|---|
| 74 | };
 | 
|---|
| 75 | 
 | 
|---|
| 76 | class t_qcSat {
 | 
|---|
| 77 |  public:
 | 
|---|
| 78 |   t_qcSat() {
 | 
|---|
| 79 |     _numObs          = 0;
 | 
|---|
| 80 |     _numSlipsFlagged = 0;
 | 
|---|
| 81 |     _numSlipsFound   = 0;
 | 
|---|
| 82 |     _numGaps         = 0;
 | 
|---|
| 83 |   }
 | 
|---|
| 84 |   int _numObs;
 | 
|---|
| 85 |   int _numSlipsFlagged;
 | 
|---|
| 86 |   int _numSlipsFound;
 | 
|---|
| 87 |   int _numGaps;
 | 
|---|
| 88 | };
 | 
|---|
| 89 | 
 | 
|---|
| 90 | class t_qcFile {
 | 
|---|
| 91 |  public:
 | 
|---|
| 92 |   t_qcFile() {clear();}
 | 
|---|
| 93 |   void clear() {_qcSat.clear(); _qcEpo.clear();}
 | 
|---|
| 94 |   bncTime              _startTime;
 | 
|---|
| 95 |   bncTime              _endTime;
 | 
|---|
| 96 |   QString              _antennaName;
 | 
|---|
| 97 |   QString              _markerName;
 | 
|---|
| 98 |   QString              _receiverType;
 | 
|---|
| 99 |   double               _interval;
 | 
|---|
| 100 |   QMap<t_prn, t_qcSat> _qcSat;
 | 
|---|
| 101 |   QVector<t_qcEpo>     _qcEpo;
 | 
|---|
| 102 |   QVector<t_qcEpo>     _qcEpoSampled;
 | 
|---|
| 103 | };
 | 
|---|
| 104 | 
 | 
|---|
| 105 | class t_reqcAnalyze : public QThread {
 | 
|---|
| 106 | Q_OBJECT
 | 
|---|
| 107 |  
 | 
|---|
| 108 |  public:
 | 
|---|
| 109 |   t_reqcAnalyze(QObject* parent);
 | 
|---|
| 110 |   virtual void run();
 | 
|---|
| 111 | 
 | 
|---|
| 112 |  protected:
 | 
|---|
| 113 |   ~t_reqcAnalyze();
 | 
|---|
| 114 | 
 | 
|---|
| 115 |  signals:
 | 
|---|
| 116 |   void finished();
 | 
|---|
| 117 | 
 | 
|---|
| 118 |  private:
 | 
|---|
| 119 |   void   analyzeFile(t_rnxObsFile* obsFile);
 | 
|---|
| 120 | 
 | 
|---|
| 121 |   void   updateQcSat(const t_qcObs& qcObs, t_qcSat& qcSat);
 | 
|---|
| 122 | 
 | 
|---|
| 123 |   t_irc  setQcObs(const t_satObs& satObs, t_qcObs& qcObs);
 | 
|---|
| 124 | 
 | 
|---|
| 125 |   void   preparePlotData(const t_rnxObsFile* obsFile);
 | 
|---|
| 126 | 
 | 
|---|
| 127 |   double cmpDOP(const ColumnVector& xyzSta) const;
 | 
|---|
| 128 | 
 | 
|---|
| 129 |   void   dspSkyPlot(const QString& fileName, const QByteArray& title1, 
 | 
|---|
| 130 |                     QVector<t_polarPoint*>* data1, const QByteArray& title2, 
 | 
|---|
| 131 |                     QVector<t_polarPoint*>* data2, const QByteArray& scaleTitle, double maxValue);
 | 
|---|
| 132 | 
 | 
|---|
| 133 |   void   dspAvailPlot(const QString& fileName, const QByteArray& title);
 | 
|---|
| 134 | 
 | 
|---|
| 135 |   void   printReport();
 | 
|---|
| 136 | 
 | 
|---|
| 137 |   QString                 _logFileName;
 | 
|---|
| 138 |   QFile*                  _logFile;
 | 
|---|
| 139 |   QTextStream*            _log;
 | 
|---|
| 140 |   QStringList             _obsFileNames;
 | 
|---|
| 141 |   QVector<t_rnxObsFile*>  _rnxObsFiles;
 | 
|---|
| 142 |   QStringList             _navFileNames;
 | 
|---|
| 143 |   QVector<t_eph*>         _ephs;
 | 
|---|
| 144 |   t_rnxObsFile::t_rnxEpo* _currEpo;
 | 
|---|
| 145 |   t_qcFile                _qcFile;
 | 
|---|
| 146 |   QMutex                  _mutex;
 | 
|---|
| 147 | };
 | 
|---|
| 148 | 
 | 
|---|
| 149 | #endif
 | 
|---|