source: ntrip/trunk/BNC/src/satObs.h@ 10996

Last change on this file since 10996 was 10993, checked in by stuerze, 4 weeks ago

minor changes to allow different formulas for the computation of the relativistic effects in GPS position determination for RTCM-SSR and IGS-SSR

File size: 6.4 KB
Line 
1#ifndef SATOBS_H
2#define SATOBS_H
3
4#include <string>
5#include <vector>
6#include <newmat.h>
7
8#include <QtCore>
9
10#include "bncconst.h"
11#include "bnctime.h"
12#include "t_prn.h"
13#include "ephemeris.h"
14
15class t_frqObs {
16 public:
17 t_frqObs() {
18 _code = 0.0;
19 _codeValid = false;
20 _phase = 0.0;
21 _phaseValid = false;
22 _doppler = 0.0;
23 _dopplerValid = false;
24 _snr = 0.0;
25 _snrValid = false;
26 _lockTime = -1.0;
27 _lockTimeValid = false;
28 _slip = false;
29 _slipCounter = 0;
30 _biasJumpCounter = 0;
31 _lockTimeIndicator = -1;
32 }
33 char frqChar() const {return _rnxType2ch.length() > 0 ? _rnxType2ch[0] : '?';}
34 char trkChar() const {return _rnxType2ch.length() > 1 ? _rnxType2ch[1] : '?';}
35 std::string _rnxType2ch;
36 double _code;
37 bool _codeValid;
38 double _phase;
39 bool _phaseValid;
40 double _doppler;
41 bool _dopplerValid;
42 double _snr;
43 bool _snrValid;
44 double _lockTime;
45 bool _lockTimeValid;
46 bool _slip; // RINEX
47 int _slipCounter; // RTCM2 or converted from RTCM3
48 int _lockTimeIndicator; // RTCM3
49 int _biasJumpCounter; // ??
50};
51
52class t_satObs {
53 public:
54 t_satObs() {
55 _type = 0;
56 }
57 t_satObs(const t_satObs& other) { // copy constructor (deep copy)
58 copyFields(other);
59 }
60 t_satObs operator=(const t_satObs& other) {
61 if (this != &other) {
62 copyFields(other);
63 }
64 return *this;
65 }
66 /**
67 * Destructor of satellite measurement storage class
68 */
69 ~t_satObs() {
70 clear();
71 }
72
73 /**
74 * Cleanup function resets all elements to initial state.
75 */
76 inline void clear(void) {
77 for (unsigned ii = 0; ii < _obs.size(); ii++) {
78 delete _obs[ii];
79 }
80 _obs.clear();
81 _obs.resize(0);
82 _time.reset();
83 _prn.clear();
84 _staID.clear();
85 _type = 0;
86 }
87
88 std::string _staID;
89 t_prn _prn;
90 bncTime _time;
91 int _type; // MT
92 std::vector<t_frqObs*> _obs;
93
94 private:
95 void copyFields(const t_satObs& other) {
96 _staID = other._staID;
97 _prn = other._prn;
98 _time = other._time;
99 _type = other._type;
100 for (unsigned ii = 0; ii < other._obs.size(); ii++) {
101 _obs.push_back(new t_frqObs(*other._obs[ii]));
102 }
103 }
104};
105
106class t_orbCorr {
107 public:
108 t_orbCorr();
109 static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
110 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList);
111 std::string _staID;
112 t_prn _prn;
113 unsigned int _iod;
114 bncTime _time;
115 unsigned int _updateInt;
116 char _system;
117 ColumnVector _xr;
118 ColumnVector _dotXr;
119 bool _rtcmSsr; // true: RTCM-SSR/RTCM-SSR-new source (velocity-based relativistic
120 // correction per IS-GPS-200D 20.3.3.3.3.1); false: IGS-SSR or
121 // unknown source (classic eccentricity-based correction)
122};
123
124class t_clkCorr {
125 public:
126 t_clkCorr();
127 static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
128 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
129 std::string _staID;
130 t_prn _prn;
131 unsigned int _iod;
132 bncTime _time;
133 unsigned int _updateInt;
134 double _dClk;
135 double _dotDClk;
136 double _dotDotDClk;
137};
138
139class t_URA {
140 public:
141 t_URA();
142 static void writeEpoch(std::ostream* out, const QList<t_URA>& corrList);
143 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_URA>& corrList);
144 std::string _staID;
145 t_prn _prn;
146 unsigned int _iod;
147 bncTime _time;
148 unsigned int _updateInt;
149 double _ura;
150};
151
152class t_frqCodeBias {
153 public:
154 t_frqCodeBias() {
155 _value = 0.0;
156 }
157 std::string _rnxType2ch;
158 double _value;
159};
160
161class t_satCodeBias {
162 public:
163 t_satCodeBias() {
164 _updateInt = 0;
165 }
166 static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
167 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
168 std::string _staID;
169 t_prn _prn;
170 bncTime _time;
171 unsigned int _updateInt;
172 std::vector<t_frqCodeBias> _bias;
173};
174
175class t_frqPhaseBias {
176 public:
177 t_frqPhaseBias() {
178 _value = 0.0;
179 _fixIndicator = 0;
180 _fixWideLaneIndicator = 0;
181 _jumpCounter = 0;
182 }
183 std::string _rnxType2ch;
184 double _value;
185 int _fixIndicator;
186 int _fixWideLaneIndicator;
187 int _jumpCounter;
188};
189
190class t_satPhaseBias {
191 public:
192 t_satPhaseBias() {
193 _updateInt = 0;
194 _dispBiasConstistInd = 0;
195 _MWConsistInd = 0;
196 _yaw = 0.0;
197 _yawRate = 0.0;
198 }
199 static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
200 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
201 std::string _staID;
202 t_prn _prn;
203 bncTime _time;
204 unsigned int _updateInt; // not satellite specific
205 unsigned int _dispBiasConstistInd; // not satellite specific
206 unsigned int _MWConsistInd; // not satellite specific
207 double _yaw;
208 double _yawRate;
209 std::vector<t_frqPhaseBias> _bias;
210};
211
212class t_vTecLayer {
213 public:
214 t_vTecLayer() {
215 _height = 0.0;
216 }
217 double _height;
218 Matrix _C;
219 Matrix _S;
220};
221
222class t_vTec {
223 public:
224 t_vTec(){
225 _updateInt = 0;
226 }
227 static void write(std::ostream* out, const t_vTec& vTec);
228 static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
229 std::string _staID;
230 bncTime _time;
231 unsigned int _updateInt;
232 std::vector<t_vTecLayer> _layers;
233};
234
235class t_corrSSR {
236 public:
237 enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
238 static e_type readEpoLine(const std::string& line, bncTime& epoTime,
239 unsigned int& updateInt, int& numEntries, std::string& staID);
240 static t_eph::e_type getSsrNavTypeFlag(char sys, int num);
241};
242#endif
Note: See TracBrowser for help on using the repository browser.