- Timestamp:
- Jun 17, 2011, 4:34:25 PM (13 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r3302 r3303 443 443 QListIterator<t_obs> it(_decoder->_obsList); 444 444 bool firstObs = true; 445 QMap<QString, long> prnLastEpo;446 445 while (it.hasNext()) { 447 446 const t_obs& obs = it.next(); 447 448 QString prn = QString("%1%2").arg(obs.satSys) 449 .arg(obs.satNum, 2, 10, QChar('0')); 450 long iSec = long(floor(obs.GPSWeeks+0.5)); 451 long obsTime = obs.GPSWeek * 7*24*3600 + iSec; 448 452 449 453 // Check observation epoch 450 454 // ----------------------- 451 455 if (!_rawFile && !dynamic_cast<gpssDecoder*>(_decoder)) { 452 int week;456 int week; 453 457 double sec; 454 458 currentGPSWeeks(week, sec); 455 const double secPerWeek = 7.0 * 24.0 * 3600.0; 456 457 double currSec = week * secPerWeek + sec; 458 double obsSec = obs.GPSWeek * secPerWeek + obs.GPSWeeks; 459 459 long currTime = week * 7*24*3600 + sec; 460 460 const double maxDt = 600.0; 461 462 if (fabs(currSec - obsSec) > maxDt) { 461 if (fabs(currTime - obsTime) > maxDt) { 463 462 emit( newMessage(_staID + ": Wrong observation epoch(s)", false) ); 464 463 continue; … … 468 467 // Check observations comming twice (e.g. KOUR0 Problem) 469 468 // ----------------------------------------------------- 470 long iSec = long(floor(obs.GPSWeeks+0.5)); 471 long newTime = obs.GPSWeek * 7*24*3600 + iSec; 472 QString prn = QString("%1%2").arg(obs.satSys) 473 .arg(obs.satNum, 2, 10, QChar('0')); 474 475 QMap<QString, long>::const_iterator it = prnLastEpo.find(prn); 476 if (it == prnLastEpo.end()) { 477 prnLastEpo[prn] = newTime; 469 QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn); 470 if (it == _prnLastEpo.end()) { 471 _prnLastEpo[prn] = obsTime; 478 472 } 479 473 else { 480 474 long oldTime = it.value(); 481 if ( newTime < oldTime) {475 if (obsTime < oldTime) { 482 476 emit( newMessage(_staID + 483 477 ": old observation " + prn.toAscii(), false)); 484 478 continue; 485 479 } 486 else if ( newTime == oldTime) {480 else if (obsTime == oldTime) { 487 481 emit( newMessage(_staID + 488 482 ": observation comming more than once " + prn.toAscii(), false)); … … 490 484 } 491 485 else { 492 prnLastEpo[prn] = newTime;486 _prnLastEpo[prn] = obsTime; 493 487 } 494 488 } … … 500 494 _rnx->deepCopy(obs); 501 495 } 502 _rnx->dumpEpoch( newTime);496 _rnx->dumpEpoch(obsTime); 503 497 } 504 498 -
trunk/BNC/bncgetthread.h
r3003 r3303 128 128 bncPPPclient* _PPPclient; 129 129 bool _rawOutput; 130 QMap<QString, long> _prnLastEpo; 130 131 }; 131 132
Note:
See TracChangeset
for help on using the changeset viewer.