1 | #ifndef PPP_H
|
---|
2 | #define PPP_H
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <vector>
|
---|
6 | #include <newmat.h>
|
---|
7 |
|
---|
8 | #include "bncconst.h"
|
---|
9 | #include "bnctime.h"
|
---|
10 | #include "ephemeris.h"
|
---|
11 | #include "t_prn.h"
|
---|
12 |
|
---|
13 | namespace BNC_PPP {
|
---|
14 |
|
---|
15 | class t_except {
|
---|
16 | public:
|
---|
17 | t_except(const char* msg) {
|
---|
18 | _msg = msg;
|
---|
19 | }
|
---|
20 | ~t_except() {}
|
---|
21 | std::string what() {return _msg;}
|
---|
22 | private:
|
---|
23 | std::string _msg;
|
---|
24 | };
|
---|
25 |
|
---|
26 | class t_output {
|
---|
27 | public:
|
---|
28 | bncTime _epoTime;
|
---|
29 | double _xyzRover[3];
|
---|
30 | double _covMatrix[6];
|
---|
31 | double _neu[3];
|
---|
32 | int _numSat;
|
---|
33 | double _pDop;
|
---|
34 | std::string _log;
|
---|
35 | bool _error;
|
---|
36 | };
|
---|
37 |
|
---|
38 | class t_frqObs {
|
---|
39 | public:
|
---|
40 | t_frqObs() {
|
---|
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 | }
|
---|
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;
|
---|
65 | };
|
---|
66 |
|
---|
67 | class t_satObs {
|
---|
68 | public:
|
---|
69 | t_satObs() {}
|
---|
70 | ~t_satObs() {for (unsigned ii = 0; ii < _obs.size(); ii++) delete _obs[ii];}
|
---|
71 | t_prn _prn;
|
---|
72 | bncTime _time;
|
---|
73 | std::vector<t_frqObs*> _obs;
|
---|
74 | };
|
---|
75 |
|
---|
76 | class t_orbCorr {
|
---|
77 | public:
|
---|
78 | t_prn prn() const {return _prn;}
|
---|
79 | unsigned short IOD() const {return _iod;}
|
---|
80 | t_prn _prn;
|
---|
81 | unsigned short _iod;
|
---|
82 | bncTime _time;
|
---|
83 | char _system;
|
---|
84 | double _xr[3];
|
---|
85 | double _dotXr[3];
|
---|
86 | };
|
---|
87 |
|
---|
88 | class t_clkCorr {
|
---|
89 | public:
|
---|
90 | t_prn prn() const {return _prn;}
|
---|
91 | unsigned short IOD() const {return _iod;}
|
---|
92 | t_prn _prn;
|
---|
93 | unsigned short _iod;
|
---|
94 | bncTime _time;
|
---|
95 | double _dClk;
|
---|
96 | double _dotDClk;
|
---|
97 | double _dotDotDClk;
|
---|
98 | double _clkPartial;
|
---|
99 | };
|
---|
100 |
|
---|
101 | class t_frqBias {
|
---|
102 | public:
|
---|
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;
|
---|
114 | };
|
---|
115 |
|
---|
116 | class t_satBias {
|
---|
117 | public:
|
---|
118 | t_prn _prn;
|
---|
119 | bncTime _time;
|
---|
120 | int _nx;
|
---|
121 | int _jumpCount;
|
---|
122 | std::vector<t_frqBias> _bias;
|
---|
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) {
|
---|
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 | }
|
---|
143 | return false;
|
---|
144 | }
|
---|
145 |
|
---|
146 | static bool includesCode(type tt) {
|
---|
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 | }
|
---|
160 | return false;
|
---|
161 | }
|
---|
162 |
|
---|
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 |
|
---|
181 | static std::string toString(type tt) {
|
---|
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 "";
|
---|
194 | }
|
---|
195 | };
|
---|
196 |
|
---|
197 | class interface_pppClient {
|
---|
198 | public:
|
---|
199 | virtual ~interface_pppClient() {};
|
---|
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 |
|
---|
207 | } // namespace BNC_PPP
|
---|
208 |
|
---|
209 | #endif
|
---|