- Timestamp:
- Dec 17, 2020, 3:48:53 PM (4 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncephuser.cpp
r9301 r9317 158 158 } 159 159 160 if (ephOld == 0 || newEph->isNewerThan(ephOld)) { 160 if ( (ephOld == 0) || 161 newEph->isNewerThan(ephOld) || 162 newCorrectedGpsEphSet(newEph) ) { 161 163 checkEphemeris(newEph, realTime); 162 164 eph->setCheckState(newEph->checkState()); … … 170 172 newEph->checkState() != t_eph::outdated) { 171 173 deque<t_eph*>& qq = _eph[prn]; 172 if (qq.empty() || 173 newEph->isNewerThan(qq.back())){ 174 qq.push_back(newEph); 175 if (qq.size() > _maxQueueSize) { 176 delete qq.front(); 177 qq.pop_front(); 178 } 179 ephBufferChanged(); 180 return success; 181 } 182 else { 183 delete newEph; 184 return failure; 185 } 174 qq.push_back(newEph); 175 if (qq.size() > _maxQueueSize) { 176 delete qq.front(); 177 qq.pop_front(); 178 } 179 ephBufferChanged(); 180 return success; 186 181 } 187 182 else { … … 279 274 ColumnVector vvL(3); 280 275 ephL->getCrd(eph->TOC(), xcL, vvL, false); 281 double dt = eph->TOC() - ephL->TOC(); 282 if (dt < 0.0) { 283 dt += 604800.0; 284 } 276 285 277 double diff = (xc.Rows(1,3) - xcL.Rows(1,3)).NormFrobenius(); 286 278 double diffC = fabs(xc(4) - xcL(4)) * t_CST::c; 287 279 288 280 if (diff < MAXDIFF && diffC < MAXDIFF) { 289 if (diff < MINDIFF && diffC < MINDIFF && ephL->checkState() == t_eph::ok) { 281 if (diff < MINDIFF && diffC < MINDIFF && 282 ephL->checkState() == t_eph::ok) { 290 283 // to prevent the same data sets with different TOC values 291 284 eph->setCheckState(t_eph::bad); … … 301 294 } 302 295 } 296 297 double dt = eph->TOC() - ephL->TOC(); 303 298 // some lines to allow update of ephemeris data sets after an outage 299 // ----------------------------------------------------------------- 304 300 // update interval: 2h, 301 // sometimes corrected BRDC sets are sent with TOC values 16 seconds 302 // before the nominal TOC (integer time) 305 303 if (eph->type() == t_eph::GPS && dt > (2*3600.0 + 60.0)) { 306 304 ephL->setCheckState(t_eph::outdated); … … 313 311 } 314 312 // updated every 30 minutes 315 else if (eph->type() == t_eph::GLONASS && dt > ( 1800.0 + 60.0)) {313 else if (eph->type() == t_eph::GLONASS && dt > ( 1800.0 + 60.0)) { 316 314 ephL->setCheckState(t_eph::outdated); 317 315 return; … … 339 337 } 340 338 } 339 340 // 341 //////////////////////////////////////////////////////////////////////////// 342 bool bncEphUser::newCorrectedGpsEphSet(t_eph* eph) { 343 344 bool correctedGpsEphSet = false; 345 bool newCorrectedGpsEphSet = false; 346 347 if (eph->prn().system() != 'G') { 348 return newCorrectedGpsEphSet; 349 } 350 351 if ((fmod(eph->TOC().daysec()+16.0, 7200) == 0.0)) { 352 // sometimes corrected BRDC sets are sent with TOC values 16 seconds 353 // before the nominal TOC (integer time) 354 correctedGpsEphSet = true; 355 } 356 357 QString prn = QString(eph->prn().toInternalString().c_str()); 358 t_eph* ephL = ephLast(prn); 359 if (!ephL) { // first set for GPS Sat 360 return correctedGpsEphSet; 361 } 362 363 364 double dt = eph->TOC() - ephL->TOC(); 365 if (correctedGpsEphSet){ 366 if (dt == 0.0) { 367 newCorrectedGpsEphSet = false; 368 } 369 else { 370 newCorrectedGpsEphSet = true; 371 } 372 } 373 return newCorrectedGpsEphSet; 374 } -
trunk/BNC/src/bncephuser.h
r8702 r9317 75 75 private: 76 76 void checkEphemeris(t_eph* eph, bool realTime); 77 bool newCorrectedGpsEphSet(t_eph* eph); 77 78 QMutex _mutex; 78 79 static const unsigned _maxQueueSize = 6;
Note:
See TracChangeset
for help on using the changeset viewer.