Changeset 8012 in ntrip


Ignore:
Timestamp:
Aug 12, 2016, 5:37:37 PM (8 years ago)
Author:
stuerze
Message:

check regarding wrong observation epochs is done in latencychecker as well to prevent erroneous latencies

Location:
branches/BNC_2.12/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bncgetthread.cpp

    r7977 r8012  
    537537        const t_satObs& obs = it.next();
    538538
    539         QString prn(obs._prn.toString().c_str());
    540         long iSec    = long(floor(obs._time.gpssec()+0.5));
    541         long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
    542 
    543539        // Check observation epoch
    544540        // -----------------------
    545541        if (!_rawFile) {
    546           int    week;
    547           double sec;
    548           currentGPSWeeks(week, sec);
    549           long currTime = week * 7*24*3600 + long(sec);
    550           const double maxDt = 600.0;
    551           if (fabs(currTime - obsTime) > maxDt) {
    552               emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
     542          bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
     543          if (wrongObservationEpoch) {
     544            emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
    553545            continue;
    554546          }
     
    558550        // ----------------------------------------------------
    559551        if (!_rawFile) {
     552          QString prn(obs._prn.toString().c_str());
     553          long iSec    = long(floor(obs._time.gpssec()+0.5));
     554          long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
    560555          QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
    561556          if (it != _prnLastEpo.end()) {
  • branches/BNC_2.12/src/bncutils.cpp

    r7979 r8012  
    249249//
    250250////////////////////////////////////////////////////////////////////////////
     251bool checkForWrongObsEpoch(bncTime obsEpoch) {
     252  const double maxDt = 600.0;
     253  long iSec    = long(floor(obsEpoch.gpssec()+0.5));
     254  long obsTime = obsEpoch.gpsw()*7*24*3600 + iSec;
     255  int    week;
     256  double sec;
     257  currentGPSWeeks(week, sec);
     258  long currTime = week * 7*24*3600 + long(sec);
     259
     260  if (fabs(currTime - obsTime) > maxDt) {
     261    return true;
     262  }
     263  return false;
     264}
     265//
     266////////////////////////////////////////////////////////////////////////////
    251267QByteArray ggaString(const QByteArray& latitude,
    252268                     const QByteArray& longitude,
  • branches/BNC_2.12/src/bncutils.h

    r7251 r8012  
    6262
    6363QDateTime    currentDateAndTimeGPS();
     64
     65bool         checkForWrongObsEpoch(bncTime obsEpoch);
    6466
    6567QByteArray   ggaString(const QByteArray& latitude, const QByteArray& longitude,
  • branches/BNC_2.12/src/latencychecker.cpp

    r7422 r8012  
    336336    while (it.hasNext()) {
    337337      const t_satObs& obs = it.next();
    338      
     338      bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
    339339      _newSecGPS = static_cast<int>(obs._time.gpssec());
    340       if (_newSecGPS != _oldSecGPS) {
     340      if (_newSecGPS != _oldSecGPS && !wrongObservationEpoch) {
    341341        if (_newSecGPS % _miscIntr < _oldSecGPS % _miscIntr) {
    342342          if (_numLat > 0) {
Note: See TracChangeset for help on using the changeset viewer.