[5678] | 1 | #ifndef PPP_H
|
---|
| 2 | #define PPP_H
|
---|
| 3 |
|
---|
| 4 | #include <string>
|
---|
[5747] | 5 | #include <vector>
|
---|
[5839] | 6 | #include <newmat.h>
|
---|
[5742] | 7 |
|
---|
| 8 | #include "bncconst.h"
|
---|
[5708] | 9 | #include "bnctime.h"
|
---|
[6101] | 10 | #include "ephemeris.h"
|
---|
[5742] | 11 | #include "t_prn.h"
|
---|
[5678] | 12 |
|
---|
[5814] | 13 | namespace BNC_PPP {
|
---|
[5678] | 14 |
|
---|
[5825] | 15 | class t_except {
|
---|
[5763] | 16 | public:
|
---|
[5825] | 17 | t_except(const char* msg) {
|
---|
[5763] | 18 | _msg = msg;
|
---|
| 19 | }
|
---|
[5825] | 20 | ~t_except() {}
|
---|
[5763] | 21 | std::string what() {return _msg;}
|
---|
| 22 | private:
|
---|
| 23 | std::string _msg;
|
---|
| 24 | };
|
---|
| 25 |
|
---|
[5743] | 26 | class t_output {
|
---|
[5678] | 27 | public:
|
---|
| 28 | bncTime _epoTime;
|
---|
| 29 | double _xyzRover[3];
|
---|
| 30 | double _covMatrix[6];
|
---|
[5877] | 31 | double _neu[3];
|
---|
[5678] | 32 | int _numSat;
|
---|
| 33 | double _pDop;
|
---|
| 34 | std::string _log;
|
---|
| 35 | bool _error;
|
---|
| 36 | };
|
---|
| 37 |
|
---|
[5819] | 38 | class t_frqObs {
|
---|
[5678] | 39 | public:
|
---|
[5819] | 40 | t_frqObs() {
|
---|
[5750] | 41 | _code = 0.0;
|
---|
| 42 | _codeValid = false;
|
---|
| 43 | _phase = 0.0;
|
---|
| 44 | _phaseValid = false;
|
---|
| 45 | _doppler = 0.0;
|
---|
| 46 | _dopplerValid = false;
|
---|
| 47 | _snr = 0.0;
|
---|
| 48 | _snrValid = false;
|
---|
| 49 | _slip = false;
|
---|
| 50 | _slipCounter = 0;
|
---|
| 51 | _biasJumpCounter = 0;
|
---|
| 52 | }
|
---|
[6018] | 53 | std::string _rnxType2ch;
|
---|
| 54 | double _code;
|
---|
| 55 | bool _codeValid;
|
---|
| 56 | double _phase;
|
---|
| 57 | bool _phaseValid;
|
---|
| 58 | double _doppler;
|
---|
| 59 | bool _dopplerValid;
|
---|
| 60 | double _snr;
|
---|
| 61 | bool _snrValid;
|
---|
| 62 | bool _slip;
|
---|
| 63 | int _slipCounter;
|
---|
| 64 | int _biasJumpCounter;
|
---|
[5678] | 65 | };
|
---|
| 66 |
|
---|
[5819] | 67 | class t_satObs {
|
---|
[5678] | 68 | public:
|
---|
[5819] | 69 | t_satObs() {}
|
---|
| 70 | ~t_satObs() {for (unsigned ii = 0; ii < _obs.size(); ii++) delete _obs[ii];}
|
---|
[5784] | 71 | t_prn _prn;
|
---|
| 72 | bncTime _time;
|
---|
[5819] | 73 | std::vector<t_frqObs*> _obs;
|
---|
[5678] | 74 | };
|
---|
| 75 |
|
---|
[5742] | 76 | class t_orbCorr {
|
---|
[5678] | 77 | public:
|
---|
[5749] | 78 | t_prn prn() const {return _prn;}
|
---|
| 79 | unsigned short IOD() const {return _iod;}
|
---|
[5742] | 80 | t_prn _prn;
|
---|
[5678] | 81 | unsigned short _iod;
|
---|
| 82 | bncTime _time;
|
---|
| 83 | char _system;
|
---|
| 84 | double _xr[3];
|
---|
[5839] | 85 | double _dotXr[3];
|
---|
[5678] | 86 | };
|
---|
| 87 |
|
---|
[5742] | 88 | class t_clkCorr {
|
---|
[5678] | 89 | public:
|
---|
[5749] | 90 | t_prn prn() const {return _prn;}
|
---|
| 91 | unsigned short IOD() const {return _iod;}
|
---|
[5742] | 92 | t_prn _prn;
|
---|
[5678] | 93 | unsigned short _iod;
|
---|
| 94 | bncTime _time;
|
---|
| 95 | double _dClk;
|
---|
| 96 | double _dotDClk;
|
---|
| 97 | double _dotDotDClk;
|
---|
| 98 | double _clkPartial;
|
---|
| 99 | };
|
---|
| 100 |
|
---|
[5825] | 101 | class t_frqBias {
|
---|
[5678] | 102 | public:
|
---|
[5825] | 103 | t_frqBias() {
|
---|
| 104 | _code = 0.0;
|
---|
| 105 | _codeValid = false;
|
---|
| 106 | _phase = 0.0;
|
---|
| 107 | _phaseValid = false;
|
---|
| 108 | }
|
---|
| 109 | std::string _rnxType2ch;
|
---|
| 110 | double _code;
|
---|
| 111 | bool _codeValid;
|
---|
| 112 | double _phase;
|
---|
| 113 | bool _phaseValid;
|
---|
[5678] | 114 | };
|
---|
| 115 |
|
---|
[5825] | 116 | class t_satBias {
|
---|
[5678] | 117 | public:
|
---|
[5825] | 118 | t_prn _prn;
|
---|
| 119 | bncTime _time;
|
---|
| 120 | int _nx;
|
---|
| 121 | int _jumpCount;
|
---|
| 122 | std::vector<t_frqBias> _bias;
|
---|
[5678] | 123 | };
|
---|
| 124 |
|
---|
| 125 | class t_lc {
|
---|
| 126 | public:
|
---|
| 127 | enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, maxLc};
|
---|
| 128 |
|
---|
| 129 | static bool includesPhase(type tt) {
|
---|
[6021] | 130 | switch (tt) {
|
---|
| 131 | case l1:
|
---|
| 132 | case l2:
|
---|
| 133 | case lIF:
|
---|
| 134 | case MW:
|
---|
| 135 | case CL:
|
---|
| 136 | return true;
|
---|
| 137 | case c1:
|
---|
| 138 | case c2:
|
---|
| 139 | case cIF:
|
---|
| 140 | return false;
|
---|
| 141 | case dummy: case maxLc: return false;
|
---|
| 142 | }
|
---|
[5678] | 143 | return false;
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 | static bool includesCode(type tt) {
|
---|
[6021] | 147 | switch (tt) {
|
---|
| 148 | case c1:
|
---|
| 149 | case c2:
|
---|
| 150 | case cIF:
|
---|
| 151 | case MW:
|
---|
| 152 | case CL:
|
---|
| 153 | return true;
|
---|
| 154 | case l1:
|
---|
| 155 | case l2:
|
---|
| 156 | case lIF:
|
---|
| 157 | return false;
|
---|
| 158 | case dummy: case maxLc: return false;
|
---|
| 159 | }
|
---|
[5678] | 160 | return false;
|
---|
| 161 | }
|
---|
| 162 |
|
---|
[6021] | 163 | static t_frequency::type toFreq(char sys, type tt) {
|
---|
| 164 | switch (tt) {
|
---|
| 165 | case l1: case c1:
|
---|
| 166 | if (sys == 'G') return t_frequency::G1;
|
---|
| 167 | else if (sys == 'R') return t_frequency::R1;
|
---|
| 168 | else if (sys == 'E') return t_frequency::E1;
|
---|
| 169 | else return t_frequency::dummy;
|
---|
| 170 | case l2: case c2:
|
---|
| 171 | if (sys == 'G') return t_frequency::G2;
|
---|
| 172 | else if (sys == 'R') return t_frequency::R2;
|
---|
| 173 | else return t_frequency::dummy;
|
---|
| 174 | case lIF: case cIF: case MW: case CL:
|
---|
| 175 | return t_frequency::dummy;
|
---|
| 176 | case dummy: case maxLc: return t_frequency::dummy;
|
---|
| 177 | }
|
---|
| 178 | return t_frequency::dummy;
|
---|
| 179 | }
|
---|
| 180 |
|
---|
[5678] | 181 | static std::string toString(type tt) {
|
---|
[6021] | 182 | switch (tt) {
|
---|
| 183 | case l1: return "l1";
|
---|
| 184 | case l2: return "l2";
|
---|
| 185 | case lIF: return "lIF";
|
---|
| 186 | case MW: return "MW";
|
---|
| 187 | case CL: return "CL";
|
---|
| 188 | case c1: return "c1";
|
---|
| 189 | case c2: return "c2";
|
---|
| 190 | case cIF: return "cIF";
|
---|
| 191 | case dummy: case maxLc: return "";
|
---|
| 192 | }
|
---|
| 193 | return "";
|
---|
[5678] | 194 | }
|
---|
| 195 | };
|
---|
| 196 |
|
---|
[6101] | 197 | class interface_pppClient {
|
---|
| 198 | public:
|
---|
[6103] | 199 | virtual ~interface_pppClient() {};
|
---|
[6101] | 200 | virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
|
---|
| 201 | virtual void putEphemeris(const t_eph* eph) = 0;
|
---|
| 202 | virtual void putOrbCorrections(const std::vector<t_orbCorr*>& corr) = 0;
|
---|
| 203 | virtual void putClkCorrections(const std::vector<t_clkCorr*>& corr) = 0;
|
---|
| 204 | virtual void putBiases(const std::vector<t_satBias*>& satBias) = 0;
|
---|
| 205 | };
|
---|
| 206 |
|
---|
[5814] | 207 | } // namespace BNC_PPP
|
---|
[5678] | 208 |
|
---|
| 209 | #endif
|
---|