Changeset 6556 in ntrip
- Timestamp:
- Jan 19, 2015, 6:57:52 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp
r6553 r6556 191 191 if (irc == GCOBR_OK || irc == GCOBR_MESSAGEFOLLOWS ) { 192 192 193 set ReferenceTime(); // sets _lastTime193 setEpochTime(); // sets _lastTime 194 194 195 195 if (_lastTime.valid()) { … … 238 238 t_orbCorr orbCorr; 239 239 orbCorr._prn.set(sysCh, _clkOrb.Sat[ii].ID); 240 orbCorr._staID = _staID.toAscii().data(); 241 orbCorr._iod = _clkOrb.Sat[ii].IOD; 242 orbCorr._time = _lastTime; 243 orbCorr._system = 'R'; 244 orbCorr._xr[0] = _clkOrb.Sat[ii].Orbit.DeltaRadial; 245 orbCorr._xr[1] = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack; 246 orbCorr._xr[2] = _clkOrb.Sat[ii].Orbit.DeltaCrossTrack; 247 orbCorr._dotXr[0] = _clkOrb.Sat[ii].Orbit.DotDeltaRadial; 248 orbCorr._dotXr[1] = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack; 249 orbCorr._dotXr[2] = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack; 240 orbCorr._staID = _staID.toAscii().data(); 241 orbCorr._iod = _clkOrb.Sat[ii].IOD; 242 orbCorr._time = _lastTime; 243 orbCorr._updateInt = _clkOrb.UpdateInterval; 244 orbCorr._system = 'R'; 245 orbCorr._xr[0] = _clkOrb.Sat[ii].Orbit.DeltaRadial; 246 orbCorr._xr[1] = _clkOrb.Sat[ii].Orbit.DeltaAlongTrack; 247 orbCorr._xr[2] = _clkOrb.Sat[ii].Orbit.DeltaCrossTrack; 248 orbCorr._dotXr[0] = _clkOrb.Sat[ii].Orbit.DotDeltaRadial; 249 orbCorr._dotXr[1] = _clkOrb.Sat[ii].Orbit.DotDeltaAlongTrack; 250 orbCorr._dotXr[2] = _clkOrb.Sat[ii].Orbit.DotDeltaCrossTrack; 250 251 251 252 _orbCorrections[_lastTime].push_back(orbCorr); … … 265 266 clkCorr._staID = _staID.toAscii().data(); 266 267 clkCorr._time = _lastTime; 268 clkCorr._updateInt = _clkOrb.UpdateInterval; 267 269 clkCorr._dClk = _clkOrb.Sat[ii].Clock.DeltaA0 / t_CST::c; 268 270 clkCorr._dotDClk = _clkOrb.Sat[ii].Clock.DeltaA1 / t_CST::c; … … 285 287 if (_lastClkCorrections.contains(prn)) { 286 288 t_clkCorr clkCorr; 287 clkCorr = _lastClkCorrections[prn]; 288 clkCorr._time = _lastTime; 289 clkCorr._dClk +=_clkOrb.Sat[ii].hrclock / t_CST::c; 289 clkCorr = _lastClkCorrections[prn]; 290 clkCorr._time = _lastTime; 291 clkCorr._updateInt = _clkOrb.UpdateInterval; 292 clkCorr._dClk += _clkOrb.Sat[ii].hrclock / t_CST::c; 290 293 if (_IODs.contains(clkCorr._prn)) { 291 294 clkCorr._iod = _IODs[clkCorr._prn]; … … 311 314 t_satCodeBias satCodeBias; 312 315 satCodeBias._prn.set(sysCh, _codeBias.Sat[ii].ID); 313 satCodeBias._staID = _staID.toAscii().data(); 314 satCodeBias._time = _lastTime; 316 satCodeBias._staID = _staID.toAscii().data(); 317 satCodeBias._time = _lastTime; 318 satCodeBias._updateInt = _codeBias.UpdateInterval; 315 319 for (unsigned jj = 0; jj < _codeBias.Sat[ii].NumberOfCodeBiases; jj++) { 316 320 const CodeBias::BiasSat::CodeBiasEntry& biasEntry = _codeBias.Sat[ii].Biases[jj]; … … 342 346 satPhaseBias._staID = _staID.toAscii().data(); 343 347 satPhaseBias._time = _lastTime; 348 satPhaseBias._updateInt = _phaseBias.UpdateInterval; 344 349 satPhaseBias._yawDeg = _phaseBias.Sat[ii].YawAngle * 180.0 / M_PI; 345 350 satPhaseBias._yawDegRate = _phaseBias.Sat[ii].YawRate * 180.0 / M_PI; … … 363 368 if (_vTEC.NumLayers > 0) { 364 369 _vTecMap[_lastTime]._time = _lastTime; 370 _vTecMap[_lastTime]._updateInt = _vTEC.UpdateInterval; 365 371 _vTecMap[_lastTime]._staID = _staID.toAscii().data(); 366 372 for (unsigned ii = 0; ii < _vTEC.NumLayers; ii++) { … … 463 469 // 464 470 //////////////////////////////////////////////////////////////////////////// 465 void RTCM3coDecoder::set ReferenceTime() {471 void RTCM3coDecoder::setEpochTime() { 466 472 467 473 _lastTime.reset(); 468 474 469 const QVector<int> updateInt = QVector<int>() << 1 << 2 << 5 << 10 << 15 << 30470 << 60 << 120 << 240 << 300 << 600471 << 900 << 1800 << 3600 << 7200472 << 10800;473 475 double epoSecGPS = -1.0; 474 476 double epoSecGlo = -1.0; 475 477 if (_clkOrb.NumberOfSat[CLOCKORBIT_SATGPS] > 0) { 476 478 epoSecGPS = _clkOrb.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s 477 if (_clkOrb.UpdateInterval) {478 epoSecGPS += 0.5 * updateInt[_clkOrb.UpdateInterval];479 }480 479 } 481 480 else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) { 482 481 epoSecGPS = _codeBias.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s 483 if (_codeBias.UpdateInterval) {484 epoSecGPS += 0.5 * updateInt[_codeBias.UpdateInterval];485 }486 482 } 487 483 else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGPS] > 0) { 488 484 epoSecGPS = _phaseBias.EpochTime[CLOCKORBIT_SATGPS]; // 0 .. 604799 s 489 if (_phaseBias.UpdateInterval) {490 epoSecGPS += 0.5 * updateInt[_phaseBias.UpdateInterval];491 }492 485 } 493 486 else if (_vTEC.NumLayers > 0) { 494 487 epoSecGPS = _vTEC.EpochTime; // 0 .. 604799 s 495 if (_vTEC.UpdateInterval) {496 epoSecGPS += 0.5 * updateInt[_vTEC.UpdateInterval];497 }498 488 } 499 489 else if (_clkOrb.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) { 500 490 epoSecGlo = _clkOrb.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s 501 if (_clkOrb.UpdateInterval) {502 epoSecGlo += 0.5 * updateInt[_clkOrb.UpdateInterval];503 }504 491 } 505 492 else if (_codeBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) { 506 493 epoSecGlo = _codeBias.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s 507 if (_codeBias.UpdateInterval) {508 epoSecGlo += 0.5 * updateInt[_codeBias.UpdateInterval];509 }510 494 } 511 495 else if (_phaseBias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) { 512 496 epoSecGlo = _phaseBias.EpochTime[CLOCKORBIT_SATGLONASS]; // 0 .. 86399 s 513 if (_phaseBias.UpdateInterval) {514 epoSecGlo += 0.5 * updateInt[_phaseBias.UpdateInterval];515 }516 497 } 517 498 -
trunk/BNC/src/RTCM3/RTCM3coDecoder.h
r6553 r6556 54 54 private: 55 55 void reset(); 56 void set ReferenceTime();56 void setEpochTime(); 57 57 void sendResults(); 58 58 void reopen(); -
trunk/BNC/src/ephemeris.cpp
r6537 r6556 47 47 return failure; 48 48 } 49 49 const QVector<int> updateInt = QVector<int>() << 1 << 2 << 5 << 10 << 15 << 30 50 << 60 << 120 << 240 << 300 << 600 51 << 900 << 1800 << 3600 << 7200 52 << 10800; 50 53 xc.ReSize(4); 51 54 vv.ReSize(3); … … 55 58 if (useCorr) { 56 59 if (_orbCorr && _clkCorr) { 57 58 60 double dtO = tt - _orbCorr->_time; 61 if (_orbCorr->_updateInt) { 62 dtO -= (0.5 * updateInt[_orbCorr->_updateInt]); 63 } 59 64 ColumnVector dx(3); 60 65 dx[0] = _orbCorr->_xr[0] + _orbCorr->_dotXr[0] * dtO; … … 71 76 72 77 double dtC = tt - _clkCorr->_time; 78 if (_clkCorr->_updateInt) { 79 dtC -= (0.5 * updateInt[_clkCorr->_updateInt]); 80 } 73 81 xc[3] += _clkCorr->_dClk + _clkCorr->_dotDClk * dtC + _clkCorr->_dotDotDClk * dtC * dtC; 74 82 } -
trunk/BNC/src/rinex/corrfile.cpp
r6516 r6556 77 77 } 78 78 79 int numEntries; 80 string staID; 81 t_corrSSR::e_type corrType = t_corrSSR::readEpoLine(_lastLine, _lastEpoTime, numEntries, staID); 79 int numEntries; 80 unsigned int updateInt; 81 string staID; 82 t_corrSSR::e_type corrType = t_corrSSR::readEpoLine(_lastLine, _lastEpoTime, updateInt, numEntries, staID); 82 83 if (corrType == t_corrSSR::unknown) { 83 84 throw "t_corrFile: unknown line " + _lastLine; -
trunk/BNC/src/satObs.cpp
r6515 r6556 30 30 if (!epoTime.valid()) { 31 31 epoTime = corr._time; 32 *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 32 *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 33 << corr._updateInt << " " 33 34 << corrList.size() << ' ' << corr._staID << endl; 34 35 } … … 44 45 //////////////////////////////////////////////////////////////////////////// 45 46 void t_clkCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_clkCorr>& corrList) { 46 bncTime epoTime; 47 int numCorr; 48 string staID; 49 if (t_corrSSR::readEpoLine(epoLine, epoTime, numCorr, staID) != t_corrSSR::clkCorr) { 47 bncTime epoTime; 48 unsigned int updateInt; 49 int numCorr; 50 string staID; 51 if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::clkCorr) { 50 52 return; 51 53 } 52 54 for (int ii = 0; ii < numCorr; ii++) { 53 55 t_clkCorr corr; 54 corr._time = epoTime; 55 corr._staID = staID; 56 corr._time = epoTime; 57 corr._updateInt = updateInt; 58 corr._staID = staID; 56 59 57 60 string line; … … 91 94 if (!epoTime.valid()) { 92 95 epoTime = corr._time; 93 *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 96 *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 97 << corr._updateInt << " " 94 98 << corrList.size() << ' ' << corr._staID << endl; 95 99 } … … 108 112 //////////////////////////////////////////////////////////////////////////// 109 113 void t_orbCorr::readEpoch(const string& epoLine, istream& inStream, QList<t_orbCorr>& corrList) { 110 bncTime epoTime; 111 int numCorr; 112 string staID; 113 if (t_corrSSR::readEpoLine(epoLine, epoTime, numCorr, staID) != t_corrSSR::orbCorr) { 114 bncTime epoTime; 115 unsigned int updateInt; 116 int numCorr; 117 string staID; 118 if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numCorr, staID) != t_corrSSR::orbCorr) { 114 119 return; 115 120 } 116 121 for (int ii = 0; ii < numCorr; ii++) { 117 122 t_orbCorr corr; 118 corr._time = epoTime; 119 corr._staID = staID; 123 corr._time = epoTime; 124 corr._updateInt = updateInt; 125 corr._staID = staID; 120 126 121 127 string line; … … 144 150 if (!epoTime.valid()) { 145 151 epoTime = satCodeBias._time; 146 *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 152 *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 153 << satCodeBias._updateInt << " " 147 154 << biasList.size() << ' ' << satCodeBias._staID << endl; 148 155 } … … 161 168 //////////////////////////////////////////////////////////////////////////// 162 169 void t_satCodeBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satCodeBias>& biasList) { 163 bncTime epoTime; 164 int numSat; 165 string staID; 166 if (t_corrSSR::readEpoLine(epoLine, epoTime, numSat, staID) != t_corrSSR::codeBias) { 170 bncTime epoTime; 171 unsigned int updateInt; 172 int numSat; 173 string staID; 174 if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::codeBias) { 167 175 return; 168 176 } 169 177 for (int ii = 0; ii < numSat; ii++) { 170 178 t_satCodeBias satCodeBias; 171 satCodeBias._time = epoTime; 172 satCodeBias._staID = staID; 179 satCodeBias._time = epoTime; 180 satCodeBias._updateInt = updateInt; 181 satCodeBias._staID = staID; 173 182 174 183 string line; … … 203 212 if (!epoTime.valid()) { 204 213 epoTime = satPhaseBias._time; 205 *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 214 *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 215 << satPhaseBias._updateInt << " " 206 216 << biasList.size() << ' ' << satPhaseBias._staID << endl; 207 217 } … … 225 235 //////////////////////////////////////////////////////////////////////////// 226 236 void t_satPhaseBias::readEpoch(const string& epoLine, istream& inStream, QList<t_satPhaseBias>& biasList) { 227 bncTime epoTime; 228 int numSat; 229 string staID; 230 if (t_corrSSR::readEpoLine(epoLine, epoTime, numSat, staID) != t_corrSSR::phaseBias) { 237 bncTime epoTime; 238 unsigned int updateInt; 239 int numSat; 240 string staID; 241 if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numSat, staID) != t_corrSSR::phaseBias) { 231 242 return; 232 243 } 233 244 for (int ii = 0; ii < numSat; ii++) { 234 245 t_satPhaseBias satPhaseBias; 235 satPhaseBias._time = epoTime; 236 satPhaseBias._staID = staID; 246 satPhaseBias._time = epoTime; 247 satPhaseBias._updateInt = updateInt; 248 satPhaseBias._staID = staID; 237 249 238 250 string line; … … 264 276 out->setf(ios::fixed); 265 277 bncTime epoTime = vTec._time; 266 *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 278 *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " " 279 << vTec._updateInt << " " 267 280 << vTec._layers.size() << ' ' << vTec._staID << endl; 268 281 for (unsigned ii = 0; ii < vTec._layers.size(); ii++) { … … 281 294 //////////////////////////////////////////////////////////////////////////// 282 295 void t_vTec::read(const string& epoLine, istream& inStream, t_vTec& vTec) { 283 bncTime epoTime; 284 int numLayers; 285 string staID; 286 if (t_corrSSR::readEpoLine(epoLine, epoTime, numLayers, staID) != t_corrSSR::vTec) { 296 bncTime epoTime; 297 unsigned int updateInt; 298 int numLayers; 299 string staID; 300 if (t_corrSSR::readEpoLine(epoLine, epoTime, updateInt, numLayers, staID) != t_corrSSR::vTec) { 287 301 return; 288 302 } … … 290 304 return; 291 305 } 292 vTec._time = epoTime; 293 vTec._staID = staID; 306 vTec._time = epoTime; 307 vTec._updateInt = updateInt; 308 vTec._staID = staID; 294 309 for (int ii = 0; ii < numLayers; ii++) { 295 310 t_vTecLayer layer; … … 323 338 //////////////////////////////////////////////////////////////////////////// 324 339 t_corrSSR::e_type t_corrSSR::readEpoLine(const string& line, bncTime& epoTime, 325 int& numEntries, string& staID) { 340 unsigned int& updateInt, int& numEntries, 341 string& staID) { 326 342 327 343 istringstream inLine(line.c_str()); … … 333 349 334 350 inLine >> epoChar >> typeString 335 >> year >> month >> day >> hour >> min >> sec >> numEntries >> staID;351 >> year >> month >> day >> hour >> min >> sec >> updateInt >> numEntries >> staID; 336 352 337 353 if (epoChar == '>') { -
trunk/BNC/src/satObs.h
r6501 r6556 68 68 unsigned short _iod; 69 69 bncTime _time; 70 unsigned int _updateInt; 70 71 char _system; 71 72 ColumnVector _xr; … … 82 83 unsigned short _iod; 83 84 bncTime _time; 85 unsigned int _updateInt; 84 86 double _dClk; 85 87 double _dotDClk; … … 103 105 t_prn _prn; 104 106 bncTime _time; 107 unsigned int _updateInt; 105 108 std::vector<t_frqCodeBias> _bias; 106 109 }; … … 132 135 t_prn _prn; 133 136 bncTime _time; 137 unsigned int _updateInt; 134 138 double _yawDeg; 135 139 double _yawDegRate; … … 150 154 std::string _staID; 151 155 bncTime _time; 156 unsigned int _updateInt; 152 157 std::vector<t_vTecLayer> _layers; 153 158 }; … … 157 162 enum e_type {clkCorr, orbCorr, codeBias, phaseBias, vTec, unknown}; 158 163 static e_type readEpoLine(const std::string& line, bncTime& epoTime, 159 int& numEntries, std::string& staID);164 unsigned int& updateInt, int& numEntries, std::string& staID); 160 165 }; 161 166
Note:
See TracChangeset
for help on using the changeset viewer.