Index: trunk/BNC/src/bncephuser.cpp
===================================================================
--- trunk/BNC/src/bncephuser.cpp	(revision 9199)
+++ trunk/BNC/src/bncephuser.cpp	(revision 9202)
@@ -206,12 +206,8 @@
   }
   double rr = xc.Rows(1,3).NormFrobenius();
-  double rv = vv.NormFrobenius();
+
   const double MINDIST = 2.e7;
   const double MAXDIST = 6.e7;
   if (rr < MINDIST || rr > MAXDIST || std::isnan(rr)) {
-    eph->setCheckState(t_eph::bad);
-    return;
-  }
-  if (eph->type() == t_eph::GLONASS && rv < 1.0) {
     eph->setCheckState(t_eph::bad);
     return;
@@ -224,38 +220,38 @@
     QDateTime now = currentDateAndTimeGPS();
     bncTime currentTime(now.toString(Qt::ISODate).toStdString());
-    double dt = fabs(currentTime - toc);
+    double dt = currentTime - toc;
 
     // update interval: 2h, data sets are valid for 4 hours
-    if      (eph->type() == t_eph::GPS     && dt > 4*3600) {
+    if      (eph->type() == t_eph::GPS     && (dt > 4*3600.0 || dt < -2*3600.0)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // update interval: 3h, data sets are valid for 4 hours
-    else if (eph->type() == t_eph::Galileo && dt > 4*3600) {
+    else if (eph->type() == t_eph::Galileo && (dt > 4*3600.0 || dt <       0.0)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // updated every 30 minutes
-    else if (eph->type() == t_eph::GLONASS && dt > 2*3600) {
+    else if (eph->type() == t_eph::GLONASS && (dt > 1*3600.0 || dt <   -1800.0)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // orbit parameters are valid for 7200 seconds (minimum)
-    else if (eph->type() == t_eph::QZSS    && dt > 3*3600) {
+    else if (eph->type() == t_eph::QZSS    && (dt > 2*3600.0 || dt < -1*3600.0)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // maximum update interval: 300 sec
-    else if (eph->type() == t_eph::SBAS    && dt > 1*3600) {
+    else if (eph->type() == t_eph::SBAS    && (dt >     600 || dt <       -300)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // updates 1h (GEO) up to 6 hours non-GEO
-    else if (eph->type() == t_eph::BDS     && dt > 6*3600) {
+    else if (eph->type() == t_eph::BDS     && (dt > 6*3600  || dt <        0.0)) {
       eph->setCheckState(t_eph::outdated);
       return;
     }
     // update interval: up to 24 hours
-    else if (eph->type() == t_eph::IRNSS   && dt > 24*3600) {
+    else if (eph->type() == t_eph::IRNSS   && fabs(dt > 24*3600)) {
       eph->setCheckState(t_eph::outdated);
       return;
@@ -281,28 +277,35 @@
 
     // some lines to allow update of ephemeris data sets after outage
-    if      (eph->type() == t_eph::GPS     && dt >  4*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if (eph->type() == t_eph::Galileo && dt >  4*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if (eph->type() == t_eph::GLONASS && dt >  2*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if (eph->type() == t_eph::QZSS    && dt >  3*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if  (eph->type() == t_eph::SBAS   && dt >    3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
+    // update interval: 2h,
+    if      (eph->type() == t_eph::GPS     && dt >  2*3600) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    // update interval: 3h,
+    else if (eph->type() == t_eph::Galileo && dt >  3*3600) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    // updated every 30 minutes
+    else if (eph->type() == t_eph::GLONASS && dt >    1800) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    // updated every ?
+    else if (eph->type() == t_eph::QZSS    && dt >  2*3600) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    // maximum update interval: 300 sec
+    else if  (eph->type() == t_eph::SBAS   && dt >     300) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    // updates 1h (GEO) up to 6 hours non-GEO
     else if  (eph->type() == t_eph::BDS    && dt >  6*3600) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
+    // update interval: up to 24 hours
     else if  (eph->type() == t_eph::IRNSS  && dt > 24*3600) {
       ephL->setCheckState(t_eph::outdated);
