[2057] | 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 BNCMODEL_H
|
---|
| 26 | #define BNCMODEL_H
|
---|
| 27 |
|
---|
| 28 | #include <QtCore>
|
---|
[2178] | 29 | #include <QtNetwork>
|
---|
[2057] | 30 | #include <newmat.h>
|
---|
| 31 |
|
---|
[2058] | 32 | #include "bncconst.h"
|
---|
[2143] | 33 | #include "bnctime.h"
|
---|
[2058] | 34 |
|
---|
| 35 | class t_epoData;
|
---|
[2060] | 36 | class t_satData;
|
---|
[2881] | 37 | class bncAntex;
|
---|
[3636] | 38 | class t_pppOpt;
|
---|
[3638] | 39 | class bncPPPclient;
|
---|
[2058] | 40 |
|
---|
[2057] | 41 | class bncParam {
|
---|
| 42 | public:
|
---|
[2782] | 43 | enum parType {CRD_X, CRD_Y, CRD_Z, RECCLK, TROPO, AMB_L3, GALILEO_OFFSET};
|
---|
[2080] | 44 | bncParam(parType typeIn, int indexIn, const QString& prn);
|
---|
[2057] | 45 | ~bncParam();
|
---|
[2240] | 46 | double partial(t_satData* satData, bool phase);
|
---|
[2073] | 47 | bool isCrd() const {
|
---|
| 48 | return (type == CRD_X || type == CRD_Y || type == CRD_Z);
|
---|
| 49 | }
|
---|
[2059] | 50 | parType type;
|
---|
[2073] | 51 | double xx;
|
---|
| 52 | int index;
|
---|
[2080] | 53 | int index_old;
|
---|
[3330] | 54 | int numEpo;
|
---|
[2080] | 55 | QString prn;
|
---|
[2058] | 56 | };
|
---|
[2057] | 57 |
|
---|
[3639] | 58 | class bncModel {
|
---|
[2058] | 59 | public:
|
---|
[3638] | 60 | bncModel(bncPPPclient* pppClient);
|
---|
[2058] | 61 | ~bncModel();
|
---|
[2060] | 62 | t_irc update(t_epoData* epoData);
|
---|
[2240] | 63 | bncTime time() const {return _time;}
|
---|
| 64 | double x() const {return _params[0]->xx;}
|
---|
| 65 | double y() const {return _params[1]->xx;}
|
---|
| 66 | double z() const {return _params[2]->xx;}
|
---|
[2265] | 67 | double clk() const {return _params[3]->xx;}
|
---|
[2240] | 68 | double trp() const {
|
---|
| 69 | for (int ii = 0; ii < _params.size(); ++ii) {
|
---|
| 70 | bncParam* pp = _params[ii];
|
---|
| 71 | if (pp->type == bncParam::TROPO) {
|
---|
| 72 | return pp->xx;
|
---|
| 73 | }
|
---|
| 74 | }
|
---|
| 75 | return 0.0;
|
---|
| 76 | }
|
---|
[2782] | 77 | double Galileo_offset() const {
|
---|
| 78 | for (int ii = 0; ii < _params.size(); ++ii) {
|
---|
| 79 | bncParam* pp = _params[ii];
|
---|
| 80 | if (pp->type == bncParam::GALILEO_OFFSET) {
|
---|
| 81 | return pp->xx;
|
---|
| 82 | }
|
---|
| 83 | }
|
---|
| 84 | return 0.0;
|
---|
| 85 | }
|
---|
[2240] | 86 |
|
---|
[2932] | 87 | static void kalman(const Matrix& AA, const ColumnVector& ll,
|
---|
| 88 | const DiagonalMatrix& PP,
|
---|
| 89 | SymmetricMatrix& QQ, ColumnVector& dx);
|
---|
| 90 |
|
---|
[2057] | 91 | private:
|
---|
[3408] | 92 | t_irc cmpBancroft(t_epoData* epoData);
|
---|
[3107] | 93 | void reset();
|
---|
[2789] | 94 | void cmpEle(t_satData* satData);
|
---|
| 95 | void addAmb(t_satData* satData);
|
---|
[3309] | 96 | void addObs(int iPhase, unsigned& iObs, t_satData* satData,
|
---|
[2790] | 97 | Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP);
|
---|
[3408] | 98 | QByteArray printRes(int iPhase, const ColumnVector& vv,
|
---|
| 99 | const QMap<QString, t_satData*>& satDataMap);
|
---|
| 100 | void findMaxRes(const ColumnVector& vv,
|
---|
[2792] | 101 | const QMap<QString, t_satData*>& satData,
|
---|
[3414] | 102 | QString& prnGPS, QString& prnGlo,
|
---|
| 103 | double& maxResGPS, double& maxResGlo);
|
---|
[2583] | 104 | double cmpValue(t_satData* satData, bool phase);
|
---|
[2065] | 105 | double delay_saast(double Ele);
|
---|
[3309] | 106 | void predict(int iPhase, t_epoData* epoData);
|
---|
[3321] | 107 | t_irc update_p(t_epoData* epoData);
|
---|
[3412] | 108 | QString outlierDetection(int iPhase, const ColumnVector& vv,
|
---|
| 109 | QMap<QString, t_satData*>& satData);
|
---|
[2130] | 110 | void writeNMEAstr(const QString& nmStr);
|
---|
[2063] | 111 |
|
---|
[2582] | 112 | double windUp(const QString& prn, const ColumnVector& rSat,
|
---|
| 113 | const ColumnVector& rRec);
|
---|
| 114 |
|
---|
[2874] | 115 | bncTime _startTime;
|
---|
[2648] | 116 |
|
---|
[3408] | 117 | void rememberState(t_epoData* epoData);
|
---|
| 118 | void restoreState(t_epoData* epoData);
|
---|
[3412] | 119 |
|
---|
| 120 | t_irc selectSatellites(const QString& lastOutlierPrn,
|
---|
| 121 | QMap<QString, t_satData*>& satData);
|
---|
[3323] | 122 |
|
---|
[2595] | 123 | class pppPos {
|
---|
| 124 | public:
|
---|
[2670] | 125 | pppPos() {
|
---|
| 126 | for (int ii = 0; ii < 7; ++ii) {
|
---|
| 127 | xnt[ii] = 0.0;
|
---|
| 128 | }
|
---|
| 129 | }
|
---|
[2595] | 130 | bncTime time;
|
---|
[2670] | 131 | double xnt[7];
|
---|
[2595] | 132 | };
|
---|
| 133 |
|
---|
[3638] | 134 | bncPPPclient* _pppClient;
|
---|
[3636] | 135 | const t_pppOpt* _opt;
|
---|
[2582] | 136 | bncTime _time;
|
---|
[3106] | 137 | bncTime _lastTimeOK;
|
---|
[2582] | 138 | QByteArray _staID;
|
---|
| 139 | QVector<bncParam*> _params;
|
---|
| 140 | SymmetricMatrix _QQ;
|
---|
[3323] | 141 | QVector<bncParam*> _params_sav;
|
---|
| 142 | SymmetricMatrix _QQ_sav;
|
---|
[3408] | 143 | t_epoData* _epoData_sav;
|
---|
[2582] | 144 | ColumnVector _xcBanc;
|
---|
| 145 | ColumnVector _ellBanc;
|
---|
| 146 | QByteArray _log;
|
---|
| 147 | QFile* _nmeaFile;
|
---|
| 148 | QTextStream* _nmeaStream;
|
---|
| 149 | QMap<QString, double> _windUpTime;
|
---|
| 150 | QMap<QString, double> _windUpSum;
|
---|
[2648] | 151 | QVector<pppPos*> _posAverage;
|
---|
[3412] | 152 | QStringList _outlierGPS;
|
---|
| 153 | QStringList _outlierGlo;
|
---|
[3636] | 154 | bncAntex* _antex;
|
---|
[2057] | 155 | };
|
---|
| 156 |
|
---|
| 157 | #endif
|
---|