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

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

minor changes regarding RTCM-SSR

File size: 6.9 KB
RevLine 
[6135]1#ifndef SATOBS_H
2#define SATOBS_H
3
4#include <string>
5#include <vector>
6#include <newmat.h>
7
[6455]8#include <QtCore>
9
[6135]10#include "bncconst.h"
11#include "bnctime.h"
12#include "t_prn.h"
[10599]13#include "ephemeris.h"
[6135]14
15class t_frqObs {
16 public:
17 t_frqObs() {
[9088]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;
[6135]32 }
[10791]33 char frqChar() const {return _rnxType2ch.length() > 0 ? _rnxType2ch[0] : '?';}
34 char trkChar() const {return _rnxType2ch.length() > 1 ? _rnxType2ch[1] : '?';}
[7611]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;
[8617]44 double _lockTime;
[9088]45 bool _lockTimeValid;
46 bool _slip; // RINEX
47 int _slipCounter; // RTCM2 or converted from RTCM3
48 int _lockTimeIndicator; // RTCM3
49 int _biasJumpCounter; // ??
[6135]50};
51
52class t_satObs {
53 public:
[10038]54 t_satObs() {
55 _type = 0;
56 }
[10791]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);
[6137]63 }
[10791]64 return *this;
[6137]65 }
[6812]66 /**
67 * Destructor of satellite measurement storage class
68 */
[10038]69 ~t_satObs() {
[6812]70 clear();
71 }
[6581]72
[6812]73 /**
74 * Cleanup function resets all elements to initial state.
75 */
[10038]76 inline void clear(void) {
[10791]77 for (unsigned ii = 0; ii < _obs.size(); ii++) {
[6812]78 delete _obs[ii];
[10791]79 }
[6812]80 _obs.clear();
81 _obs.resize(0);
82 _time.reset();
83 _prn.clear();
84 _staID.clear();
[9544]85 _type = 0;
[6812]86 }
87
[6137]88 std::string _staID;
[6135]89 t_prn _prn;
90 bncTime _time;
[10599]91 int _type; // MT
[6135]92 std::vector<t_frqObs*> _obs;
[10791]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 }
[6135]104};
105
[10998]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
[6135]112class t_orbCorr {
113 public:
[6466]114 t_orbCorr();
[6455]115 static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
[6499]116 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList);
[6141]117 std::string _staID;
[6135]118 t_prn _prn;
[7169]119 unsigned int _iod;
[6135]120 bncTime _time;
[6556]121 unsigned int _updateInt;
[6135]122 char _system;
[6157]123 ColumnVector _xr;
[7611]124 ColumnVector _dotXr;
[10998]125 e_ssrFormat _ssrFormat;
[6135]126};
127
128class t_clkCorr {
129 public:
[6466]130 t_clkCorr();
[6455]131 static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
[6499]132 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
[6141]133 std::string _staID;
[6135]134 t_prn _prn;
[7169]135 unsigned int _iod;
[6135]136 bncTime _time;
[6556]137 unsigned int _updateInt;
[6135]138 double _dClk;
139 double _dotDClk;
140 double _dotDotDClk;
141};
142
[8483]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
[6463]156class t_frqCodeBias {
[6135]157 public:
[6463]158 t_frqCodeBias() {
[7611]159 _value = 0.0;
[6135]160 }
161 std::string _rnxType2ch;
[6463]162 double _value;
[6135]163};
164
[6463]165class t_satCodeBias {
[6135]166 public:
[10038]167 t_satCodeBias() {
168 _updateInt = 0;
169 }
[6475]170 static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
[6499]171 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
[6463]172 std::string _staID;
173 t_prn _prn;
174 bncTime _time;
[6556]175 unsigned int _updateInt;
[6463]176 std::vector<t_frqCodeBias> _bias;
[6135]177};
178
[6481]179class t_frqPhaseBias {
180 public:
181 t_frqPhaseBias() {
[7611]182 _value = 0.0;
[6481]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() {
[6589]197 _updateInt = 0;
[10998]198 _ssrFormat = ssrUnknown;
[10999]199 _dispBiasConsistInd = 0;
200 _MelbWuebConsistInd = 0;
201 _satYawInfoInd = 0;
202 _extPBPhaseInd = 0;
203 _yaw = 0.0;
204 _yawRate = 0.0;
[6481]205 }
206 static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
[6499]207 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
[6481]208 std::string _staID;
209 t_prn _prn;
210 bncTime _time;
[6857]211 unsigned int _updateInt; // not satellite specific
[10998]212 e_ssrFormat _ssrFormat; // not satellite specific
[10999]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
[8617]219 double _yaw;
220 double _yawRate;
[6481]221 std::vector<t_frqPhaseBias> _bias;
222};
223
[6482]224class t_vTecLayer {
225 public:
[7611]226 t_vTecLayer() {
227 _height = 0.0;
228 }
[6482]229 double _height;
230 Matrix _C;
231 Matrix _S;
232};
233
234class t_vTec {
235 public:
[10038]236 t_vTec(){
237 _updateInt = 0;
238 }
[6482]239 static void write(std::ostream* out, const t_vTec& vTec);
[6499]240 static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
[6482]241 std::string _staID;
242 bncTime _time;
[6556]243 unsigned int _updateInt;
[6482]244 std::vector<t_vTecLayer> _layers;
245};
246
[6498]247class t_corrSSR {
248 public:
[8483]249 enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
[6501]250 static e_type readEpoLine(const std::string& line, bncTime& epoTime,
[6556]251 unsigned int& updateInt, int& numEntries, std::string& staID);
[10599]252 static t_eph::e_type getSsrNavTypeFlag(char sys, int num);
[6498]253};
[6135]254#endif
Note: See TracBrowser for help on using the repository browser.