| 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 |  | 
|---|
| 14 | class t_frqObs  { | 
|---|
| 15 | public: | 
|---|
| 16 | t_frqObs() { | 
|---|
| 17 | _code            = 0.0; | 
|---|
| 18 | _codeValid       = false; | 
|---|
| 19 | _phase           = 0.0; | 
|---|
| 20 | _phaseValid      = false; | 
|---|
| 21 | _doppler         = 0.0; | 
|---|
| 22 | _dopplerValid    = false; | 
|---|
| 23 | _snr             = 0.0; | 
|---|
| 24 | _snrValid        = false; | 
|---|
| 25 | _slip            = false; | 
|---|
| 26 | _slipCounter     = 0; | 
|---|
| 27 | _biasJumpCounter = 0; | 
|---|
| 28 | } | 
|---|
| 29 | std::string       _rnxType2ch; | 
|---|
| 30 | double            _code; | 
|---|
| 31 | bool              _codeValid; | 
|---|
| 32 | double            _phase; | 
|---|
| 33 | bool              _phaseValid; | 
|---|
| 34 | double            _doppler; | 
|---|
| 35 | bool              _dopplerValid; | 
|---|
| 36 | double            _snr; | 
|---|
| 37 | bool              _snrValid; | 
|---|
| 38 | bool              _slip; | 
|---|
| 39 | int               _slipCounter; | 
|---|
| 40 | int               _biasJumpCounter; | 
|---|
| 41 | }; | 
|---|
| 42 |  | 
|---|
| 43 | class t_satObs { | 
|---|
| 44 | public: | 
|---|
| 45 | t_satObs() {} | 
|---|
| 46 | t_satObs(const t_satObs& old) { // copy constructor (deep copy) | 
|---|
| 47 | _staID = old._staID; | 
|---|
| 48 | _prn   = old._prn; | 
|---|
| 49 | _time  = old._time; | 
|---|
| 50 | for (unsigned ii = 0; ii < old._obs.size(); ii++) { | 
|---|
| 51 | _obs.push_back(new t_frqObs(*old._obs[ii])); | 
|---|
| 52 | } | 
|---|
| 53 | } | 
|---|
| 54 | /** | 
|---|
| 55 | * Destructor of satellite measurement storage class | 
|---|
| 56 | */ | 
|---|
| 57 | ~t_satObs() | 
|---|
| 58 | { | 
|---|
| 59 | clear(); | 
|---|
| 60 | } | 
|---|
| 61 |  | 
|---|
| 62 | /** | 
|---|
| 63 | * Cleanup function resets all elements to initial state. | 
|---|
| 64 | */ | 
|---|
| 65 | inline void clear(void) | 
|---|
| 66 | { | 
|---|
| 67 | for (unsigned ii = 0; ii < _obs.size(); ii++) | 
|---|
| 68 | delete _obs[ii]; | 
|---|
| 69 | _obs.clear(); | 
|---|
| 70 | _obs.resize(0); | 
|---|
| 71 | _time.reset(); | 
|---|
| 72 | _prn.clear(); | 
|---|
| 73 | _staID.clear(); | 
|---|
| 74 | } | 
|---|
| 75 |  | 
|---|
| 76 | std::string            _staID; | 
|---|
| 77 | t_prn                  _prn; | 
|---|
| 78 | bncTime                _time; | 
|---|
| 79 | std::vector<t_frqObs*> _obs; | 
|---|
| 80 | }; | 
|---|
| 81 |  | 
|---|
| 82 | class t_orbCorr { | 
|---|
| 83 | public: | 
|---|
| 84 | t_orbCorr(); | 
|---|
| 85 | static void writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList); | 
|---|
| 86 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_orbCorr>& corrList); | 
|---|
| 87 | std::string    _staID; | 
|---|
| 88 | t_prn          _prn; | 
|---|
| 89 | unsigned int   _iod; | 
|---|
| 90 | bncTime        _time; | 
|---|
| 91 | unsigned int   _updateInt; | 
|---|
| 92 | char           _system; | 
|---|
| 93 | ColumnVector   _xr; | 
|---|
| 94 | ColumnVector   _dotXr; | 
|---|
| 95 | }; | 
|---|
| 96 |  | 
|---|
| 97 | class t_clkCorr { | 
|---|
| 98 | public: | 
|---|
| 99 | t_clkCorr(); | 
|---|
| 100 | static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList); | 
|---|
| 101 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList); | 
|---|
| 102 | std::string    _staID; | 
|---|
| 103 | t_prn          _prn; | 
|---|
| 104 | unsigned int   _iod; | 
|---|
| 105 | bncTime        _time; | 
|---|
| 106 | unsigned int   _updateInt; | 
|---|
| 107 | double         _dClk; | 
|---|
| 108 | double         _dotDClk; | 
|---|
| 109 | double         _dotDotDClk; | 
|---|
| 110 | }; | 
|---|
| 111 |  | 
|---|
| 112 | class t_frqCodeBias { | 
|---|
| 113 | public: | 
|---|
| 114 | t_frqCodeBias() { | 
|---|
| 115 | _value = 0.0; | 
|---|
| 116 | } | 
|---|
| 117 | std::string _rnxType2ch; | 
|---|
| 118 | double      _value; | 
|---|
| 119 | }; | 
|---|
| 120 |  | 
|---|
| 121 | class t_satCodeBias { | 
|---|
| 122 | public: | 
|---|
| 123 | static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList); | 
|---|
| 124 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList); | 
|---|
| 125 | std::string                _staID; | 
|---|
| 126 | t_prn                      _prn; | 
|---|
| 127 | bncTime                    _time; | 
|---|
| 128 | unsigned int               _updateInt; | 
|---|
| 129 | std::vector<t_frqCodeBias> _bias; | 
|---|
| 130 | }; | 
|---|
| 131 |  | 
|---|
| 132 | class t_frqPhaseBias { | 
|---|
| 133 | public: | 
|---|
| 134 | t_frqPhaseBias() { | 
|---|
| 135 | _value                = 0.0; | 
|---|
| 136 | _fixIndicator         = 0; | 
|---|
| 137 | _fixWideLaneIndicator = 0; | 
|---|
| 138 | _jumpCounter          = 0; | 
|---|
| 139 | } | 
|---|
| 140 | std::string _rnxType2ch; | 
|---|
| 141 | double      _value; | 
|---|
| 142 | int         _fixIndicator; | 
|---|
| 143 | int         _fixWideLaneIndicator; | 
|---|
| 144 | int         _jumpCounter; | 
|---|
| 145 | }; | 
|---|
| 146 |  | 
|---|
| 147 | class t_satPhaseBias { | 
|---|
| 148 | public: | 
|---|
| 149 | t_satPhaseBias() { | 
|---|
| 150 | _updateInt  = 0; | 
|---|
| 151 | _dispBiasConstistInd = 0; | 
|---|
| 152 | _MWConsistInd = 0; | 
|---|
| 153 | _yawDeg     = 0.0; | 
|---|
| 154 | _yawDegRate = 0.0; | 
|---|
| 155 | } | 
|---|
| 156 | static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList); | 
|---|
| 157 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList); | 
|---|
| 158 | std::string                 _staID; | 
|---|
| 159 | t_prn                       _prn; | 
|---|
| 160 | bncTime                     _time; | 
|---|
| 161 | unsigned int                _updateInt;           // not satellite specific | 
|---|
| 162 | unsigned int                _dispBiasConstistInd; // not satellite specific | 
|---|
| 163 | unsigned int                _MWConsistInd;        // not satellite specific | 
|---|
| 164 | double                      _yawDeg; | 
|---|
| 165 | double                      _yawDegRate; | 
|---|
| 166 | std::vector<t_frqPhaseBias> _bias; | 
|---|
| 167 | }; | 
|---|
| 168 |  | 
|---|
| 169 | class t_vTecLayer { | 
|---|
| 170 | public: | 
|---|
| 171 | t_vTecLayer() { | 
|---|
| 172 | _height = 0.0; | 
|---|
| 173 | } | 
|---|
| 174 | double _height; | 
|---|
| 175 | Matrix _C; | 
|---|
| 176 | Matrix _S; | 
|---|
| 177 | }; | 
|---|
| 178 |  | 
|---|
| 179 | class t_vTec { | 
|---|
| 180 | public: | 
|---|
| 181 | static void write(std::ostream* out, const t_vTec& vTec); | 
|---|
| 182 | static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec); | 
|---|
| 183 | std::string              _staID; | 
|---|
| 184 | bncTime                  _time; | 
|---|
| 185 | unsigned int            _updateInt; | 
|---|
| 186 | std::vector<t_vTecLayer> _layers; | 
|---|
| 187 | }; | 
|---|
| 188 |  | 
|---|
| 189 | class t_corrSSR { | 
|---|
| 190 | public: | 
|---|
| 191 | enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, unknown}; | 
|---|
| 192 | static e_type readEpoLine(const std::string& line, bncTime& epoTime, | 
|---|
| 193 | unsigned int& updateInt, int& numEntries, std::string& staID); | 
|---|
| 194 | }; | 
|---|
| 195 |  | 
|---|
| 196 | #endif | 
|---|