Index: /trunk/BNC/src/bncgetthread.cpp
===================================================================
--- /trunk/BNC/src/bncgetthread.cpp	(revision 8010)
+++ /trunk/BNC/src/bncgetthread.cpp	(revision 8011)
@@ -537,18 +537,10 @@
         const t_satObs& obs = it.next();
 
-        QString prn(obs._prn.toString().c_str());
-        long iSec    = long(floor(obs._time.gpssec()+0.5));
-        long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
-
         // Check observation epoch
         // -----------------------
         if (!_rawFile) {
-          int    week;
-          double sec;
-          currentGPSWeeks(week, sec);
-          long currTime = week * 7*24*3600 + long(sec);
-          const double maxDt = 600.0;
-          if (fabs(currTime - obsTime) > maxDt) {
-              emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
+          bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
+          if (wrongObservationEpoch) {
+            emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
             continue;
           }
@@ -558,4 +550,7 @@
         // ----------------------------------------------------
         if (!_rawFile) {
+          QString prn(obs._prn.toString().c_str());
+          long iSec    = long(floor(obs._time.gpssec()+0.5));
+          long obsTime = obs._time.gpsw()*7*24*3600 + iSec;
           QMap<QString, long>::const_iterator it = _prnLastEpo.find(prn);
           if (it != _prnLastEpo.end()) {
Index: /trunk/BNC/src/bncutils.cpp
===================================================================
--- /trunk/BNC/src/bncutils.cpp	(revision 8010)
+++ /trunk/BNC/src/bncutils.cpp	(revision 8011)
@@ -249,4 +249,20 @@
 //
 ////////////////////////////////////////////////////////////////////////////
+bool checkForWrongObsEpoch(bncTime obsEpoch) {
+  const double maxDt = 600.0;
+  long iSec    = long(floor(obsEpoch.gpssec()+0.5));
+  long obsTime = obsEpoch.gpsw()*7*24*3600 + iSec;
+  int    week;
+  double sec;
+  currentGPSWeeks(week, sec);
+  long currTime = week * 7*24*3600 + long(sec);
+
+  if (fabs(currTime - obsTime) > maxDt) {
+    return true;
+  }
+  return false;
+}
+//
+////////////////////////////////////////////////////////////////////////////
 QByteArray ggaString(const QByteArray& latitude,
                      const QByteArray& longitude,
Index: /trunk/BNC/src/bncutils.h
===================================================================
--- /trunk/BNC/src/bncutils.h	(revision 8010)
+++ /trunk/BNC/src/bncutils.h	(revision 8011)
@@ -50,5 +50,5 @@
  * and must be handled separately.
  * @param week GPS week number (must be prefilled, contains fixed value afterwards)
- * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards) 
+ * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards)
  * @param mSecOfWeek milli seconds in GLONASS time
  * @param fixnumleap when <code>true</code> then result is UTC time, otherwise it is GPS
@@ -63,4 +63,6 @@
 QDateTime    currentDateAndTimeGPS();
 
+bool         checkForWrongObsEpoch(bncTime obsEpoch);
+
 QByteArray   ggaString(const QByteArray& latitude, const QByteArray& longitude,
                        const QByteArray& height, const QString& ggaType);
@@ -84,8 +86,8 @@
 void         jacobiEll_XYZ(const double* Ell, Matrix& jacobi);
 
-void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell, 
+void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell,
                            SymmetricMatrix& Qneu);
 
-void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell, 
+void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell,
                            SymmetricMatrix& Qxyz);
 
@@ -96,10 +98,10 @@
 double       nint(double val);
 
-ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc, 
+ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc,
                          ColumnVector (*der)(double x, const ColumnVector& y, double* acc));
 
 void         GPSweekFromDateAndTime(const QDateTime& dateTime, int& GPSWeek, double& GPSWeeks);
 
-void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec, 
+void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec,
                                int& GPSWeek, double& GPSWeeks);
 
@@ -112,5 +114,5 @@
 int          readDbl(const QString& str, int pos, int len, double& value);
 
-void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat, 
+void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat,
                    double& rho, double& eleSat, double& azSat);
 
@@ -119,5 +121,5 @@
 QString      fortranFormat(double value, int width, int prec);
 
-void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP, 
+void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP,
                     SymmetricMatrix& QQ, ColumnVector& xx);
 
Index: /trunk/BNC/src/latencychecker.cpp
===================================================================
--- /trunk/BNC/src/latencychecker.cpp	(revision 8010)
+++ /trunk/BNC/src/latencychecker.cpp	(revision 8011)
@@ -35,5 +35,5 @@
  * Created:    02-Feb-2009
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -60,5 +60,5 @@
   _staID = staID;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)), 
+  connect(this, SIGNAL(newMessage(QByteArray,bool)),
           BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
 
@@ -69,21 +69,21 @@
   QString adviseObsRate = settings.value("adviseObsRate").toString();
   _inspSegm = 0;
-  if      ( adviseObsRate.isEmpty() ) { 
-    _inspSegm = 0; 
-  }
-  else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) { 
-    _inspSegm = 20; 
-  }
-  else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) { 
-    _inspSegm = 10; 
-  }
-  else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) { 
-    _inspSegm = 20; 
-  }
-  else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) { 
-    _inspSegm = 40; 
-  }
-  else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) { 
-    _inspSegm = 50; 
+  if      ( adviseObsRate.isEmpty() ) {
+    _inspSegm = 0;
+  }
+  else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) {
+    _inspSegm = 20;
+  }
+  else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) {
+    _inspSegm = 10;
+  }
+  else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) {
+    _inspSegm = 20;
+  }
+  else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) {
+    _inspSegm = 40;
+  }
+  else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) {
+    _inspSegm = 50;
   }
   _adviseFail = settings.value("adviseFail").toInt();
@@ -96,30 +96,30 @@
   _miscIntr = 1;
   QString miscIntr = settings.value("miscIntr").toString();
-  if      ( miscIntr.isEmpty() ) { 
-    _miscIntr = 1; 
-  }
-  else if ( miscIntr.indexOf("2 sec")   != -1 ) { 
-    _miscIntr = 2; 
-  }
-  else if ( miscIntr.indexOf("10 sec")  != -1 ) { 
-    _miscIntr = 10; 
-  }
-  else if ( miscIntr.indexOf("1 min")   != -1 ) { 
-    _miscIntr = 60; 
-  }
-  else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) { 
-    _miscIntr = 300; 
-  }
-  else if ( miscIntr.indexOf("15 min")  != -1 ) { 
-    _miscIntr = 900; 
-  }
-  else if ( miscIntr.indexOf("1 hour")  != -1 ) { 
-    _miscIntr = 3600; 
-  }
-  else if ( miscIntr.indexOf("6 hours") != -1 ) { 
-    _miscIntr = 21600; 
-  }
-  else if ( miscIntr.indexOf("1 day")   != -1 ) { 
-    _miscIntr = 86400; 
+  if      ( miscIntr.isEmpty() ) {
+    _miscIntr = 1;
+  }
+  else if ( miscIntr.indexOf("2 sec")   != -1 ) {
+    _miscIntr = 2;
+  }
+  else if ( miscIntr.indexOf("10 sec")  != -1 ) {
+    _miscIntr = 10;
+  }
+  else if ( miscIntr.indexOf("1 min")   != -1 ) {
+    _miscIntr = 60;
+  }
+  else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) {
+    _miscIntr = 300;
+  }
+  else if ( miscIntr.indexOf("15 min")  != -1 ) {
+    _miscIntr = 900;
+  }
+  else if ( miscIntr.indexOf("1 hour")  != -1 ) {
+    _miscIntr = 3600;
+  }
+  else if ( miscIntr.indexOf("6 hours") != -1 ) {
+    _miscIntr = 21600;
+  }
+  else if ( miscIntr.indexOf("1 day")   != -1 ) {
+    _miscIntr = 86400;
   }
 
@@ -162,5 +162,5 @@
   _begDateTimeCorr = QDateTime::currentDateTime();
   _endDateTimeCorr = QDateTime::currentDateTime();
-  
+
 }
 
@@ -180,5 +180,5 @@
   if (!_fromReconnect) {
     _endDateTimeOut = QDateTime::currentDateTime();
-  } 
+  }
   _fromReconnect = true;
 
@@ -277,5 +277,5 @@
           _decodeStartCorr = QDateTime::currentDateTime();
         }
-      } 
+      }
       else {
 
@@ -307,5 +307,5 @@
   if (_fromReconnect) {
     _begDateTimeOut = QDateTime::currentDateTime();
-  } 
+  }
   _fromReconnect = false;
 
@@ -336,7 +336,7 @@
     while (it.hasNext()) {
       const t_satObs& obs = it.next();
-      
+      bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
       _newSecGPS = static_cast<int>(obs._time.gpssec());
-      if (_newSecGPS != _oldSecGPS) {
+      if (_newSecGPS != _oldSecGPS && !wrongObservationEpoch) {
         if (_newSecGPS % _miscIntr < _oldSecGPS % _miscIntr) {
           if (_numLat > 0) {
@@ -454,5 +454,5 @@
               emit(newMessage(QString(_staID + late ).toAscii(), true) );
             }
-          } 
+          }
           else {
             late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")
@@ -500,5 +500,5 @@
 }
 
-// Call advisory notice script    
+// Call advisory notice script
 ////////////////////////////////////////////////////////////////////////////
 void latencyChecker::callScript(const char* comment) {
