source: ntrip/trunk/BNC/src/PPP/pppInclude.h@ 5844

Last change on this file since 5844 was 5839, checked in by mervart, 10 years ago
File size: 4.2 KB
Line 
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 "t_prn.h"
11
12namespace BNC_PPP {
13
14class t_except {
15 public:
16 t_except(const char* msg) {
17 _msg = msg;
18 }
19 ~t_except() {}
20 std::string what() {return _msg;}
21 private:
22 std::string _msg;
23};
24
25class t_output {
26 public:
27 bncTime _epoTime;
28 double _xyzRover[3];
29 double _covMatrix[6];
30 int _numSat;
31 double _pDop;
32 std::string _log;
33 bool _error;
34};
35
36class t_frqObs {
37 public:
38 t_frqObs() {
39 _code = 0.0;
40 _codeValid = false;
41 _phase = 0.0;
42 _phaseValid = false;
43 _doppler = 0.0;
44 _dopplerValid = false;
45 _snr = 0.0;
46 _snrValid = false;
47 _slip = false;
48 _slipCounter = 0;
49 _biasJumpCounter = 0;
50 }
51 std::string _rnxType2ch;
52 double _code;
53 bool _codeValid;
54 double _phase;
55 bool _phaseValid;
56 double _doppler;
57 bool _dopplerValid;
58 double _snr;
59 bool _snrValid;
60 bool _slip;
61 int _slipCounter;
62 int _biasJumpCounter;
63};
64
65class t_satObs {
66 public:
67 t_satObs() {}
68 ~t_satObs() {for (unsigned ii = 0; ii < _obs.size(); ii++) delete _obs[ii];}
69 t_prn _prn;
70 bncTime _time;
71 std::vector<t_frqObs*> _obs;
72};
73
74class t_orbCorr {
75 public:
76 ColumnVector getX(const bncTime& tt) const {
77 ColumnVector xx(3);
78 double dt = tt - _time;
79 xx[0] = _xr[0] + _dotXr[0] * dt;
80 xx[1] = _xr[1] + _dotXr[1] * dt;
81 xx[2] = _xr[2] + _dotXr[2] * dt;
82 return xx;
83 }
84 t_prn prn() const {return _prn;}
85 unsigned short IOD() const {return _iod;}
86 t_prn _prn;
87 unsigned short _iod;
88 bncTime _time;
89 char _system;
90 double _xr[3];
91 double _dotXr[3];
92};
93
94class t_clkCorr {
95 public:
96 double getClk(const bncTime& tt) const {
97 double dt = tt - _time;
98 return _dClk + dt * _dotDClk + dt * dt * _dotDotDClk;
99 }
100 t_prn prn() const {return _prn;}
101 unsigned short IOD() const {return _iod;}
102 t_prn _prn;
103 unsigned short _iod;
104 bncTime _time;
105 double _dClk;
106 double _dotDClk;
107 double _dotDotDClk;
108 double _clkPartial;
109};
110
111class t_frqBias {
112 public:
113 t_frqBias() {
114 _code = 0.0;
115 _codeValid = false;
116 _phase = 0.0;
117 _phaseValid = false;
118 }
119 std::string _rnxType2ch;
120 double _code;
121 bool _codeValid;
122 double _phase;
123 bool _phaseValid;
124};
125
126class t_satBias {
127 public:
128 t_prn _prn;
129 bncTime _time;
130 int _nx;
131 int _jumpCount;
132 std::vector<t_frqBias> _bias;
133};
134
135class t_frequency {
136 public:
137 enum type {dummy = 0, G1, G2, R1, R2, maxFr};
138
139 static std::string toString(type tt) {
140 if (tt == G1) return "G1";
141 else if (tt == G2) return "G2";
142 else if (tt == R1) return "R1";
143 else if (tt == R2) return "R2";
144 return std::string();
145 }
146};
147
148class t_lc {
149 public:
150 enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, maxLc};
151
152 static bool need2ndFreq(type tt) {
153 if (tt == l2 || tt == c2 || tt == lIF || tt == cIF || tt == MW) return true;
154 return false;
155 }
156
157 static bool includesPhase(type tt) {
158 if (tt == l1 || tt == l2 || tt == lIF || tt == MW || tt == CL) return true;
159 return false;
160 }
161
162 static bool includesCode(type tt) {
163 if (tt == c1 || tt == c2 || tt == cIF || tt == MW || tt == CL) return true;
164 return false;
165 }
166
167 static std::string toString(type tt) {
168 if (tt == l1) return "l1";
169 else if (tt == l2) return "l2";
170 else if (tt == c1) return "c1";
171 else if (tt == c2) return "c2";
172 else if (tt == lIF) return "lIF";
173 else if (tt == cIF) return "cIF";
174 else if (tt == MW) return "MW";
175 else if (tt == CL) return "CL";
176 return std::string();
177 }
178};
179
180} // namespace BNC_PPP
181
182#endif
Note: See TracBrowser for help on using the repository browser.