Changeset 3302 in ntrip for trunk/BNC/bncgetthread.cpp


Ignore:
Timestamp:
Jun 17, 2011, 4:16:50 PM (13 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r3301 r3302  
    443443      QListIterator<t_obs> it(_decoder->_obsList);
    444444      bool firstObs = true;
    445       QList<QString> prnList;
     445      QMap<QString, long> prnLastEpo;
    446446      while (it.hasNext()) {
    447447        const t_obs& obs = it.next();
     
    468468        // Check observations comming twice (e.g. KOUR0 Problem)
    469469        // -----------------------------------------------------
    470         QString prn = QString("%1%2").arg(obs.satSys)
    471                                      .arg(obs.satNum, 2, 10, QChar('0'));
    472         if (prnList.indexOf(prn) == -1) {
    473           prnList << prn;
     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;
    474478        }
    475479        else {
    476           emit( newMessage(_staID +
    477              ": observation comming more than once " + prn.toAscii(), false) );
    478           continue;
     480          long oldTime = it.value();
     481          if      (newTime <  oldTime) {
     482            emit( newMessage(_staID +
     483               ": old observation " + prn.toAscii(), false));
     484            continue;
     485          }
     486          else if (newTime == oldTime) {
     487            emit( newMessage(_staID +
     488               ": observation comming more than once " + prn.toAscii(), false));
     489            continue;
     490          }
     491          else {
     492            prnLastEpo[prn] = newTime;
     493          }
    479494        }
    480495
     
    482497        // ------------
    483498        if (_rnx) {
    484           long iSec    = long(floor(obs.GPSWeeks+0.5));
    485           long newTime = obs.GPSWeek * 7*24*3600 + iSec;
    486499          if (_samplingRate == 0 || iSec % _samplingRate == 0) {
    487500            _rnx->deepCopy(obs);
Note: See TracChangeset for help on using the changeset viewer.