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

Last change on this file since 11001 was 10999, checked in by stuerze, 2 weeks ago

minor changes regarding RTCM-SSR

File size: 6.9 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
106// SSR source format, shared by orbit corrections and phase biases: governs the
107// relativistic-correction formula for orbits (velocity-based per IS-GPS-200D
108// 20.3.3.3.3.1 for RTCM-SSR/RTCM-SSR-new, classic eccentricity-based otherwise)
109// and the applicable parameter set for phase biases (old vs new RTCM-SSR).
110enum e_ssrFormat {ssrUnknown = 0, ssrRtcmOld = 1, ssrRtcmNew = 2};
111
112class t_orbCorr {
113 public:
114 t_orbCorr();
115 static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
116 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList);
117 std::string _staID;
118 t_prn _prn;
119 unsigned int _iod;
120 bncTime _time;
121 unsigned int _updateInt;
122 char _system;
123 ColumnVector _xr;
124 ColumnVector _dotXr;
125 e_ssrFormat _ssrFormat;
126};
127
128class t_clkCorr {
129 public:
130 t_clkCorr();
131 static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
132 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
133 std::string _staID;
134 t_prn _prn;
135 unsigned int _iod;
136 bncTime _time;
137 unsigned int _updateInt;
138 double _dClk;
139 double _dotDClk;
140 double _dotDotDClk;
141};
142
143class t_URA {
144 public:
145 t_URA();
146 static void writeEpoch(std::ostream* out, const QList<t_URA>& corrList);
147 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_URA>& corrList);
148 std::string _staID;
149 t_prn _prn;
150 unsigned int _iod;
151 bncTime _time;
152 unsigned int _updateInt;
153 double _ura;
154};
155
156class t_frqCodeBias {
157 public:
158 t_frqCodeBias() {
159 _value = 0.0;
160 }
161 std::string _rnxType2ch;
162 double _value;
163};
164
165class t_satCodeBias {
166 public:
167 t_satCodeBias() {
168 _updateInt = 0;
169 }
170 static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
171 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
172 std::string _staID;
173 t_prn _prn;
174 bncTime _time;
175 unsigned int _updateInt;
176 std::vector<t_frqCodeBias> _bias;
177};
178
179class t_frqPhaseBias {
180 public:
181 t_frqPhaseBias() {
182 _value = 0.0;
183 _fixIndicator = 0;
184 _fixWideLaneIndicator = 0;
185 _jumpCounter = 0;
186 }
187 std::string _rnxType2ch;
188 double _value;
189 int _fixIndicator;
190 int _fixWideLaneIndicator;
191 int _jumpCounter;
192};
193
194class t_satPhaseBias {
195 public:
196 t_satPhaseBias() {
197 _updateInt = 0;
198 _ssrFormat = ssrUnknown;
199 _dispBiasConsistInd = 0;
200 _MelbWuebConsistInd = 0;
201 _satYawInfoInd = 0;
202 _extPBPhaseInd = 0;
203 _yaw = 0.0;
204 _yawRate = 0.0;
205 }
206 static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
207 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
208 std::string _staID;
209 t_prn _prn;
210 bncTime _time;
211 unsigned int _updateInt; // not satellite specific
212 e_ssrFormat _ssrFormat; // not satellite specific
213 // IGS-SSR
214 unsigned int _dispBiasConsistInd; // not satellite specific
215 unsigned int _MelbWuebConsistInd; // not satellite specific
216 // RTCM-SSR
217 unsigned int _satYawInfoInd; // not satellite specific
218 unsigned int _extPBPhaseInd; // not satellite specific
219 double _yaw;
220 double _yawRate;
221 std::vector<t_frqPhaseBias> _bias;
222};
223
224class t_vTecLayer {
225 public:
226 t_vTecLayer() {
227 _height = 0.0;
228 }
229 double _height;
230 Matrix _C;
231 Matrix _S;
232};
233
234class t_vTec {
235 public:
236 t_vTec(){
237 _updateInt = 0;
238 }
239 static void write(std::ostream* out, const t_vTec& vTec);
240 static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
241 std::string _staID;
242 bncTime _time;
243 unsigned int _updateInt;
244 std::vector<t_vTecLayer> _layers;
245};
246
247class t_corrSSR {
248 public:
249 enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
250 static e_type readEpoLine(const std::string& line, bncTime& epoTime,
251 unsigned int& updateInt, int& numEntries, std::string& staID);
252 static t_eph::e_type getSsrNavTypeFlag(char sys, int num);
253};
254#endif
Note: See TracBrowser for help on using the repository browser.