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

Last change on this file since 10914 was 10791, checked in by mervart, 5 months ago

BNC Multifrequency and PPPAR Client (initial version)

File size: 6.1 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
106class t_orbCorr {
107 public:
[6466]108 t_orbCorr();
[6455]109 static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList);
[6499]110 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList);
[6141]111 std::string _staID;
[6135]112 t_prn _prn;
[7169]113 unsigned int _iod;
[6135]114 bncTime _time;
[6556]115 unsigned int _updateInt;
[6135]116 char _system;
[6157]117 ColumnVector _xr;
[7611]118 ColumnVector _dotXr;
[6135]119};
120
121class t_clkCorr {
122 public:
[6466]123 t_clkCorr();
[6455]124 static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
[6499]125 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
[6141]126 std::string _staID;
[6135]127 t_prn _prn;
[7169]128 unsigned int _iod;
[6135]129 bncTime _time;
[6556]130 unsigned int _updateInt;
[6135]131 double _dClk;
132 double _dotDClk;
133 double _dotDotDClk;
134};
135
[8483]136class t_URA {
137 public:
138 t_URA();
139 static void writeEpoch(std::ostream* out, const QList<t_URA>& corrList);
140 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_URA>& corrList);
141 std::string _staID;
142 t_prn _prn;
143 unsigned int _iod;
144 bncTime _time;
145 unsigned int _updateInt;
146 double _ura;
147};
148
[6463]149class t_frqCodeBias {
[6135]150 public:
[6463]151 t_frqCodeBias() {
[7611]152 _value = 0.0;
[6135]153 }
154 std::string _rnxType2ch;
[6463]155 double _value;
[6135]156};
157
[6463]158class t_satCodeBias {
[6135]159 public:
[10038]160 t_satCodeBias() {
161 _updateInt = 0;
162 }
[6475]163 static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
[6499]164 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
[6463]165 std::string _staID;
166 t_prn _prn;
167 bncTime _time;
[6556]168 unsigned int _updateInt;
[6463]169 std::vector<t_frqCodeBias> _bias;
[6135]170};
171
[6481]172class t_frqPhaseBias {
173 public:
174 t_frqPhaseBias() {
[7611]175 _value = 0.0;
[6481]176 _fixIndicator = 0;
177 _fixWideLaneIndicator = 0;
178 _jumpCounter = 0;
179 }
180 std::string _rnxType2ch;
181 double _value;
182 int _fixIndicator;
183 int _fixWideLaneIndicator;
184 int _jumpCounter;
185};
186
187class t_satPhaseBias {
188 public:
189 t_satPhaseBias() {
[6589]190 _updateInt = 0;
[6857]191 _dispBiasConstistInd = 0;
192 _MWConsistInd = 0;
[8617]193 _yaw = 0.0;
194 _yawRate = 0.0;
[6481]195 }
196 static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
[6499]197 static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
[6481]198 std::string _staID;
199 t_prn _prn;
200 bncTime _time;
[6857]201 unsigned int _updateInt; // not satellite specific
202 unsigned int _dispBiasConstistInd; // not satellite specific
203 unsigned int _MWConsistInd; // not satellite specific
[8617]204 double _yaw;
205 double _yawRate;
[6481]206 std::vector<t_frqPhaseBias> _bias;
207};
208
[6482]209class t_vTecLayer {
210 public:
[7611]211 t_vTecLayer() {
212 _height = 0.0;
213 }
[6482]214 double _height;
215 Matrix _C;
216 Matrix _S;
217};
218
219class t_vTec {
220 public:
[10038]221 t_vTec(){
222 _updateInt = 0;
223 }
[6482]224 static void write(std::ostream* out, const t_vTec& vTec);
[6499]225 static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
[6482]226 std::string _staID;
227 bncTime _time;
[6556]228 unsigned int _updateInt;
[6482]229 std::vector<t_vTecLayer> _layers;
230};
231
[6498]232class t_corrSSR {
233 public:
[8483]234 enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
[6501]235 static e_type readEpoLine(const std::string& line, bncTime& epoTime,
[6556]236 unsigned int& updateInt, int& numEntries, std::string& staID);
[10599]237 static t_eph::e_type getSsrNavTypeFlag(char sys, int num);
[6498]238};
[6135]239#endif
Note: See TracBrowser for help on using the repository browser.