- Timestamp:
- Jun 11, 2018, 11:18:45 AM (6 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP_SSR_I/pppClient.cpp
r7972 r8368 353 353 ////////////////////////////////////////////////////////////////////////////// 354 354 void t_pppClient::putEphemeris(const t_eph* eph) { 355 bool check = _opt->_realTime;356 355 if (_newEph) 357 356 delete _newEph; … … 375 374 376 375 if (_newEph) { 377 _ephUser->putNewEph(_newEph, check);376 _ephUser->putNewEph(_newEph, _opt->_realTime); 378 377 } 379 378 } -
trunk/BNC/src/bncephuser.cpp
r8317 r8368 83 83 //////////////////////////////////////////////////////////////////////////// 84 84 void bncEphUser::slotNewGPSEph(t_ephGPS eph) { 85 putNewEph(&eph, false);85 putNewEph(&eph, true); 86 86 } 87 87 … … 89 89 //////////////////////////////////////////////////////////////////////////// 90 90 void bncEphUser::slotNewGlonassEph(t_ephGlo eph) { 91 putNewEph(&eph, false);91 putNewEph(&eph, true); 92 92 } 93 93 … … 95 95 //////////////////////////////////////////////////////////////////////////// 96 96 void bncEphUser::slotNewGalileoEph(t_ephGal eph) { 97 putNewEph(&eph, false);97 putNewEph(&eph, true); 98 98 } 99 99 … … 101 101 //////////////////////////////////////////////////////////////////////////// 102 102 void bncEphUser::slotNewSBASEph(t_ephSBAS eph) { 103 putNewEph(&eph, false);103 putNewEph(&eph, true); 104 104 } 105 105 … … 107 107 //////////////////////////////////////////////////////////////////////////// 108 108 void bncEphUser::slotNewBDSEph(t_ephBDS eph) { 109 putNewEph(&eph, false);110 } 111 112 // 113 //////////////////////////////////////////////////////////////////////////// 114 t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {109 putNewEph(&eph, true); 110 } 111 112 // 113 //////////////////////////////////////////////////////////////////////////// 114 t_irc bncEphUser::putNewEph(t_eph* eph, bool realTime) { 115 115 116 116 QMutexLocker locker(&_mutex); … … 120 120 } 121 121 122 if (check) { 123 checkEphemeris(eph); 124 } 122 checkEphemeris(eph, realTime); 125 123 126 124 const t_ephGPS* ephGPS = dynamic_cast<const t_ephGPS*>(eph); … … 175 173 // 176 174 //////////////////////////////////////////////////////////////////////////// 177 void bncEphUser::checkEphemeris(t_eph* eph ) {175 void bncEphUser::checkEphemeris(t_eph* eph, bool realTime) { 178 176 179 177 if (!eph || eph->checkState() == t_eph::ok || eph->checkState() == t_eph::bad) { … … 207 205 // Check whether the epoch is too far away the current time 208 206 // -------------------------------------------------------- 209 bncTime toc = eph->TOC();210 QDateTime now = currentDateAndTimeGPS();211 bncTime currentTime(now.toString(Qt::ISODate).toStdString());212 double timeDiff = fabs(toc - currentTime);213 214 if (eph->type() == t_eph::GPS && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours 215 eph->setCheckState(t_eph::outdated);216 return;217 }218 else if (eph->type() == t_eph::Galileo && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours219 e ph->setCheckState(t_eph::outdated);220 return;221 }222 else if (eph->type() == t_eph::GLONASS && timeDiff > 1*3600) { // updated every 30 minutes223 e ph->setCheckState(t_eph::outdated);224 return;225 }226 else if (eph->type() == t_eph::QZSS && timeDiff > 4*3600) { // orbit parameters are valid for 7200 seconds (at minimum)227 e ph->setCheckState(t_eph::outdated);228 return;229 }230 else if (eph->type() == t_eph::SBAS && timeDiff > 600) { // maximum update interval: 300 sec231 e ph->setCheckState(t_eph::outdated);232 return;233 }234 else if (eph->type() == t_eph::BDS && timeDiff > 6*3600) { // updates (GEO) up to 6 hours235 e ph->setCheckState(t_eph::outdated);236 return;237 }238 else if (eph->type() == t_eph::IRNSS && timeDiff > 24*3600) { // update interval: up to 24 hours239 e ph->setCheckState(t_eph::outdated);240 return;241 }242 243 207 if (realTime) { 208 bncTime toc = eph->TOC(); 209 QDateTime now = currentDateAndTimeGPS(); 210 bncTime currentTime(now.toString(Qt::ISODate).toStdString()); 211 double timeDiff = fabs(toc - currentTime); 212 213 if (eph->type() == t_eph::GPS && timeDiff > 4 * 3600) { // update interval: 2h, data sets are valid for 4 hours 214 eph->setCheckState(t_eph::outdated); 215 return; 216 } 217 else if (eph->type() == t_eph::Galileo && timeDiff > 4 * 3600) { // update interval: 2h, data sets are valid for 4 hours 218 eph->setCheckState(t_eph::outdated); 219 return; 220 } 221 else if (eph->type() == t_eph::GLONASS && timeDiff > 1 * 3600) { // updated every 30 minutes 222 eph->setCheckState(t_eph::outdated); 223 return; 224 } 225 else if (eph->type() == t_eph::QZSS && timeDiff > 4 * 3600) { // orbit parameters are valid for 7200 seconds (at minimum) 226 eph->setCheckState(t_eph::outdated); 227 return; 228 } 229 else if (eph->type() == t_eph::SBAS && timeDiff > 600) { // maximum update interval: 300 sec 230 eph->setCheckState(t_eph::outdated); 231 return; 232 } 233 else if (eph->type() == t_eph::BDS && timeDiff > 6 * 3600) { // updates (GEO) up to 6 hours 234 eph->setCheckState(t_eph::outdated); 235 return; 236 } 237 else if (eph->type() == t_eph::IRNSS && timeDiff > 24 * 3600) { // update interval: up to 24 hours 238 eph->setCheckState(t_eph::outdated); 239 return; 240 } 241 } 244 242 245 243 // Check consistency with older ephemerides -
trunk/BNC/src/bncephuser.h
r6981 r8368 74 74 75 75 private: 76 void checkEphemeris(t_eph* eph );76 void checkEphemeris(t_eph* eph, bool realTime); 77 77 QMutex _mutex; 78 78 static const unsigned _maxQueueSize = 5; -
trunk/BNC/src/ephemeris.cpp
r8217 r8368 335 335 double E = M; 336 336 double E_last; 337 int nLoop = 0; 337 338 do { 338 339 E_last = E; 339 340 E = M + _e*sin(E); 340 } while ( fabs(E-E_last)*a0 > 0.001 ); 341 342 if (++nLoop == 100) { 343 return failure; 344 } 345 } while ( fabs(E-E_last)*a0 > 0.001); 341 346 double v = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) ); 342 347 double u0 = v + _omega; … … 922 927 double E = M; 923 928 double E_last; 929 int nLoop = 0; 924 930 do { 925 931 E_last = E; 926 932 E = M + _e*sin(E); 933 934 if (++nLoop == 100) { 935 return failure; 936 } 927 937 } while ( fabs(E-E_last)*a0 > 0.001 ); 928 938 double v = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) ); … … 1507 1517 1508 1518 return CRC24(size, startbuffer); 1519 1520 1509 1521 } 1510 1522 -
trunk/BNC/src/rinex/reqcanalyze.cpp
r8204 r8368 1054 1054 for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) { 1055 1055 t_eph* eph = rnxNavFile.ephs()[ii]; 1056 ephUser.putNewEph(eph, true);1056 ephUser.putNewEph(eph, false); 1057 1057 if (eph->checkState() == t_eph::bad) { 1058 1058 ++numBad; -
trunk/BNC/src/rinex/reqcedit.cpp
r8355 r8368 642 642 break; 643 643 } 644 if (eph->checkState() != t_eph::bad) { 645 continue; 646 } 644 647 outNavFile.writeEph(eph); 645 648 } -
trunk/BNC/src/rinex/rnxnavfile.cpp
r8354 r8368 210 210 eph = new t_ephGPS(version(), lines); 211 211 } 212 if (eph && 213 eph->checkState() != t_eph::bad && 214 eph->checkState() != t_eph::outdated) { 215 _ephs.push_back(eph); 216 } 217 else { 218 delete eph; 219 } 212 _ephs.push_back(eph); 220 213 } 221 214 }
Note:
See TracChangeset
for help on using the changeset viewer.