Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 11057)
+++ trunk/BNC/src/ephemeris.cpp	(revision 11137)
@@ -26,4 +26,24 @@
   _clkCorr = 0;
 }
+
+// Is this data set newer than eph (the latest one received)?
+// Usually its TOC is later. An upload of a GPS or QZSS satellite within the
+// curve fit interval (cutover) gets a TOC slightly earlier than that of the
+// data set it replaces (e.g. 01:59:44 instead of 02:00:00, i.e. off the regular
+// grid), and a different IOD; the new upload is broadcast from then on and
+// the corrections of the ACs refer to it.
+////////////////////////////////////////////////////////////////////////////
+bool t_eph::isNewerThan(const t_eph* eph) const {
+  if (eph->_TOC < _TOC) {
+    return true;
+  }
+  const double MAX_CUTOVER_SHIFT = 600.0;  // observed: 16 s, 32 s
+  if ((system() == GPS || system() == QZSS) && system() == eph->system() &&
+      IOD() != eph->IOD() && eph->_TOC - _TOC <= MAX_CUTOVER_SHIFT) {
+    return true;
+  }
+  return false;
+}
+
 // Destructor
 ////////////////////////////////////////////////////////////////////////////
