Changeset 2488 in ntrip


Ignore:
Timestamp:
May 30, 2010, 6:11:37 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncgetthread.cpp

    r2390 r2488  
    463463          const double secPerWeek = 7.0 * 24.0 * 3600.0;
    464464         
    465           if (week < obs->_o.GPSWeek) {
    466             week += 1;
    467             sec  -= secPerWeek;
    468           }
    469           if (week > obs->_o.GPSWeek) {
    470             week -= 1;
    471             sec  += secPerWeek;
    472           }
    473           double dt = fabs(sec - obs->_o.GPSWeeks);
     465          double currSec = week            * secPerWeek + sec;
     466          double obsSec  = obs->_o.GPSWeek * secPerWeek + obs->_o.GPSWeeks;
     467
    474468          const double maxDt = 600.0;
    475           if (week != obs->_o.GPSWeek || dt > maxDt) {
     469
     470          if (fabs(currSec - obsSec) > maxDt) {
    476471              emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
    477472            delete obs;
Note: See TracChangeset for help on using the changeset viewer.