| [6176] | 1 | #include <iostream>
|
|---|
| [6177] | 2 | #include <iomanip>
|
|---|
| [6176] | 3 | #include <sstream>
|
|---|
| [6495] | 4 | #include <newmatio.h>
|
|---|
| [6144] | 5 |
|
|---|
| 6 | #include "satObs.h"
|
|---|
| [6178] | 7 |
|
|---|
| [6144] | 8 | using namespace std;
|
|---|
| 9 |
|
|---|
| [6466] | 10 | // Constructor
|
|---|
| [6144] | 11 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 12 | t_clkCorr::t_clkCorr() {
|
|---|
| [11000] | 13 | _updateInt = 0;
|
|---|
| 14 | _iod = 0;
|
|---|
| 15 | _dClk = 0.0;
|
|---|
| 16 | _dotDClk = 0.0;
|
|---|
| [6160] | 17 | _dotDotDClk = 0.0;
|
|---|
| [6144] | 18 | }
|
|---|
| 19 |
|
|---|
| [8483] | 20 | //
|
|---|
| [6144] | 21 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 22 | void t_clkCorr::writeEpoch(ostream* out, const QList<t_clkCorr>& corrList) {
|
|---|
| [6456] | 23 | if (!out || corrList.size() == 0) {
|
|---|
| 24 | return;
|
|---|
| 25 | }
|
|---|
| [6457] | 26 | out->setf(ios::fixed);
|
|---|
| 27 | bncTime epoTime;
|
|---|
| 28 | QListIterator<t_clkCorr> it(corrList);
|
|---|
| 29 | while (it.hasNext()) {
|
|---|
| 30 | const t_clkCorr& corr = it.next();
|
|---|
| 31 | if (!epoTime.valid()) {
|
|---|
| 32 | epoTime = corr._time;
|
|---|
| [11000] | 33 | *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 34 | << corr._updateInt << " "
|
|---|
| 35 | << corrList.size() << ' ' << corr._staID << endl;
|
|---|
| [6457] | 36 | }
|
|---|
| [7058] | 37 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
|---|
| [11000] | 38 | << setw(10) << setprecision(4) << corr._dClk * t_CST::c << ' ' // m
|
|---|
| 39 | << setw(10) << setprecision(4) << corr._dotDClk * t_CST::c * 1.e3 << ' ' // m/s => mm/s
|
|---|
| 40 | << setw(10) << setprecision(4) << corr._dotDotDClk * t_CST::c * 1.e3 << endl; // m/s² => mm/s²
|
|---|
| [6457] | 41 | }
|
|---|
| [6456] | 42 | out->flush();
|
|---|
| [6144] | 43 | }
|
|---|
| 44 |
|
|---|
| [8483] | 45 | //
|
|---|
| [6144] | 46 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 47 | void t_clkCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_clkCorr>& corrList) {
|
|---|
| [11000] | 48 | bncTime epoTime;
|
|---|
| [6556] | 49 | unsigned int updateInt;
|
|---|
| [11000] | 50 | int numCorr;
|
|---|
| 51 | string staID;
|
|---|
| [6556] | 52 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::clkCorr) {
|
|---|
| [6502] | 53 | return;
|
|---|
| 54 | }
|
|---|
| [6503] | 55 | for (int ii = 0; ii < numCorr; ii++) {
|
|---|
| [6504] | 56 | t_clkCorr corr;
|
|---|
| [11000] | 57 | corr._time = epoTime;
|
|---|
| [6556] | 58 | corr._updateInt = updateInt;
|
|---|
| [11000] | 59 | corr._staID = staID;
|
|---|
| [6503] | 60 |
|
|---|
| 61 | string line;
|
|---|
| [6507] | 62 | getline(inStream, line);
|
|---|
| [6503] | 63 | istringstream in(line.c_str());
|
|---|
| [8483] | 64 |
|
|---|
| [6504] | 65 | in >> corr._prn >> corr._iod >> corr._dClk >> corr._dotDClk >> corr._dotDotDClk;
|
|---|
| [10599] | 66 |
|
|---|
| 67 | char sys = corr._prn.system();
|
|---|
| [11000] | 68 | int num = corr._prn.number();
|
|---|
| [10599] | 69 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
|---|
| 70 | corr._prn.setFlag(flag);
|
|---|
| 71 |
|
|---|
| [11000] | 72 | corr._dClk /= (t_CST::c);
|
|---|
| 73 | corr._dotDClk /= (t_CST::c * 1.e3);
|
|---|
| [10565] | 74 | corr._dotDotDClk /= (t_CST::c * 1.e3);
|
|---|
| [7014] | 75 |
|
|---|
| [6504] | 76 | corrList.push_back(corr);
|
|---|
| [6503] | 77 | }
|
|---|
| [6180] | 78 | }
|
|---|
| 79 |
|
|---|
| [6466] | 80 | // Constructor
|
|---|
| [6180] | 81 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 82 | t_orbCorr::t_orbCorr() {
|
|---|
| [6589] | 83 | _updateInt = 0;
|
|---|
| [11000] | 84 | _iod = 0;
|
|---|
| 85 | _system = 'R';
|
|---|
| 86 | _xr.ReSize(3);
|
|---|
| 87 | _xr = 0.0;
|
|---|
| 88 | _dotXr.ReSize(3);
|
|---|
| 89 | _dotXr = 0.0;
|
|---|
| [10998] | 90 | _ssrFormat = ssrUnknown;
|
|---|
| [6144] | 91 | }
|
|---|
| 92 |
|
|---|
| [8483] | 93 | //
|
|---|
| [6144] | 94 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 95 | void t_orbCorr::writeEpoch(ostream* out, const QList<t_orbCorr>& corrList) {
|
|---|
| [6456] | 96 | if (!out || corrList.size() == 0) {
|
|---|
| 97 | return;
|
|---|
| 98 | }
|
|---|
| [6460] | 99 | out->setf(ios::fixed);
|
|---|
| 100 | bncTime epoTime;
|
|---|
| 101 | QListIterator<t_orbCorr> it(corrList);
|
|---|
| 102 | while (it.hasNext()) {
|
|---|
| 103 | const t_orbCorr& corr = it.next();
|
|---|
| 104 | if (!epoTime.valid()) {
|
|---|
| 105 | epoTime = corr._time;
|
|---|
| [11000] | 106 | *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 107 | << corr._updateInt << " "
|
|---|
| 108 | << corrList.size() << ' ' << corr._staID << endl;
|
|---|
| [10998] | 109 | *out << " " << static_cast<int>(corr._ssrFormat) << endl;
|
|---|
| [6460] | 110 | }
|
|---|
| [7058] | 111 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
|---|
| [11000] | 112 | << setw(10) << setprecision(4) << corr._xr[0] << ' '
|
|---|
| 113 | << setw(10) << setprecision(4) << corr._xr[1] << ' '
|
|---|
| 114 | << setw(10) << setprecision(4) << corr._xr[2] << " "
|
|---|
| 115 | << setw(10) << setprecision(4) << corr._dotXr[0] * 1.e3 << ' ' // m/s => mm/s
|
|---|
| 116 | << setw(10) << setprecision(4) << corr._dotXr[1] * 1.e3 << ' ' // m/s => mm/s
|
|---|
| 117 | << setw(10) << setprecision(4) << corr._dotXr[2] * 1.e3 << endl; // m/s => mm/s
|
|---|
| [6460] | 118 | }
|
|---|
| [6456] | 119 | out->flush();
|
|---|
| [6144] | 120 | }
|
|---|
| 121 |
|
|---|
| [8483] | 122 | //
|
|---|
| [6455] | 123 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 124 | void t_orbCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_orbCorr>& corrList) {
|
|---|
| [11000] | 125 | bncTime epoTime;
|
|---|
| [6556] | 126 | unsigned int updateInt;
|
|---|
| [11000] | 127 | int numCorr;
|
|---|
| 128 | string staID;
|
|---|
| [6556] | 129 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::orbCorr) {
|
|---|
| [6504] | 130 | return;
|
|---|
| 131 | }
|
|---|
| [10998] | 132 |
|
|---|
| 133 | e_ssrFormat ssrFormat = ssrUnknown;
|
|---|
| 134 | {
|
|---|
| 135 | string line;
|
|---|
| 136 | getline(inStream, line);
|
|---|
| 137 | istringstream in(line.c_str());
|
|---|
| 138 | int ssrFormatInt = 0;
|
|---|
| 139 | if (in >> ssrFormatInt) {
|
|---|
| 140 | ssrFormat = static_cast<e_ssrFormat>(ssrFormatInt);
|
|---|
| 141 | }
|
|---|
| 142 | }
|
|---|
| 143 |
|
|---|
| [6504] | 144 | for (int ii = 0; ii < numCorr; ii++) {
|
|---|
| 145 | t_orbCorr corr;
|
|---|
| [11000] | 146 | corr._time = epoTime;
|
|---|
| [6556] | 147 | corr._updateInt = updateInt;
|
|---|
| [11000] | 148 | corr._staID = staID;
|
|---|
| [10998] | 149 | corr._ssrFormat = ssrFormat;
|
|---|
| [6504] | 150 |
|
|---|
| 151 | string line;
|
|---|
| [6507] | 152 | getline(inStream, line);
|
|---|
| [6504] | 153 | istringstream in(line.c_str());
|
|---|
| [8483] | 154 |
|
|---|
| [11000] | 155 | in >> corr._prn >> corr._iod >> corr._xr[0] >> corr._xr[1] >> corr._xr[2] >> corr._dotXr[0] >> corr._dotXr[1] >> corr._dotXr[2];
|
|---|
| [6504] | 156 |
|
|---|
| [10599] | 157 | char sys = corr._prn.system();
|
|---|
| [11000] | 158 | int num = corr._prn.number();
|
|---|
| [10599] | 159 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
|---|
| 160 | corr._prn.setFlag(flag);
|
|---|
| 161 |
|
|---|
| [9685] | 162 | corr._dotXr[0] /= 1.e3; // mm/s => m/s
|
|---|
| 163 | corr._dotXr[1] /= 1.e3; // mm/s => m/s
|
|---|
| 164 | corr._dotXr[2] /= 1.e3; // mm/s => m/s
|
|---|
| [9682] | 165 |
|
|---|
| [6504] | 166 | corrList.push_back(corr);
|
|---|
| 167 | }
|
|---|
| [6455] | 168 | }
|
|---|
| [6475] | 169 |
|
|---|
| [8483] | 170 | // Constructor
|
|---|
| [6475] | 171 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 172 | t_URA::t_URA() {
|
|---|
| [11000] | 173 | _updateInt = 0;
|
|---|
| 174 | _iod = 0;
|
|---|
| 175 | _ura = 0.0;
|
|---|
| [8483] | 176 | }
|
|---|
| 177 |
|
|---|
| 178 | //
|
|---|
| 179 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 180 | void t_URA::writeEpoch(ostream* out, const QList<t_URA>& corrList) {
|
|---|
| [8483] | 181 | if (!out || corrList.size() == 0) {
|
|---|
| 182 | return;
|
|---|
| 183 | }
|
|---|
| 184 | out->setf(ios::fixed);
|
|---|
| 185 | bncTime epoTime;
|
|---|
| 186 | QListIterator<t_URA> it(corrList);
|
|---|
| 187 | while (it.hasNext()) {
|
|---|
| 188 | const t_URA& corr = it.next();
|
|---|
| 189 | if (!epoTime.valid()) {
|
|---|
| 190 | epoTime = corr._time;
|
|---|
| [11000] | 191 | *out << "> URA " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 192 | << corr._updateInt << " "
|
|---|
| 193 | << corrList.size() << ' ' << corr._staID << endl;
|
|---|
| [8483] | 194 | }
|
|---|
| 195 | *out << corr._prn.toString() << ' ' << setw(11) << corr._iod << ' '
|
|---|
| [11000] | 196 | << setw(10) << setprecision(4) << corr._ura << endl;
|
|---|
| [8483] | 197 | }
|
|---|
| 198 | out->flush();
|
|---|
| 199 | }
|
|---|
| 200 |
|
|---|
| 201 | //
|
|---|
| 202 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 203 | void t_URA::readEpoch(const string& epoLine, istream& inStream, QList<t_URA>& corrList) {
|
|---|
| [11000] | 204 | bncTime epoTime;
|
|---|
| [8483] | 205 | unsigned int updateInt;
|
|---|
| [11000] | 206 | int numCorr;
|
|---|
| 207 | string staID;
|
|---|
| [8483] | 208 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::URA) {
|
|---|
| 209 | return;
|
|---|
| 210 | }
|
|---|
| 211 | for (int ii = 0; ii < numCorr; ii++) {
|
|---|
| 212 | t_URA corr;
|
|---|
| [11000] | 213 | corr._time = epoTime;
|
|---|
| [8483] | 214 | corr._updateInt = updateInt;
|
|---|
| [11000] | 215 | corr._staID = staID;
|
|---|
| [8483] | 216 |
|
|---|
| 217 | string line;
|
|---|
| 218 | getline(inStream, line);
|
|---|
| 219 | istringstream in(line.c_str());
|
|---|
| 220 |
|
|---|
| 221 | in >> corr._prn >> corr._iod >> corr._ura;
|
|---|
| 222 |
|
|---|
| [10599] | 223 | char sys = corr._prn.system();
|
|---|
| [11000] | 224 | int num = corr._prn.number();
|
|---|
| [10599] | 225 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
|---|
| 226 | corr._prn.setFlag(flag);
|
|---|
| 227 |
|
|---|
| [8483] | 228 | corrList.push_back(corr);
|
|---|
| 229 | }
|
|---|
| 230 | }
|
|---|
| 231 |
|
|---|
| 232 | //
|
|---|
| 233 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 234 | void t_satCodeBias::writeEpoch(ostream* out, const QList<t_satCodeBias>& biasList) {
|
|---|
| [6476] | 235 | if (!out || biasList.size() == 0) {
|
|---|
| 236 | return;
|
|---|
| 237 | }
|
|---|
| 238 | out->setf(ios::fixed);
|
|---|
| 239 | bncTime epoTime;
|
|---|
| 240 | QListIterator<t_satCodeBias> it(biasList);
|
|---|
| 241 | while (it.hasNext()) {
|
|---|
| 242 | const t_satCodeBias& satCodeBias = it.next();
|
|---|
| 243 | if (!epoTime.valid()) {
|
|---|
| 244 | epoTime = satCodeBias._time;
|
|---|
| [11000] | 245 | *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 246 | << satCodeBias._updateInt << " "
|
|---|
| 247 | << biasList.size() << ' ' << satCodeBias._staID << endl;
|
|---|
| [6476] | 248 | }
|
|---|
| [6567] | 249 | *out << satCodeBias._prn.toString() << " " << setw(2) << satCodeBias._bias.size();
|
|---|
| [6477] | 250 | for (unsigned ii = 0; ii < satCodeBias._bias.size(); ii++) {
|
|---|
| 251 | const t_frqCodeBias& frqCodeBias = satCodeBias._bias[ii];
|
|---|
| 252 | *out << " " << frqCodeBias._rnxType2ch << ' '
|
|---|
| [11000] | 253 | << setw(10) << setprecision(4) << frqCodeBias._value;
|
|---|
| [6477] | 254 | }
|
|---|
| [6476] | 255 | *out << endl;
|
|---|
| 256 | }
|
|---|
| 257 | out->flush();
|
|---|
| [6475] | 258 | }
|
|---|
| 259 |
|
|---|
| [8483] | 260 | //
|
|---|
| [6475] | 261 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 262 | void t_satCodeBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satCodeBias>& biasList) {
|
|---|
| [11000] | 263 | bncTime epoTime;
|
|---|
| [6556] | 264 | unsigned int updateInt;
|
|---|
| [11000] | 265 | int numSat;
|
|---|
| 266 | string staID;
|
|---|
| [6556] | 267 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::codeBias) {
|
|---|
| [6505] | 268 | return;
|
|---|
| 269 | }
|
|---|
| 270 | for (int ii = 0; ii < numSat; ii++) {
|
|---|
| 271 | t_satCodeBias satCodeBias;
|
|---|
| [11000] | 272 | satCodeBias._time = epoTime;
|
|---|
| [6556] | 273 | satCodeBias._updateInt = updateInt;
|
|---|
| [11000] | 274 | satCodeBias._staID = staID;
|
|---|
| [6505] | 275 |
|
|---|
| 276 | string line;
|
|---|
| [6507] | 277 | getline(inStream, line);
|
|---|
| [6505] | 278 | istringstream in(line.c_str());
|
|---|
| [8483] | 279 |
|
|---|
| [6567] | 280 | int numBias;
|
|---|
| 281 | in >> satCodeBias._prn >> numBias;
|
|---|
| [6505] | 282 |
|
|---|
| [10599] | 283 | char sys = satCodeBias._prn.system();
|
|---|
| [11000] | 284 | int num = satCodeBias._prn.number();
|
|---|
| [10599] | 285 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
|---|
| 286 | satCodeBias._prn.setFlag(flag);
|
|---|
| 287 |
|
|---|
| [6505] | 288 | while (in.good()) {
|
|---|
| 289 | t_frqCodeBias frqCodeBias;
|
|---|
| 290 | in >> frqCodeBias._rnxType2ch >> frqCodeBias._value;
|
|---|
| 291 | if (!frqCodeBias._rnxType2ch.empty()) {
|
|---|
| 292 | satCodeBias._bias.push_back(frqCodeBias);
|
|---|
| 293 | }
|
|---|
| 294 | }
|
|---|
| 295 |
|
|---|
| 296 | biasList.push_back(satCodeBias);
|
|---|
| 297 | }
|
|---|
| [6475] | 298 | }
|
|---|
| [6481] | 299 |
|
|---|
| [8483] | 300 | //
|
|---|
| [6481] | 301 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 302 | void t_satPhaseBias::writeEpoch(ostream* out, const QList<t_satPhaseBias>& biasList) {
|
|---|
| [6493] | 303 | if (!out || biasList.size() == 0) {
|
|---|
| 304 | return;
|
|---|
| 305 | }
|
|---|
| 306 | out->setf(ios::fixed);
|
|---|
| 307 | bncTime epoTime;
|
|---|
| 308 | QListIterator<t_satPhaseBias> it(biasList);
|
|---|
| 309 | while (it.hasNext()) {
|
|---|
| 310 | const t_satPhaseBias& satPhaseBias = it.next();
|
|---|
| 311 | if (!epoTime.valid()) {
|
|---|
| 312 | epoTime = satPhaseBias._time;
|
|---|
| [11000] | 313 | *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 314 | << satPhaseBias._updateInt << " "
|
|---|
| 315 | << biasList.size() << ' ' << satPhaseBias._staID << endl;
|
|---|
| [10999] | 316 |
|
|---|
| 317 | if (satPhaseBias._ssrFormat == e_ssrFormat::ssrRtcmNew) {
|
|---|
| 318 | *out << " " << static_cast<int>(satPhaseBias._ssrFormat) << " "
|
|---|
| [11000] | 319 | << satPhaseBias._satYawInfoInd << " "
|
|---|
| 320 | << satPhaseBias._extPBPhaseInd << endl;
|
|---|
| [10999] | 321 | }
|
|---|
| [11000] | 322 | else {
|
|---|
| 323 | *out << " " << static_cast<int>(satPhaseBias._ssrFormat) << " "
|
|---|
| 324 | << satPhaseBias._dispBiasConsistInd << " "
|
|---|
| 325 | << satPhaseBias._MelbWuebConsistInd << endl;
|
|---|
| 326 | }
|
|---|
| [6493] | 327 | }
|
|---|
| [11000] | 328 | if (satPhaseBias._ssrFormat == e_ssrFormat::ssrRtcmNew) {
|
|---|
| 329 | *out << satPhaseBias._prn.toString() << ' '
|
|---|
| 330 | << setw(12) << setprecision(8) << satPhaseBias._yaw * 180.0 / M_PI << ' '
|
|---|
| 331 | << setw(12) << setprecision(8) << satPhaseBias._yawRate * 180.0 / M_PI << " "
|
|---|
| 332 | << setw(2) << satPhaseBias._bias.size();
|
|---|
| 333 | for (unsigned ii = 0; ii < satPhaseBias._bias.size(); ii++) {
|
|---|
| 334 | const t_frqPhaseBias& frqPhaseBias = satPhaseBias._bias[ii];
|
|---|
| 335 | *out << " " << frqPhaseBias._rnxType2ch << ' '
|
|---|
| 336 | << setw(10) << setprecision(4) << frqPhaseBias._value << ' '
|
|---|
| 337 | << setw(3) << frqPhaseBias._fixIndicator << ' '
|
|---|
| 338 | << setw(3) << frqPhaseBias._fixWideLaneIndicator << ' '
|
|---|
| 339 | << setw(3) << frqPhaseBias._jumpCounter;
|
|---|
| 340 | }
|
|---|
| 341 | *out << endl;
|
|---|
| [6493] | 342 | }
|
|---|
| [11000] | 343 | else {
|
|---|
| 344 | *out << satPhaseBias._prn.toString() << ' '
|
|---|
| 345 | << setw(12) << setprecision(8) << satPhaseBias._yaw * 180.0 / M_PI << ' '
|
|---|
| 346 | << setw(12) << setprecision(8) << satPhaseBias._yawRate * 180.0 / M_PI << " "
|
|---|
| 347 | << setw(2) << satPhaseBias._bias.size();
|
|---|
| 348 | for (unsigned ii = 0; ii < satPhaseBias._bias.size(); ii++) {
|
|---|
| 349 | const t_frqPhaseBias& frqPhaseBias = satPhaseBias._bias[ii];
|
|---|
| 350 | *out << " " << frqPhaseBias._rnxType2ch << ' '
|
|---|
| 351 | << setw(10) << setprecision(4) << frqPhaseBias._value << ' '
|
|---|
| 352 | << setw(3) << frqPhaseBias._fixIndicator << ' '
|
|---|
| 353 | << setw(3) << frqPhaseBias._fixWideLaneIndicator << ' '
|
|---|
| 354 | << setw(3) << frqPhaseBias._jumpCounter;
|
|---|
| 355 | }
|
|---|
| 356 | *out << endl;
|
|---|
| 357 | }
|
|---|
| [6493] | 358 | }
|
|---|
| 359 | out->flush();
|
|---|
| [6481] | 360 | }
|
|---|
| [8483] | 361 |
|
|---|
| 362 | //
|
|---|
| [6481] | 363 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 364 | void t_satPhaseBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satPhaseBias>& biasList) {
|
|---|
| [11000] | 365 | bncTime epoTime;
|
|---|
| [6556] | 366 | unsigned int updateInt;
|
|---|
| [11000] | 367 | int numSat;
|
|---|
| 368 | string staID;
|
|---|
| [10999] | 369 | unsigned int metadata1;
|
|---|
| 370 | unsigned int metadata2;
|
|---|
| [11000] | 371 | e_ssrFormat ssrFormat = ssrUnknown;
|
|---|
| [6556] | 372 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::phaseBias) {
|
|---|
| [6506] | 373 | return;
|
|---|
| 374 | }
|
|---|
| [6859] | 375 | for (int ii = 0; ii <= numSat; ii++) {
|
|---|
| [6506] | 376 | t_satPhaseBias satPhaseBias;
|
|---|
| [11000] | 377 | satPhaseBias._time = epoTime;
|
|---|
| [6556] | 378 | satPhaseBias._updateInt = updateInt;
|
|---|
| [11000] | 379 | satPhaseBias._staID = staID;
|
|---|
| [6506] | 380 |
|
|---|
| 381 | string line;
|
|---|
| [6507] | 382 | getline(inStream, line);
|
|---|
| [6506] | 383 | istringstream in(line.c_str());
|
|---|
| [6857] | 384 |
|
|---|
| [6859] | 385 | if (ii == 0) {
|
|---|
| [10998] | 386 | int ssrFormatInt = 0;
|
|---|
| [10999] | 387 | in >> ssrFormatInt >> metadata1 >> metadata2;
|
|---|
| [10998] | 388 | ssrFormat = static_cast<e_ssrFormat>(ssrFormatInt);
|
|---|
| [6859] | 389 | continue;
|
|---|
| 390 | }
|
|---|
| [10998] | 391 | satPhaseBias._ssrFormat = ssrFormat;
|
|---|
| [11000] | 392 | switch (ssrFormat) {
|
|---|
| 393 | case e_ssrFormat::ssrRtcmNew:
|
|---|
| 394 | satPhaseBias._dispBiasConsistInd = metadata1;
|
|---|
| 395 | satPhaseBias._MelbWuebConsistInd = metadata2;
|
|---|
| 396 | break;
|
|---|
| 397 | case e_ssrFormat::ssrRtcmOld:
|
|---|
| 398 | case e_ssrFormat::ssrUnknown:
|
|---|
| 399 | satPhaseBias._satYawInfoInd = metadata1;
|
|---|
| 400 | satPhaseBias._extPBPhaseInd = metadata2;
|
|---|
| 401 | break;
|
|---|
| [10999] | 402 | }
|
|---|
| [6567] | 403 | int numBias;
|
|---|
| [8617] | 404 | double yawDeg, yawDegRate;
|
|---|
| [11000] | 405 | in >> satPhaseBias._prn >> yawDeg >> yawDegRate >> numBias;
|
|---|
| [8617] | 406 | satPhaseBias._yaw = yawDeg * M_PI / 180.0;
|
|---|
| 407 | satPhaseBias._yawRate = yawDegRate * M_PI / 180.0;
|
|---|
| [6506] | 408 |
|
|---|
| [10599] | 409 | char sys = satPhaseBias._prn.system();
|
|---|
| [11000] | 410 | int num = satPhaseBias._prn.number();
|
|---|
| [10599] | 411 | int flag = t_corrSSR::getSsrNavTypeFlag(sys, num);
|
|---|
| 412 | satPhaseBias._prn.setFlag(flag);
|
|---|
| 413 |
|
|---|
| [6506] | 414 | while (in.good()) {
|
|---|
| 415 | t_frqPhaseBias frqPhaseBias;
|
|---|
| [11000] | 416 | in >> frqPhaseBias._rnxType2ch >> frqPhaseBias._value >> frqPhaseBias._fixIndicator >> frqPhaseBias._fixWideLaneIndicator >> frqPhaseBias._jumpCounter;
|
|---|
| [6506] | 417 | if (!frqPhaseBias._rnxType2ch.empty()) {
|
|---|
| 418 | satPhaseBias._bias.push_back(frqPhaseBias);
|
|---|
| 419 | }
|
|---|
| 420 | }
|
|---|
| 421 |
|
|---|
| 422 | biasList.push_back(satPhaseBias);
|
|---|
| 423 | }
|
|---|
| [6481] | 424 | }
|
|---|
| [6482] | 425 |
|
|---|
| [8483] | 426 | //
|
|---|
| [6482] | 427 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 428 | void t_vTec::write(ostream* out, const t_vTec& vTec) {
|
|---|
| [6493] | 429 | if (!out || vTec._layers.size() == 0) {
|
|---|
| 430 | return;
|
|---|
| 431 | }
|
|---|
| 432 | out->setf(ios::fixed);
|
|---|
| 433 | bncTime epoTime = vTec._time;
|
|---|
| [11000] | 434 | *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 435 | << vTec._updateInt << " "
|
|---|
| 436 | << vTec._layers.size() << ' ' << vTec._staID << endl;
|
|---|
| [6495] | 437 | for (unsigned ii = 0; ii < vTec._layers.size(); ii++) {
|
|---|
| 438 | const t_vTecLayer& layer = vTec._layers[ii];
|
|---|
| [11000] | 439 | *out << setw(2) << ii + 1 << ' '
|
|---|
| 440 | << setw(2) << layer._C.Nrows() - 1 << ' '
|
|---|
| 441 | << setw(2) << layer._C.Ncols() - 1 << ' '
|
|---|
| 442 | << setw(10) << setprecision(1) << layer._height << endl
|
|---|
| 443 | << setw(10) << setprecision(4) << layer._C
|
|---|
| 444 | << setw(10) << setprecision(4) << layer._S;
|
|---|
| [6495] | 445 | }
|
|---|
| [6493] | 446 | out->flush();
|
|---|
| [6482] | 447 | }
|
|---|
| 448 |
|
|---|
| [8483] | 449 | //
|
|---|
| [6482] | 450 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11007] | 451 | void t_vTec::read(const string& epoLine, istream& inStream, t_vTec& vTec) {
|
|---|
| [11000] | 452 | bncTime epoTime;
|
|---|
| [6556] | 453 | unsigned int updateInt;
|
|---|
| [11000] | 454 | int numLayers;
|
|---|
| 455 | string staID;
|
|---|
| [6556] | 456 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numLayers, staID) != t_corrSSR::vTec) {
|
|---|
| [6507] | 457 | return;
|
|---|
| 458 | }
|
|---|
| 459 | if (numLayers <= 0) {
|
|---|
| 460 | return;
|
|---|
| 461 | }
|
|---|
| [11000] | 462 | vTec._time = epoTime;
|
|---|
| [6556] | 463 | vTec._updateInt = updateInt;
|
|---|
| [11000] | 464 | vTec._staID = staID;
|
|---|
| [6507] | 465 | for (int ii = 0; ii < numLayers; ii++) {
|
|---|
| 466 | t_vTecLayer layer;
|
|---|
| 467 |
|
|---|
| 468 | string line;
|
|---|
| 469 | getline(inStream, line);
|
|---|
| 470 | istringstream in(line.c_str());
|
|---|
| 471 |
|
|---|
| 472 | int dummy, maxDeg, maxOrd;
|
|---|
| [6515] | 473 | in >> dummy >> maxDeg >> maxOrd >> layer._height;
|
|---|
| [6507] | 474 |
|
|---|
| [11000] | 475 | layer._C.ReSize(maxDeg + 1, maxOrd + 1);
|
|---|
| 476 | layer._S.ReSize(maxDeg + 1, maxOrd + 1);
|
|---|
| [6507] | 477 |
|
|---|
| [6878] | 478 | for (int iDeg = 0; iDeg <= maxDeg; iDeg++) {
|
|---|
| 479 | for (int iOrd = 0; iOrd <= maxOrd; iOrd++) {
|
|---|
| [6508] | 480 | inStream >> layer._C[iDeg][iOrd];
|
|---|
| 481 | }
|
|---|
| 482 | }
|
|---|
| [6878] | 483 | for (int iDeg = 0; iDeg <= maxDeg; iDeg++) {
|
|---|
| 484 | for (int iOrd = 0; iOrd <= maxOrd; iOrd++) {
|
|---|
| [6508] | 485 | inStream >> layer._S[iDeg][iOrd];
|
|---|
| 486 | }
|
|---|
| 487 | }
|
|---|
| [6507] | 488 |
|
|---|
| 489 | vTec._layers.push_back(layer);
|
|---|
| 490 | }
|
|---|
| [6482] | 491 | }
|
|---|
| [6498] | 492 |
|
|---|
| [8483] | 493 | //
|
|---|
| [6498] | 494 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [11008] | 495 | void t_metaData::write(ostream* out, const t_metaData& md) {
|
|---|
| 496 | if (!out || md._entries.size() == 0) {
|
|---|
| 497 | return;
|
|---|
| 498 | }
|
|---|
| 499 | out->setf(ios::fixed);
|
|---|
| 500 | bncTime epoTime = md._time;
|
|---|
| 501 | *out << "> META_DATA " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1, ' ') << " "
|
|---|
| 502 | << 0 << " " << md._entries.size() << ' ' << md._staID << endl;
|
|---|
| 503 | *out << md._ssrIOD << ' ' << md._providerID << ' ' << md._solutionID << endl;
|
|---|
| 504 | for (unsigned ii = 0; ii < md._entries.size(); ii++) {
|
|---|
| 505 | const t_metaDataEntry& entry = md._entries[ii];
|
|---|
| 506 | *out << setw(2) << entry._typeIndicator << ' '
|
|---|
| 507 | << setw(1) << entry._applicationIndicator << ' '
|
|---|
| 508 | << setw(1) << entry._nonDefaultIndicator << ' '
|
|---|
| 509 | << setw(2) << entry._nonDefaultIdentifier << ' '
|
|---|
| 510 | << setw(1) << entry._dataIODIndicator << ' '
|
|---|
| 511 | << setw(3) << entry._dataIOD << endl;
|
|---|
| 512 | }
|
|---|
| 513 | out->flush();
|
|---|
| 514 | }
|
|---|
| 515 |
|
|---|
| 516 | //
|
|---|
| 517 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 518 | void t_metaData::read(const string& epoLine, istream& inStream, t_metaData& md) {
|
|---|
| 519 | bncTime epoTime;
|
|---|
| 520 | unsigned int updateInt;
|
|---|
| 521 | int numEntries;
|
|---|
| 522 | string staID;
|
|---|
| 523 | if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numEntries, staID) != t_corrSSR::metaData) {
|
|---|
| 524 | return;
|
|---|
| 525 | }
|
|---|
| 526 | if (numEntries <= 0) {
|
|---|
| 527 | return;
|
|---|
| 528 | }
|
|---|
| 529 | md._time = epoTime;
|
|---|
| 530 | md._staID = staID;
|
|---|
| 531 |
|
|---|
| 532 | string line;
|
|---|
| 533 | getline(inStream, line);
|
|---|
| 534 | istringstream inHdr(line.c_str());
|
|---|
| 535 | inHdr >> md._ssrIOD >> md._providerID >> md._solutionID;
|
|---|
| 536 |
|
|---|
| 537 | for (int ii = 0; ii < numEntries; ii++) {
|
|---|
| 538 | getline(inStream, line);
|
|---|
| 539 | istringstream in(line.c_str());
|
|---|
| 540 | t_metaDataEntry entry;
|
|---|
| 541 | in >> entry._typeIndicator >> entry._applicationIndicator >> entry._nonDefaultIndicator
|
|---|
| 542 | >> entry._nonDefaultIdentifier >> entry._dataIODIndicator >> entry._dataIOD;
|
|---|
| 543 | md._entries.push_back(entry);
|
|---|
| 544 | }
|
|---|
| 545 | }
|
|---|
| 546 |
|
|---|
| 547 | //
|
|---|
| 548 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| [8483] | 549 | t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime,
|
|---|
| [11000] | 550 | unsigned int& updateInt, int& numEntries,
|
|---|
| [11007] | 551 | string& staID) {
|
|---|
| [6498] | 552 |
|
|---|
| [6500] | 553 | istringstream inLine(line.c_str());
|
|---|
| 554 |
|
|---|
| [11000] | 555 | char epoChar;
|
|---|
| [6500] | 556 | string typeString;
|
|---|
| [11000] | 557 | int year, month, day, hour, min;
|
|---|
| [6500] | 558 | double sec;
|
|---|
| 559 |
|
|---|
| [11000] | 560 | inLine >> epoChar >> typeString >> year >> month >> day >> hour >> min >> sec >> updateInt >> numEntries >> staID;
|
|---|
| [6500] | 561 |
|
|---|
| 562 | if (epoChar == '>') {
|
|---|
| 563 | epoTime.set(year, month, day, hour, min, sec);
|
|---|
| [11000] | 564 | if (typeString == "CLOCK") {
|
|---|
| [6500] | 565 | return clkCorr;
|
|---|
| 566 | }
|
|---|
| 567 | else if (typeString == "ORBIT") {
|
|---|
| 568 | return orbCorr;
|
|---|
| 569 | }
|
|---|
| 570 | else if (typeString == "CODE_BIAS") {
|
|---|
| 571 | return codeBias;
|
|---|
| 572 | }
|
|---|
| 573 | else if (typeString == "PHASE_BIAS") {
|
|---|
| 574 | return phaseBias;
|
|---|
| 575 | }
|
|---|
| 576 | else if (typeString == "VTEC") {
|
|---|
| 577 | return vTec;
|
|---|
| 578 | }
|
|---|
| [8483] | 579 | else if (typeString == "URA") {
|
|---|
| 580 | return URA;
|
|---|
| 581 | }
|
|---|
| [11008] | 582 | else if (typeString == "META_DATA") {
|
|---|
| 583 | return metaData;
|
|---|
| 584 | }
|
|---|
| [6500] | 585 | }
|
|---|
| 586 |
|
|---|
| 587 | return unknown;
|
|---|
| [6498] | 588 | }
|
|---|
| [10599] | 589 |
|
|---|
| 590 | // Set NAV type to force NAVtype usage according SSR standard
|
|---|
| 591 | /////////////////////////////////////////////////////////////
|
|---|
| [11007] | 592 | t_eph::e_type t_corrSSR::getSsrNavTypeFlag(char sys, int num) {
|
|---|
| [10599] | 593 |
|
|---|
| 594 | t_eph::e_type flag = t_eph::undefined;
|
|---|
| 595 |
|
|---|
| 596 | switch (sys) {
|
|---|
| [11000] | 597 | case 'G':
|
|---|
| 598 | case 'J':
|
|---|
| 599 | case 'I': // not part of the SSR standard
|
|---|
| 600 | flag = t_eph::LNAV;
|
|---|
| 601 | break;
|
|---|
| 602 | case 'R':
|
|---|
| 603 | flag = t_eph::FDMA_M;
|
|---|
| 604 | break;
|
|---|
| 605 | case 'E':
|
|---|
| 606 | flag = t_eph::INAV;
|
|---|
| 607 | break;
|
|---|
| 608 | case 'C':
|
|---|
| 609 | if (num < 6) { // GEO
|
|---|
| 610 | flag = t_eph::D2;
|
|---|
| 611 | }
|
|---|
| 612 | else if (num > 58 && num < 63) { // GEO
|
|---|
| 613 | flag = t_eph::D2;
|
|---|
| 614 | }
|
|---|
| 615 | else {
|
|---|
| 616 | flag = t_eph::D1;
|
|---|
| 617 | }
|
|---|
| 618 | break;
|
|---|
| 619 | case 'S':
|
|---|
| 620 | flag = t_eph::SBASL1;
|
|---|
| 621 | break;
|
|---|
| [10599] | 622 | }
|
|---|
| 623 |
|
|---|
| 624 | return flag;
|
|---|
| 625 | }
|
|---|