source: ntrip/trunk/BNC/src/pppInclude.h@ 10904

Last change on this file since 10904 was 10805, checked in by stuerze, 3 months ago

minor changes regarding ppp output

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#include <sstream>
8
9#include "bncconst.h"
10#include "bnctime.h"
11#include "ephemeris.h"
12#include "t_prn.h"
13#include "satObs.h"
14
15namespace BNC_PPP {
16
17const double ZEROVALUE = 1e-100;
18
19class t_except {
20 public:
21 t_except(const char* msg) {
22 _msg = msg;
23 }
24 ~t_except() {}
25 std::string what() {return _msg;}
26 private:
27 std::string _msg;
28};
29
30class t_output {
31 public:
32 bncTime _epoTime;
33 double _xyzRover[3];
34 double _covMatrix[6];
35 double _neu[3];
36 double _trp0;
37 double _trp;
38 double _trpStdev;
39 int _numSat;
40 double _hDop;
41 std::string _log;
42 double _fixRatio;
43 bool _error;
44};
45
46class t_lc {
47public:
48 enum type {dummy = 0, code, phase, codeIF, phaseIF, MW, CL, GIM, maxLc};
49
50 t_lc() : _type(dummy), _frq1(t_frequency::dummy), _frq2(t_frequency::dummy) {}
51
52 t_lc(type tt, t_frequency::type frq1, t_frequency::type frq2 = t_frequency::dummy)
53 : _type(tt), _frq1(frq1), _frq2(frq2) {
54 }
55
56 bool valid() const {
57 if (_type == dummy) {
58 return false;
59 }
60 else if (_type == GIM) {
61 return true;
62 }
63 else {
64 if (_frq1 == t_frequency::dummy) {
65 return false;
66 }
67 if (t_lc::needs2ndFrq(_type) && _frq2 == t_frequency::dummy) {
68 return false;
69 }
70 return true;
71 }
72 }
73
74 char system() const {
75 return t_frequency::toSystem(_frq1);
76 }
77
78 static bool needs2ndFrq(type tt) {
79 if (tt == codeIF || tt == phaseIF || tt == MW) {
80 return true;
81 }
82 else {
83 return false;
84 }
85 }
86
87 bool includesPhase() const {
88 if (_type == phase || _type == phaseIF || _type == MW || _type == CL) {
89 return true;
90 }
91 else {
92 return false;
93 }
94 }
95
96 bool includesCode() const {
97 if (_type == code || _type == codeIF || _type == MW || _type == CL) {
98 return true;
99 }
100 else {
101 return false;
102 }
103 }
104
105 bool isIonoFree() const {
106 if (_type == codeIF || _type == phaseIF || _type == MW || _type == CL) {
107 return true;
108 }
109 else {
110 return false;
111 }
112 }
113
114 bool isGeometryFree() const {
115 if (_type == MW || _type == CL || _type == GIM) {
116 return true;
117 }
118 else {
119 return false;
120 }
121 }
122
123 t_frequency::type toFreq() const {
124 if (_frq2 != t_frequency::dummy) {
125 return t_frequency::dummy;
126 }
127 else {
128 return _frq1;
129 }
130 }
131
132 std::string toString() const {
133 std::stringstream out;
134 if (_type == code) {
135 out << 'c' << t_frequency::toString(_frq1);
136 }
137 else if (_type == phase) {
138 out << 'l' << t_frequency::toString(_frq1);
139 }
140 else if (_type == codeIF) {
141 out << 'c' << t_frequency::toSystem(_frq1) << "IF" ;
142 }
143 else if (_type == phaseIF) {
144 out << 'l' << t_frequency::toSystem(_frq1) << "IF" ;
145 }
146 else if (_type == MW) {
147 out << t_frequency::toSystem(_frq1) << "MW" ;
148 }
149 else if (_type == CL) {
150 out << t_frequency::toSystem(_frq1) << "CL" ;
151 }
152 else if (_type == GIM) {
153 out << t_frequency::toSystem(_frq1) << "GIM" ;
154 }
155 return out.str();
156 }
157
158 bool operator==(const t_lc& other) const {
159 if (_type == other._type && _frq1 == other._frq1 && _frq2 == other._frq2) {
160 return true;
161 }
162 else {
163 return false;
164 }
165 }
166
167 bool operator!=(const t_lc& other) const {
168 return !(*this == other);
169 }
170
171 bool operator <(const t_lc& other) const {
172 if (_type != other._type) {
173 return _type < other._type;
174 }
175 else if (_frq1 != other._frq1) {
176 return _frq1 < other._frq1;
177 }
178 else {
179 return _frq2 < other._frq2;
180 }
181 }
182
183 type _type;
184 t_frequency::type _frq1;
185 t_frequency::type _frq2;
186};
187
188class interface_pppClient {
189 public:
190 virtual ~interface_pppClient() {};
191 virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
192 virtual void putEphemeris(const t_eph* eph) = 0;
193 virtual void putOrbCorrections(const std::vector<t_orbCorr*>& corr) = 0;
194 virtual void putClkCorrections(const std::vector<t_clkCorr*>& corr) = 0;
195 virtual void putCodeBiases(const std::vector<t_satCodeBias*>& satCodeBias) = 0;
196};
197
198} // namespace BNC_PPP
199
200#endif
Note: See TracBrowser for help on using the repository browser.