[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 |
|
---|
| 42 | class t_lc {
|
---|
| 43 | public:
|
---|
[9547] | 44 | enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, GIM, maxLc};
|
---|
[5678] | 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;
|
---|
[8961] | 58 | case dummy:
|
---|
| 59 | case maxLc:
|
---|
[8905] | 60 | case GIM:
|
---|
| 61 | return false;
|
---|
[6021] | 62 | }
|
---|
[5678] | 63 | return false;
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | static bool includesCode(type tt) {
|
---|
[6021] | 67 | switch (tt) {
|
---|
| 68 | case c1:
|
---|
| 69 | case c2:
|
---|
| 70 | case cIF:
|
---|
| 71 | case MW:
|
---|
| 72 | case CL:
|
---|
| 73 | return true;
|
---|
| 74 | case l1:
|
---|
| 75 | case l2:
|
---|
| 76 | case lIF:
|
---|
| 77 | return false;
|
---|
[8961] | 78 | case dummy:
|
---|
| 79 | case maxLc:
|
---|
[8905] | 80 | case GIM:
|
---|
| 81 | return false;
|
---|
[6021] | 82 | }
|
---|
[5678] | 83 | return false;
|
---|
| 84 | }
|
---|
| 85 |
|
---|
[6021] | 86 | static t_frequency::type toFreq(char sys, type tt) {
|
---|
| 87 | switch (tt) {
|
---|
| 88 | case l1: case c1:
|
---|
| 89 | if (sys == 'G') return t_frequency::G1;
|
---|
| 90 | else if (sys == 'R') return t_frequency::R1;
|
---|
| 91 | else if (sys == 'E') return t_frequency::E1;
|
---|
[6973] | 92 | else if (sys == 'C') return t_frequency::C2;
|
---|
[6021] | 93 | else return t_frequency::dummy;
|
---|
| 94 | case l2: case c2:
|
---|
| 95 | if (sys == 'G') return t_frequency::G2;
|
---|
| 96 | else if (sys == 'R') return t_frequency::R2;
|
---|
[6973] | 97 | else if (sys == 'E') return t_frequency::E5;
|
---|
[9386] | 98 | else if (sys == 'C') return t_frequency::C6;
|
---|
[6021] | 99 | else return t_frequency::dummy;
|
---|
[7926] | 100 | case lIF: case cIF: case MW: case CL:
|
---|
[6021] | 101 | return t_frequency::dummy;
|
---|
[8961] | 102 | case dummy:
|
---|
| 103 | case maxLc:
|
---|
[8905] | 104 | case GIM:
|
---|
| 105 | return t_frequency::dummy;
|
---|
[6021] | 106 | }
|
---|
| 107 | return t_frequency::dummy;
|
---|
| 108 | }
|
---|
| 109 |
|
---|
[5678] | 110 | static std::string toString(type tt) {
|
---|
[6021] | 111 | switch (tt) {
|
---|
| 112 | case l1: return "l1";
|
---|
| 113 | case l2: return "l2";
|
---|
| 114 | case lIF: return "lIF";
|
---|
| 115 | case MW: return "MW";
|
---|
| 116 | case CL: return "CL";
|
---|
| 117 | case c1: return "c1";
|
---|
| 118 | case c2: return "c2";
|
---|
| 119 | case cIF: return "cIF";
|
---|
[8905] | 120 | case GIM: return "GIM";
|
---|
[8961] | 121 | case dummy:
|
---|
| 122 | case maxLc:
|
---|
[8905] | 123 | return "";
|
---|
[6021] | 124 | }
|
---|
| 125 | return "";
|
---|
[5678] | 126 | }
|
---|
| 127 | };
|
---|
| 128 |
|
---|
[6101] | 129 | class interface_pppClient {
|
---|
| 130 | public:
|
---|
[6103] | 131 | virtual ~interface_pppClient() {};
|
---|
[6101] | 132 | virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
|
---|
[7926] | 133 | virtual void putEphemeris(const t_eph* eph) = 0;
|
---|
| 134 | virtual void putOrbCorrections(const std::vector<t_orbCorr*>& corr) = 0;
|
---|
| 135 | virtual void putClkCorrections(const std::vector<t_clkCorr*>& corr) = 0;
|
---|
[6465] | 136 | virtual void putCodeBiases(const std::vector<t_satCodeBias*>& satCodeBias) = 0;
|
---|
[7926] | 137 | };
|
---|
[6101] | 138 |
|
---|
[5814] | 139 | } // namespace BNC_PPP
|
---|
[5678] | 140 |
|
---|
| 141 | #endif
|
---|