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

Last change on this file since 10938 was 10938, checked in by stuerze, 5 weeks ago

bugfix regarding ionospheric constraints

File size: 4.1 KB
RevLine 
[5678]1#ifndef PPP_H
2#define PPP_H
3
4#include <string>
[5747]5#include <vector>
[5839]6#include <newmat.h>
[10791]7#include <sstream>
[5742]8
9#include "bncconst.h"
[5708]10#include "bnctime.h"
[6101]11#include "ephemeris.h"
[5742]12#include "t_prn.h"
[6135]13#include "satObs.h"
[5678]14
[5814]15namespace BNC_PPP {
[5678]16
[10791]17const double ZEROVALUE = 1e-100;
[10805]18
[5825]19class t_except {
[5763]20 public:
[5825]21 t_except(const char* msg) {
[5763]22 _msg = msg;
23 }
[5825]24 ~t_except() {}
[5763]25 std::string what() {return _msg;}
26 private:
27 std::string _msg;
28};
29
[5743]30class t_output {
[5678]31 public:
[7926]32 bncTime _epoTime;
33 double _xyzRover[3];
34 double _covMatrix[6];
35 double _neu[3];
[6653]36 double _trp0;
37 double _trp;
38 double _trpStdev;
[7926]39 int _numSat;
40 double _hDop;
41 std::string _log;
[10805]42 double _fixRatio;
[7926]43 bool _error;
[5678]44};
45
[10791]46class t_lc {
47public:
48 enum type {dummy = 0, code, phase, codeIF, phaseIF, MW, CL, GIM, maxLc};
[10251]49
[10791]50 t_lc() : _type(dummy), _frq1(t_frequency::dummy), _frq2(t_frequency::dummy) {}
[10805]51
[10791]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;
[10251]59 }
[10791]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 }
[10251]72 }
73
[10791]74 char system() const {
75 return t_frequency::toSystem(_frq1);
76 }
[5678]77
[10791]78 static bool needs2ndFrq(type tt) {
79 if (tt == codeIF || tt == phaseIF || tt == MW) {
[6021]80 return true;
[10791]81 }
82 else {
[6021]83 return false;
[10791]84 }
85 }
[10805]86
[10791]87 bool includesPhase() const {
88 if (_type == phase || _type == phaseIF || _type == MW || _type == CL) {
89 return true;
90 }
91 else {
[8905]92 return false;
[6021]93 }
[5678]94 }
95
[10791]96 bool includesCode() const {
97 if (_type == code || _type == codeIF || _type == MW || _type == CL) {
[6021]98 return true;
[10791]99 }
100 else {
[6021]101 return false;
[10791]102 }
103 }
104
105 bool isIonoFree() const {
106 if (_type == codeIF || _type == phaseIF || _type == MW || _type == CL) {
107 return true;
108 }
109 else {
[8905]110 return false;
[6021]111 }
[5678]112 }
[10805]113
[10791]114 bool isGeometryFree() const {
115 if (_type == MW || _type == CL || _type == GIM) {
116 return true;
117 }
118 else {
119 return false;
120 }
121 }
[10805]122
[10791]123 t_frequency::type toFreq() const {
124 if (_frq2 != t_frequency::dummy) {
[6021]125 return t_frequency::dummy;
126 }
[10791]127 else {
128 return _frq1;
129 }
[6021]130 }
131
[10791]132 std::string toString() const {
133 std::stringstream out;
134 if (_type == code) {
135 out << 'c' << t_frequency::toString(_frq1);
[6021]136 }
[10791]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) {
[10938]153 out << "GIM" ;
[10791]154 }
155 return out.str();
[5678]156 }
[10791]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;
[5678]186};
187
[6101]188class interface_pppClient {
189 public:
[6103]190 virtual ~interface_pppClient() {};
[6101]191 virtual void processEpoch(const std::vector<t_satObs*>& satObs, t_output* output) = 0;
[7926]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;
[6465]195 virtual void putCodeBiases(const std::vector<t_satCodeBias*>& satCodeBias) = 0;
[7926]196};
[6101]197
[5814]198} // namespace BNC_PPP
[5678]199
200#endif
Note: See TracBrowser for help on using the repository browser.