| 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 |
|
|---|
| 15 | class 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 |
|
|---|
| 52 | class 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 | class 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 | };
|
|---|
| 120 |
|
|---|
| 121 | class t_clkCorr {
|
|---|
| 122 | public:
|
|---|
| 123 | t_clkCorr();
|
|---|
| 124 | static void writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList);
|
|---|
| 125 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_clkCorr>& corrList);
|
|---|
| 126 | std::string _staID;
|
|---|
| 127 | t_prn _prn;
|
|---|
| 128 | unsigned int _iod;
|
|---|
| 129 | bncTime _time;
|
|---|
| 130 | unsigned int _updateInt;
|
|---|
| 131 | double _dClk;
|
|---|
| 132 | double _dotDClk;
|
|---|
| 133 | double _dotDotDClk;
|
|---|
| 134 | };
|
|---|
| 135 |
|
|---|
| 136 | class 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 |
|
|---|
| 149 | class t_frqCodeBias {
|
|---|
| 150 | public:
|
|---|
| 151 | t_frqCodeBias() {
|
|---|
| 152 | _value = 0.0;
|
|---|
| 153 | }
|
|---|
| 154 | std::string _rnxType2ch;
|
|---|
| 155 | double _value;
|
|---|
| 156 | };
|
|---|
| 157 |
|
|---|
| 158 | class t_satCodeBias {
|
|---|
| 159 | public:
|
|---|
| 160 | t_satCodeBias() {
|
|---|
| 161 | _updateInt = 0;
|
|---|
| 162 | }
|
|---|
| 163 | static void writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList);
|
|---|
| 164 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satCodeBias>& biasList);
|
|---|
| 165 | std::string _staID;
|
|---|
| 166 | t_prn _prn;
|
|---|
| 167 | bncTime _time;
|
|---|
| 168 | unsigned int _updateInt;
|
|---|
| 169 | std::vector<t_frqCodeBias> _bias;
|
|---|
| 170 | };
|
|---|
| 171 |
|
|---|
| 172 | class t_frqPhaseBias {
|
|---|
| 173 | public:
|
|---|
| 174 | t_frqPhaseBias() {
|
|---|
| 175 | _value = 0.0;
|
|---|
| 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 |
|
|---|
| 187 | class t_satPhaseBias {
|
|---|
| 188 | public:
|
|---|
| 189 | t_satPhaseBias() {
|
|---|
| 190 | _updateInt = 0;
|
|---|
| 191 | _dispBiasConstistInd = 0;
|
|---|
| 192 | _MWConsistInd = 0;
|
|---|
| 193 | _yaw = 0.0;
|
|---|
| 194 | _yawRate = 0.0;
|
|---|
| 195 | }
|
|---|
| 196 | static void writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList);
|
|---|
| 197 | static void readEpoch(const std::string& epoLine, std::istream& in, QList<t_satPhaseBias>& biasList);
|
|---|
| 198 | std::string _staID;
|
|---|
| 199 | t_prn _prn;
|
|---|
| 200 | bncTime _time;
|
|---|
| 201 | unsigned int _updateInt; // not satellite specific
|
|---|
| 202 | unsigned int _dispBiasConstistInd; // not satellite specific
|
|---|
| 203 | unsigned int _MWConsistInd; // not satellite specific
|
|---|
| 204 | double _yaw;
|
|---|
| 205 | double _yawRate;
|
|---|
| 206 | std::vector<t_frqPhaseBias> _bias;
|
|---|
| 207 | };
|
|---|
| 208 |
|
|---|
| 209 | class t_vTecLayer {
|
|---|
| 210 | public:
|
|---|
| 211 | t_vTecLayer() {
|
|---|
| 212 | _height = 0.0;
|
|---|
| 213 | }
|
|---|
| 214 | double _height;
|
|---|
| 215 | Matrix _C;
|
|---|
| 216 | Matrix _S;
|
|---|
| 217 | };
|
|---|
| 218 |
|
|---|
| 219 | class t_vTec {
|
|---|
| 220 | public:
|
|---|
| 221 | t_vTec(){
|
|---|
| 222 | _updateInt = 0;
|
|---|
| 223 | }
|
|---|
| 224 | static void write(std::ostream* out, const t_vTec& vTec);
|
|---|
| 225 | static void read(const std::string& epoLine, std::istream& in, t_vTec& vTec);
|
|---|
| 226 | std::string _staID;
|
|---|
| 227 | bncTime _time;
|
|---|
| 228 | unsigned int _updateInt;
|
|---|
| 229 | std::vector<t_vTecLayer> _layers;
|
|---|
| 230 | };
|
|---|
| 231 |
|
|---|
| 232 | class t_corrSSR {
|
|---|
| 233 | public:
|
|---|
| 234 | enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, URA, unknown};
|
|---|
| 235 | static e_type readEpoLine(const std::string& line, bncTime& epoTime,
|
|---|
| 236 | unsigned int& updateInt, int& numEntries, std::string& staID);
|
|---|
| 237 | static t_eph::e_type getSsrNavTypeFlag(char sys, int num);
|
|---|
| 238 | };
|
|---|
| 239 | #endif
|
|---|