Ignore:
Timestamp:
Oct 12, 2026, 3:32:43 PM (40 hours ago)
Author:
stuerze
Message:

further fixes and improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp

    r11074 r11083  
    12751275    if (bdt) {
    12761276      epoSecBds += 14.0;
    1277       if (epoSecBds > 604800.0) {
     1277      if (epoSecBds >= 604800.0) {
    12781278        epoSecBds -= 7.0*24.0*60.0*60.0;
    12791279      }
    … …  
    12891289  }
    12901290
     1291  // The epoch is given as seconds of week (or of day): move it by whole days
     1292  // to the one closest to the current time. Folding in 12 h steps (as
     1293  // before) stopped at the edge of the +-12 h window, e.g. at the week
     1294  // change a correction of Saturday 23:59:55 received after midnight ended
     1295  // up at Sunday 11:59:55.
    12911296  if (_lastTime.valid()) {
    1292     double maxDiff = 12 * 3600.0;
    1293     while (_lastTime < currentTime - maxDiff) {
    1294       _lastTime = _lastTime + maxDiff;
    1295     }
    1296     while (_lastTime > currentTime + maxDiff) {
    1297       _lastTime = _lastTime - maxDiff;
     1297    const double halfDay = 12 * 3600.0;
     1298    const double day     = 24 * 3600.0;
     1299    while (_lastTime < currentTime - halfDay) {
     1300      _lastTime = _lastTime + day;
     1301    }
     1302    while (_lastTime > currentTime + halfDay) {
     1303      _lastTime = _lastTime - day;
    12981304    }
    12991305  }
Note: See TracChangeset for help on using the changeset viewer.