[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:
|
---|
| 29 | bncTime _epoTime;
|
---|
| 30 | double _xyzRover[3];
|
---|
| 31 | double _covMatrix[6];
|
---|
[5877] | 32 | double _neu[3];
|
---|
[6653] | 33 | double _trp0;
|
---|
| 34 | double _trp;
|
---|
| 35 | double _trpStdev;
|
---|
[5678] | 36 | int _numSat;
|
---|
[7931] | 37 | double _hDop;
|
---|
[5678] | 38 | std::string _log;
|
---|
| 39 | bool _error;
|
---|
| 40 | };
|
---|
| 41 |
|
---|
| 42 | class t_lc {
|
---|
| 43 | public:
|
---|
| 44 | enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, maxLc};
|
---|
| 45 |
|
---|
| 46 | static bool includesPhase(type tt) {
|
---|
[6021] | 47 | switch (tt) {
|
---|
| 48 | case l1:
|
---|
| 49 | case l2:
|
---|
| 50 | case lIF:
|
---|
| 51 | case MW:
|
---|
| 52 | case CL:
|
---|
| 53 | return true;
|
---|
| 54 | case c1:
|
---|
| 55 | case c2:
|
---|
| 56 | case cIF:
|
---|
| 57 | return false;
|
---|
| 58 | case dummy: case maxLc: return false;
|
---|
| 59 | }
|
---|
[5678] | 60 | return false;
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | static bool includesCode(type tt) {
|
---|
[6021] | 64 | switch (tt) {
|
---|
| 65 | case c1:
|
---|
| 66 | case c2:
|
---|
| 67 | case cIF:
|
---|
| 68 | case MW:
|
---|
| 69 | case CL:
|
---|
| 70 | return true;
|
---|
| 71 | case l1:
|
---|
| 72 | case l2:
|
---|
| 73 | case lIF:
|
---|
| 74 | return false;
|
---|
| 75 | case dummy: case maxLc: return false;
|
---|
| 76 | }
|
---|
[5678] | 77 | return false;
|
---|
| 78 | }
|
---|
| 79 |
|
---|
[6021] | 80 | static t_frequency::type toFreq(char sys, type tt) {
|
---|
| 81 | switch (tt) {
|
---|
| 82 | case l1: case c1:
|
---|
| 83 | if (sys == 'G') return t_frequency::G1;
|
---|
| 84 | else if (sys == 'R') return t_frequency::R1;
|
---|
| 85 | else if (sys == 'E') return t_frequency::E1;
|
---|
[6973] | 86 | else if (sys == 'C') return t_frequency::C2;
|
---|
[6021] | 87 | else return t_frequency::dummy;
|
---|
| 88 | case l2: case c2:
|
---|
| 89 | if (sys == 'G') return t_frequency::G2;
|
---|
| 90 | else if (sys == 'R') return t_frequency::R2;
|
---|
[6973] | 91 | else if (sys == 'E') return t_frequency::E5;
|
---|
[9389] | 92 | else if (sys == 'C') return t_frequency::C6;
|
---|
[6021] | 93 | else return t_frequency::dummy;
|
---|
| 94 | case lIF: case cIF: case MW: case CL:
|
---|
| 95 | return t_frequency::dummy;
|
---|
| 96 | case dummy: case maxLc: return t_frequency::dummy;
|
---|
| 97 | }
|
---|
| 98 | return t_frequency::dummy;
|
---|
| 99 | }
|
---|
| 100 |
|
---|
[5678] | 101 | static std::string toString(type tt) {
|
---|
[6021] | 102 | switch (tt) {
|
---|
| 103 | case l1: return "l1";
|
---|
| 104 | case l2: return "l2";
|
---|
| 105 | case lIF: return "lIF";
|
---|
| 106 | case MW: return "MW";
|
---|
| 107 | case CL: return "CL";
|
---|
| 108 | case c1: return "c1";
|
---|
| 109 | case c2: return "c2";
|
---|
| 110 | case cIF: return "cIF";
|
---|
| 111 | case dummy: case maxLc: return "";
|
---|
| 112 | }
|
---|
| 113 | return "";
|
---|
[5678] | 114 | }
|
---|
| 115 | };
|
---|
| 116 |
|
---|
[6101] | 117 | class interface_pppClient {
|
---|
| 118 | public:
|
---|
[6103] | 119 | virtual ~interface_pppClient() {};
|
---|
[6101] | 120 | virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
|
---|
| 121 | virtual void putEphemeris(const t_eph* eph) = 0;
|
---|
| 122 | virtual void putOrbCorrections(const std::vector<t_orbCorr*>& corr) = 0;
|
---|
| 123 | virtual void putClkCorrections(const std::vector<t_clkCorr*>& corr) = 0;
|
---|
[6465] | 124 | virtual void putCodeBiases(const std::vector<t_satCodeBias*>& satCodeBias) = 0;
|
---|
[6101] | 125 | };
|
---|
| 126 |
|
---|
[5814] | 127 | } // namespace BNC_PPP
|
---|
[5678] | 128 |
|
---|
| 129 | #endif
|
---|