[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"
|
---|
[6135] | 12 | #include "satObs.h"
|
---|
[5678] | 13 |
|
---|
[5814] | 14 | namespace BNC_PPP {
|
---|
[5678] | 15 |
|
---|
[5825] | 16 | class t_except {
|
---|
[5763] | 17 | public:
|
---|
[5825] | 18 | t_except(const char* msg) {
|
---|
[5763] | 19 | _msg = msg;
|
---|
| 20 | }
|
---|
[5825] | 21 | ~t_except() {}
|
---|
[5763] | 22 | std::string what() {return _msg;}
|
---|
| 23 | private:
|
---|
| 24 | std::string _msg;
|
---|
| 25 | };
|
---|
| 26 |
|
---|
[5743] | 27 | class t_output {
|
---|
[5678] | 28 | public:
|
---|
[7926] | 29 | bncTime _epoTime;
|
---|
| 30 | double _xyzRover[3];
|
---|
| 31 | double _covMatrix[6];
|
---|
| 32 | double _neu[3];
|
---|
[6653] | 33 | double _trp0;
|
---|
| 34 | double _trp;
|
---|
| 35 | double _trpStdev;
|
---|
[7926] | 36 | int _numSat;
|
---|
| 37 | double _hDop;
|
---|
| 38 | std::string _log;
|
---|
| 39 | bool _error;
|
---|
[5678] | 40 | };
|
---|
| 41 |
|
---|
[10251] | 42 |
|
---|
| 43 | class t_frqBand {
|
---|
| 44 | public:
|
---|
| 45 | static t_frequency::type toFreq(char sys, char bb) {
|
---|
| 46 | switch (bb) {
|
---|
| 47 | case '1':
|
---|
| 48 | if (sys == 'G') return t_frequency::G1;
|
---|
| 49 | else if (sys == 'R') return t_frequency::R1;
|
---|
| 50 | else if (sys == 'E') return t_frequency::E1;
|
---|
| 51 | else if (sys == 'C') return t_frequency::C1;
|
---|
| 52 | else return t_frequency::dummy;
|
---|
| 53 | case '2':
|
---|
| 54 | if (sys == 'G') return t_frequency::G2;
|
---|
| 55 | else if (sys == 'R') return t_frequency::R2;
|
---|
| 56 | else if (sys == 'C') return t_frequency::C2;
|
---|
| 57 | else return t_frequency::dummy;
|
---|
| 58 | case '5':
|
---|
| 59 | if (sys == 'G') return t_frequency::G5;
|
---|
| 60 | else if (sys == 'E') return t_frequency::E5;
|
---|
| 61 | else if (sys == 'C') return t_frequency::C5;
|
---|
| 62 | else return t_frequency::dummy;
|
---|
| 63 | case '6':
|
---|
| 64 | if (sys == 'E') return t_frequency::E6;
|
---|
| 65 | else if (sys == 'C') return t_frequency::C6;
|
---|
| 66 | else return t_frequency::dummy;
|
---|
| 67 | case '7':
|
---|
| 68 | if (sys == 'E') return t_frequency::E7;
|
---|
| 69 | else if (sys == 'C') return t_frequency::C7;
|
---|
| 70 | else return t_frequency::dummy;
|
---|
| 71 | case '8':
|
---|
| 72 | if (sys == 'E') return t_frequency::E8;
|
---|
| 73 | else if (sys == 'C') return t_frequency::C8;
|
---|
| 74 | else return t_frequency::dummy;
|
---|
| 75 | }
|
---|
| 76 | return t_frequency::dummy;
|
---|
| 77 | }
|
---|
| 78 | };
|
---|
| 79 |
|
---|
[5678] | 80 | class t_lc {
|
---|
| 81 | public:
|
---|
[9547] | 82 | enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, GIM, maxLc};
|
---|
[5678] | 83 |
|
---|
| 84 | static bool includesPhase(type tt) {
|
---|
[6021] | 85 | switch (tt) {
|
---|
| 86 | case l1:
|
---|
| 87 | case l2:
|
---|
| 88 | case lIF:
|
---|
| 89 | case MW:
|
---|
| 90 | case CL:
|
---|
| 91 | return true;
|
---|
| 92 | case c1:
|
---|
| 93 | case c2:
|
---|
| 94 | case cIF:
|
---|
| 95 | return false;
|
---|
[8961] | 96 | case dummy:
|
---|
| 97 | case maxLc:
|
---|
[8905] | 98 | case GIM:
|
---|
| 99 | return false;
|
---|
[6021] | 100 | }
|
---|
[5678] | 101 | return false;
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | static bool includesCode(type tt) {
|
---|
[6021] | 105 | switch (tt) {
|
---|
| 106 | case c1:
|
---|
| 107 | case c2:
|
---|
| 108 | case cIF:
|
---|
| 109 | case MW:
|
---|
| 110 | case CL:
|
---|
| 111 | return true;
|
---|
| 112 | case l1:
|
---|
| 113 | case l2:
|
---|
| 114 | case lIF:
|
---|
| 115 | return false;
|
---|
[8961] | 116 | case dummy:
|
---|
| 117 | case maxLc:
|
---|
[8905] | 118 | case GIM:
|
---|
| 119 | return false;
|
---|
[6021] | 120 | }
|
---|
[5678] | 121 | return false;
|
---|
| 122 | }
|
---|
| 123 |
|
---|
[6021] | 124 | static t_frequency::type toFreq(char sys, type tt) {
|
---|
| 125 | switch (tt) {
|
---|
| 126 | case l1: case c1:
|
---|
| 127 | if (sys == 'G') return t_frequency::G1;
|
---|
| 128 | else if (sys == 'R') return t_frequency::R1;
|
---|
| 129 | else if (sys == 'E') return t_frequency::E1;
|
---|
[6973] | 130 | else if (sys == 'C') return t_frequency::C2;
|
---|
[6021] | 131 | else return t_frequency::dummy;
|
---|
| 132 | case l2: case c2:
|
---|
| 133 | if (sys == 'G') return t_frequency::G2;
|
---|
| 134 | else if (sys == 'R') return t_frequency::R2;
|
---|
[6973] | 135 | else if (sys == 'E') return t_frequency::E5;
|
---|
[9386] | 136 | else if (sys == 'C') return t_frequency::C6;
|
---|
[6021] | 137 | else return t_frequency::dummy;
|
---|
[7926] | 138 | case lIF: case cIF: case MW: case CL:
|
---|
[6021] | 139 | return t_frequency::dummy;
|
---|
[8961] | 140 | case dummy:
|
---|
| 141 | case maxLc:
|
---|
[8905] | 142 | case GIM:
|
---|
| 143 | return t_frequency::dummy;
|
---|
[6021] | 144 | }
|
---|
| 145 | return t_frequency::dummy;
|
---|
| 146 | }
|
---|
| 147 |
|
---|
[5678] | 148 | static std::string toString(type tt) {
|
---|
[6021] | 149 | switch (tt) {
|
---|
| 150 | case l1: return "l1";
|
---|
| 151 | case l2: return "l2";
|
---|
| 152 | case lIF: return "lIF";
|
---|
| 153 | case MW: return "MW";
|
---|
| 154 | case CL: return "CL";
|
---|
| 155 | case c1: return "c1";
|
---|
| 156 | case c2: return "c2";
|
---|
| 157 | case cIF: return "cIF";
|
---|
[8905] | 158 | case GIM: return "GIM";
|
---|
[8961] | 159 | case dummy:
|
---|
| 160 | case maxLc:
|
---|
[8905] | 161 | return "";
|
---|
[6021] | 162 | }
|
---|
| 163 | return "";
|
---|
[5678] | 164 | }
|
---|
| 165 | };
|
---|
| 166 |
|
---|
[6101] | 167 | class interface_pppClient {
|
---|
| 168 | public:
|
---|
[6103] | 169 | virtual ~interface_pppClient() {};
|
---|
[6101] | 170 | virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
|
---|
[7926] | 171 | virtual void putEphemeris(const t_eph* eph) = 0;
|
---|
| 172 | virtual void putOrbCorrections(const std::vector<t_orbCorr*>& corr) = 0;
|
---|
| 173 | virtual void putClkCorrections(const std::vector<t_clkCorr*>& corr) = 0;
|
---|
[6465] | 174 | virtual void putCodeBiases(const std::vector<t_satCodeBias*>& satCodeBias) = 0;
|
---|
[7926] | 175 | };
|
---|
[6101] | 176 |
|
---|
[5814] | 177 | } // namespace BNC_PPP
|
---|
[5678] | 178 |
|
---|
| 179 | #endif
|
---|