[2035] | 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 BNCPPPCLIENT_H
|
---|
| 26 | #define BNCPPPCLIENT_H
|
---|
| 27 |
|
---|
| 28 | #include <QtNetwork>
|
---|
| 29 |
|
---|
| 30 | #include <newmat.h>
|
---|
| 31 |
|
---|
| 32 | #include "bncconst.h"
|
---|
[2123] | 33 | #include "bnctime.h"
|
---|
[2035] | 34 | #include "RTCM/GPSDecoder.h"
|
---|
| 35 | #include "RTCM3/ephemeris.h"
|
---|
| 36 |
|
---|
[2058] | 37 | class bncModel;
|
---|
| 38 |
|
---|
[2039] | 39 | class t_satData {
|
---|
[2035] | 40 | public:
|
---|
[2051] | 41 | enum codeType {P_CODE, C_CODE};
|
---|
[2240] | 42 | QString prn;
|
---|
[2051] | 43 | double P1;
|
---|
| 44 | double P2;
|
---|
| 45 | double P3;
|
---|
| 46 | double L1;
|
---|
| 47 | double L2;
|
---|
| 48 | double L3;
|
---|
| 49 | codeType codeTypeF1;
|
---|
| 50 | codeType codeTypeF2;
|
---|
[2049] | 51 | ColumnVector xx;
|
---|
| 52 | ColumnVector vv;
|
---|
| 53 | double clk;
|
---|
| 54 | bool clkCorr;
|
---|
[2065] | 55 | double eleSat;
|
---|
| 56 | double azSat;
|
---|
[2060] | 57 | double rho;
|
---|
[2035] | 58 | };
|
---|
| 59 |
|
---|
[2039] | 60 | class t_epoData {
|
---|
| 61 | public:
|
---|
| 62 | t_epoData() {}
|
---|
| 63 | ~t_epoData() {
|
---|
[2231] | 64 | QMapIterator<QString, t_satData*> itGPS(satDataGPS);
|
---|
| 65 | while (itGPS.hasNext()) {
|
---|
| 66 | itGPS.next();
|
---|
| 67 | delete itGPS.value();
|
---|
[2039] | 68 | }
|
---|
[2231] | 69 | QMapIterator<QString, t_satData*> itGlo(satDataGlo);
|
---|
| 70 | while (itGlo.hasNext()) {
|
---|
| 71 | itGlo.next();
|
---|
| 72 | delete itGlo.value();
|
---|
| 73 | }
|
---|
[2039] | 74 | }
|
---|
[2231] | 75 | unsigned sizeGPS() const {return satDataGPS.size();}
|
---|
| 76 | unsigned sizeGlo() const {return satDataGlo.size();}
|
---|
| 77 | unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
|
---|
[2123] | 78 | bncTime tt;
|
---|
[2231] | 79 | QMap<QString, t_satData*> satDataGPS;
|
---|
| 80 | QMap<QString, t_satData*> satDataGlo;
|
---|
[2039] | 81 | };
|
---|
| 82 |
|
---|
[2035] | 83 | class t_corr {
|
---|
| 84 | public:
|
---|
[2208] | 85 | t_corr() {
|
---|
| 86 | raoSet = false;
|
---|
| 87 | dClkSet = false;
|
---|
| 88 | }
|
---|
| 89 | bool ready() {return raoSet && dClkSet;}
|
---|
[2123] | 90 | bncTime tt;
|
---|
[2044] | 91 | int iod;
|
---|
| 92 | double dClk;
|
---|
| 93 | ColumnVector rao;
|
---|
[2208] | 94 | bool raoSet;
|
---|
| 95 | bool dClkSet;
|
---|
[2035] | 96 | };
|
---|
| 97 |
|
---|
[2274] | 98 | class t_bias {
|
---|
| 99 | public:
|
---|
| 100 | t_bias() {
|
---|
| 101 | c1 = 0.0;
|
---|
| 102 | p1 = 0.0;
|
---|
| 103 | c2 = 0.0;
|
---|
| 104 | p2 = 0.0;
|
---|
| 105 | }
|
---|
| 106 | bncTime tt;
|
---|
| 107 | double c1;
|
---|
| 108 | double p1;
|
---|
| 109 | double c2;
|
---|
| 110 | double p2;
|
---|
| 111 | };
|
---|
| 112 |
|
---|
[2036] | 113 | class bncPPPclient : public QObject {
|
---|
[2035] | 114 | Q_OBJECT
|
---|
| 115 |
|
---|
| 116 | public:
|
---|
| 117 | bncPPPclient(QByteArray staID);
|
---|
| 118 | ~bncPPPclient();
|
---|
| 119 | void putNewObs(p_obs pp);
|
---|
| 120 |
|
---|
| 121 | public slots:
|
---|
| 122 | void slotNewEphGPS(gpsephemeris gpseph);
|
---|
[2225] | 123 | void slotNewEphGlonass(glonassephemeris gloeph);
|
---|
[2035] | 124 | void slotNewCorrections(QList<QString> corrList);
|
---|
| 125 |
|
---|
[2142] | 126 | signals:
|
---|
[2145] | 127 | void newPosition(bncTime time, double x, double y, double z);
|
---|
[2182] | 128 | void newNMEAstr(QByteArray str);
|
---|
[2142] | 129 |
|
---|
[2035] | 130 | private:
|
---|
[2123] | 131 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
[2042] | 132 | ColumnVector& xc, ColumnVector& vv, bool& corr);
|
---|
[2035] | 133 | void processEpoch();
|
---|
[2042] | 134 | void applyCorr(const t_corr* cc, ColumnVector& xc, ColumnVector& vv);
|
---|
[2240] | 135 | t_irc cmpToT(t_satData* satData);
|
---|
[2042] | 136 |
|
---|
[2035] | 137 | QByteArray _staID;
|
---|
| 138 | QMutex _mutex;
|
---|
| 139 | QMap<QString, t_eph*> _eph;
|
---|
| 140 | QMap<QString, t_corr*> _corr;
|
---|
[2274] | 141 | QMap<QString, t_bias*> _bias;
|
---|
[2039] | 142 | t_epoData* _epoData;
|
---|
[2058] | 143 | bncModel* _model;
|
---|
[2226] | 144 | bool _useGlonass;
|
---|
[2035] | 145 | };
|
---|
| 146 |
|
---|
| 147 | #endif
|
---|