[6054] | 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 <queue>
|
---|
| 29 | #include "bncephuser.h"
|
---|
[6055] | 30 | #include "GPSDecoder.h"
|
---|
[6054] | 31 |
|
---|
[6055] | 32 |
|
---|
| 33 | namespace BNC_PPP {
|
---|
| 34 |
|
---|
[6054] | 35 | class bncModel;
|
---|
[6055] | 36 | class t_pppOptions;
|
---|
[6054] | 37 |
|
---|
| 38 | class t_satData {
|
---|
| 39 | public:
|
---|
| 40 | t_satData() {
|
---|
| 41 | obsIndex = 0;
|
---|
| 42 | P1 = 0.0;
|
---|
| 43 | P2 = 0.0;
|
---|
| 44 | P5 = 0.0;
|
---|
| 45 | P3 = 0.0;
|
---|
| 46 | L1 = 0.0;
|
---|
| 47 | L2 = 0.0;
|
---|
| 48 | L5 = 0.0;
|
---|
| 49 | L3 = 0.0;
|
---|
| 50 | }
|
---|
| 51 | ~t_satData() {}
|
---|
| 52 | bncTime tt;
|
---|
| 53 | QString prn;
|
---|
| 54 | double P1;
|
---|
| 55 | double P2;
|
---|
| 56 | double P5;
|
---|
| 57 | double P3;
|
---|
| 58 | double L1;
|
---|
| 59 | double L2;
|
---|
| 60 | double L5;
|
---|
| 61 | double L3;
|
---|
| 62 | ColumnVector xx;
|
---|
| 63 | ColumnVector vv;
|
---|
| 64 | double clk;
|
---|
| 65 | double eleSat;
|
---|
| 66 | double azSat;
|
---|
| 67 | double rho;
|
---|
| 68 | bool slipFlag;
|
---|
| 69 | double lambda3;
|
---|
| 70 | unsigned obsIndex;
|
---|
| 71 | char system() const {return prn.toAscii()[0];}
|
---|
| 72 | };
|
---|
| 73 |
|
---|
| 74 | class t_epoData {
|
---|
| 75 | public:
|
---|
| 76 | t_epoData() {}
|
---|
| 77 |
|
---|
| 78 | ~t_epoData() {
|
---|
| 79 | clear();
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | void clear() {
|
---|
| 83 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 84 | while (it.hasNext()) {
|
---|
| 85 | it.next();
|
---|
| 86 | delete it.value();
|
---|
| 87 | }
|
---|
| 88 | satData.clear();
|
---|
| 89 | }
|
---|
| 90 |
|
---|
| 91 | void deepCopy(const t_epoData* from) {
|
---|
| 92 | clear();
|
---|
| 93 | tt = from->tt;
|
---|
| 94 | QMapIterator<QString, t_satData*> it(from->satData);
|
---|
| 95 | while (it.hasNext()) {
|
---|
| 96 | it.next();
|
---|
| 97 | satData[it.key()] = new t_satData(*it.value());
|
---|
| 98 | }
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | unsigned sizeSys(char system) const {
|
---|
| 102 | unsigned ans = 0;
|
---|
| 103 | QMapIterator<QString, t_satData*> it(satData);
|
---|
| 104 | while (it.hasNext()) {
|
---|
| 105 | it.next();
|
---|
| 106 | if (it.value()->system() == system) {
|
---|
| 107 | ++ans;
|
---|
| 108 | }
|
---|
| 109 | }
|
---|
| 110 | return ans;
|
---|
| 111 | }
|
---|
| 112 | unsigned sizeAll() const {return satData.size();}
|
---|
| 113 |
|
---|
| 114 | bncTime tt;
|
---|
| 115 | QMap<QString, t_satData*> satData;
|
---|
| 116 | };
|
---|
| 117 |
|
---|
| 118 | class bncPPPclient : public bncEphUser {
|
---|
| 119 | public:
|
---|
[6065] | 120 | bncPPPclient(QByteArray staID, t_pppOptions* opt);
|
---|
[6054] | 121 | ~bncPPPclient();
|
---|
[6065] | 122 | void putNewObs(const t_obs& pp);
|
---|
| 123 | void putNewCorrections(QList<QString> corrList);
|
---|
| 124 |
|
---|
| 125 | QByteArray staID() const {return _staID;}
|
---|
[6055] | 126 | const t_pppOptions* opt() const {return _opt;}
|
---|
[6054] | 127 |
|
---|
[6065] | 128 | static t_irc applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc, ColumnVector& vv);
|
---|
[6054] | 129 |
|
---|
| 130 |
|
---|
| 131 | private:
|
---|
| 132 | class slipInfo {
|
---|
| 133 | public:
|
---|
| 134 | slipInfo() {
|
---|
| 135 | slipCntL1 = -1;
|
---|
| 136 | slipCntL2 = -1;
|
---|
| 137 | slipCntL5 = -1;
|
---|
| 138 | }
|
---|
| 139 | ~slipInfo(){}
|
---|
| 140 | int slipCntL1;
|
---|
| 141 | int slipCntL2;
|
---|
| 142 | int slipCntL5;
|
---|
| 143 | };
|
---|
| 144 |
|
---|
| 145 | t_irc getSatPos(const bncTime& tt, const QString& prn,
|
---|
| 146 | ColumnVector& xc, ColumnVector& vv);
|
---|
| 147 | void processEpochs();
|
---|
| 148 | void processFrontEpoch();
|
---|
| 149 | t_irc cmpToT(t_satData* satData);
|
---|
| 150 |
|
---|
[6065] | 151 | const t_pppOptions* _opt;
|
---|
[6054] | 152 | QByteArray _staID;
|
---|
| 153 | QMap<QString, t_corr*> _corr;
|
---|
| 154 | bncTime _corr_tt;
|
---|
| 155 | QMap<QString, t_bias*> _bias;
|
---|
| 156 | std::queue<t_epoData*> _epoData;
|
---|
| 157 | bncModel* _model;
|
---|
| 158 | QMap<QString, slipInfo> _slips;
|
---|
| 159 | };
|
---|
| 160 |
|
---|
[6055] | 161 | }
|
---|
| 162 |
|
---|
[6054] | 163 | #endif
|
---|