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