Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 7715)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 7716)
@@ -34,5 +34,5 @@
  * Created:    27-Jan-2011
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -51,8 +51,8 @@
     connect(BNC_CORE, SIGNAL(newGPSEph(t_ephGPS)),
             this, SLOT(slotNewGPSEph(t_ephGPS)), Qt::DirectConnection);
-  
+
     connect(BNC_CORE, SIGNAL(newGlonassEph(t_ephGlo)),
             this, SLOT(slotNewGlonassEph(t_ephGlo)), Qt::DirectConnection);
-  
+
     connect(BNC_CORE, SIGNAL(newGalileoEph(t_ephGal)),
             this, SLOT(slotNewGalileoEph(t_ephGal)), Qt::DirectConnection);
@@ -79,10 +79,10 @@
 }
 
-// New GPS Ephemeris 
+// New GPS Ephemeris
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewGPSEph(t_ephGPS eph) {
   putNewEph(&eph, false);
 }
-    
+
 // New Glonass Ephemeris
 ////////////////////////////////////////////////////////////////////////////
@@ -109,5 +109,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {
@@ -159,5 +159,5 @@
     ephOld = 0;
   }
-  
+
   if ((ephOld == 0 || newEph->isNewerThan(ephOld)) &&
       (eph->checkState() != t_eph::bad ||
@@ -178,5 +178,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::checkEphemeris(t_eph* eph) {
@@ -257,19 +257,25 @@
 
     // some lines to allow update of ephemeris data sets after outage
-    if      ((eph->type() == t_eph::GPS ||
-              eph->type() == t_eph::Galileo)  && dt > 4*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if ((eph->type() == t_eph::GLONASS ||
-              eph->type() == t_eph::QZSS)     && dt > 2*3600) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if  (eph->type() == t_eph::SBAS      && dt > 1*3600)   {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-    else if  (eph->type() == t_eph::BDS       && dt > 6*3600)   {
+    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 > 1*3600) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::QZSS    && dt > 1*1800) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if  (eph->type() == t_eph::SBAS   && dt > 600)   {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if  (eph->type() == t_eph::BDS    && dt > 6*3600)   {
       ephL->setCheckState(t_eph::outdated);
       return;
Index: /trunk/BNC/src/upload/bncephuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 7715)
+++ /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 7716)
@@ -11,5 +11,5 @@
  * Created:    03-Apr-2011
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -17,5 +17,5 @@
 #include <iostream>
 #include <math.h>
-#include "bncephuploadcaster.h" 
+#include "bncephuploadcaster.h"
 #include "bncsettings.h"
 #include "RTCM3/ephEncoder.h"
@@ -38,8 +38,8 @@
     int     sampl    = settings.value("uploadEphSample").toInt();
 
-    _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort, 
+    _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort,
                                            password, -1, sampl);
 
-    connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)), 
+    connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)),
           this, SIGNAL(newBytes(QByteArray,double)));
 
@@ -62,7 +62,13 @@
     QByteArray outBuffer;
 
+    QDateTime now = currentDateAndTimeGPS();
+    bncTime currentTime(now.toString(Qt::ISODate).toStdString());
+
     QListIterator<QString> it(prnList());
     while (it.hasNext()) {
       const t_eph* eph = ephLast(it.next());
+
+      bncTime toc = eph->TOC();
+      double timeDiff = fabs(toc - currentTime);
 
       const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
@@ -76,17 +82,27 @@
 
       if (ephGPS) {
-        size = t_ephEncoder::RTCM3(*ephGPS, Array);
+        if (eph->checkState() == t_eph::ok && timeDiff <= 4*3600) {
+          size = t_ephEncoder::RTCM3(*ephGPS, Array);
+        }
       }
       else if (ephGlo) {
-        size = t_ephEncoder::RTCM3(*ephGlo, Array);
+        if (eph->checkState() == t_eph::ok && timeDiff <= 1*3600) {
+          size = t_ephEncoder::RTCM3(*ephGlo, Array);
+        }
       }
       else if (ephGal) {
-        size = t_ephEncoder::RTCM3(*ephGal, Array);
+        if (eph->checkState() == t_eph::ok && timeDiff <= 4*3600) {
+          size = t_ephEncoder::RTCM3(*ephGal, Array);
+        }
       }
       else if (ephSBAS) {
-        size = t_ephEncoder::RTCM3(*ephSBAS, Array);
+        if (eph->checkState() == t_eph::ok && timeDiff <= 600) {
+          size = t_ephEncoder::RTCM3(*ephSBAS, Array);
+        }
       }
       else if (ephBDS) {
-        size = t_ephEncoder::RTCM3(*ephBDS, Array);
+        if (eph->checkState() == t_eph::ok && timeDiff <= 6*3600) {
+          size = t_ephEncoder::RTCM3(*ephBDS, Array);
+        }
       }
       if (size > 0) {
