Index: /trunk/BNC/src/PPP/pppEphPool.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppEphPool.cpp	(revision 6517)
+++ /trunk/BNC/src/PPP/pppEphPool.cpp	(revision 6518)
@@ -26,5 +26,5 @@
 /////////////////////////////////////////////////////////////////////////////
 void t_pppEphPool::putEphemeris(t_eph* eph) {
-  if (eph && eph->ok()) {
+  if (eph && eph->checkState() != t_eph::bad) {
     _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
   }
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 6517)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 6518)
@@ -111,4 +111,8 @@
   }
 
+  if (check) {
+    checkEphemeris(eph);
+  }
+
   const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
   const t_ephGlo*     ephGlo     = dynamic_cast<const t_ephGlo*>(eph);
@@ -157,2 +161,7 @@
 }
 
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncEphUser::checkEphemeris(const t_eph* eph) {
+
+}
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 6517)
+++ /trunk/BNC/src/bncephuser.h	(revision 6518)
@@ -72,4 +72,5 @@
 
  private:
+  void checkEphemeris(const t_eph* eph);
   QMutex                             _mutex;
   static const unsigned              _maxQueueSize = 5;
Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 6517)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 6518)
@@ -21,7 +21,7 @@
 ////////////////////////////////////////////////////////////////////////////
 t_eph::t_eph() {
-  _ok      = false;
-  _orbCorr = 0;
-  _clkCorr = 0;
+  _checkState = unchecked;
+  _orbCorr    = 0;
+  _clkCorr    = 0;
 }
 
@@ -43,4 +43,9 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_eph::getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const {
+
+  if (_checkState == bad) {
+    return failure;
+  }
+
   xc.ReSize(4);
   vv.ReSize(3);
@@ -88,5 +93,5 @@
   }
   else {
-    _ok = false;
+    _checkState = bad;
     return;
   }
@@ -134,6 +139,4 @@
   _TOT         = 0.9999e9;
   _fitInterval = 0.0;
-
-  _ok       = true;
 }
 
@@ -141,4 +144,8 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_ephGPS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+
+  if (_checkState == bad) {
+    return failure;
+  }
 
   static const double omegaEarth = 7292115.1467e-11;
@@ -261,4 +268,8 @@
 t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
 
+  if (_checkState == bad) {
+    return failure;
+  }
+
   static const double nominalStep = 10.0;
 
@@ -402,6 +413,4 @@
   _xv(5) = _y_velocity * 1.e3; 
   _xv(6) = _z_velocity * 1.e3; 
-
-  _ok = true;
 }
 
@@ -452,6 +461,4 @@
 
   _flags    = ee->flags;
-
-  _ok = true;
 }
 
@@ -459,4 +466,8 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_ephGal::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+
+  if (_checkState == bad) {
+    return failure;
+  }
 
   static const double omegaEarth = 7292115.1467e-11;
@@ -545,7 +556,6 @@
   const int nLines = 8;
 
-  _ok = false;
-
   if (lines.size() != nLines) {
+    _checkState = bad;
     return;
   }
@@ -596,4 +606,5 @@
            readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
            readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+        _checkState = bad;
         return;
       }
@@ -605,4 +616,5 @@
            readDbl(line, pos[2], fieldLen, _Delta_n) ||
            readDbl(line, pos[3], fieldLen, _M0     ) ) {
+        _checkState = bad;
         return;
       }
@@ -614,4 +626,5 @@
            readDbl(line, pos[2], fieldLen, _Cus   ) ||
            readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+        _checkState = bad;
         return;
       }
@@ -623,4 +636,5 @@
            readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
            readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+        _checkState = bad;
         return;
       }
@@ -632,4 +646,5 @@
            readDbl(line, pos[2], fieldLen, _omega   ) ||
            readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+        _checkState = bad;
         return;
       }
@@ -641,4 +656,5 @@
            readDbl(line, pos[2], fieldLen, _TOEweek  ) ||
            readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
+        _checkState = bad;
         return;
       }
@@ -650,4 +666,5 @@
            readDbl(line, pos[2], fieldLen, _TGD   ) ||
            readDbl(line, pos[3], fieldLen, _IODC  ) ) {
+        _checkState = bad;
         return;
       }
@@ -656,4 +673,5 @@
     else if ( iLine == 7 ) {
       if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
+        _checkState = bad;
         return;
       }
@@ -661,6 +679,4 @@
     }
   }
-
-  _ok = true;
 }
 
@@ -671,7 +687,6 @@
   const int nLines = 4;
 
-  _ok = false;
-
   if (lines.size() != nLines) {
+    _checkState = bad;
     return;
   }
@@ -722,4 +737,5 @@
            readDbl(line, pos[2], fieldLen, _gamma) ||
            readDbl(line, pos[3], fieldLen, _tki  ) ) {
+        _checkState = bad;
         return;
       }
@@ -733,4 +749,5 @@
            readDbl(line, pos[2], fieldLen, _x_acceleration) ||
            readDbl(line, pos[3], fieldLen, _health        ) ) {
+        _checkState = bad;
         return;
       }
@@ -742,4 +759,5 @@
            readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
            readDbl(line, pos[3], fieldLen, _frequency_number) ) {
+        _checkState = bad;
         return;
       }
@@ -751,4 +769,5 @@
            readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
            readDbl(line, pos[3], fieldLen, _E             ) ) {
+        _checkState = bad;
         return;
       }
@@ -766,6 +785,4 @@
   _xv(5) = _y_velocity * 1.e3; 
   _xv(6) = _z_velocity * 1.e3; 
-
-  _ok = true;
 }
 
@@ -776,7 +793,6 @@
   const int nLines = 8;
 
-  _ok = false;
-
   if (lines.size() != nLines) {
+    _checkState = bad;
     return;
   }
@@ -824,4 +840,5 @@
            readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
            readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+        _checkState = bad;
         return;
       }
@@ -833,4 +850,5 @@
            readDbl(line, pos[2], fieldLen, _Delta_n) ||
            readDbl(line, pos[3], fieldLen, _M0     ) ) {
+        _checkState = bad;
         return;
       }
@@ -842,4 +860,5 @@
            readDbl(line, pos[2], fieldLen, _Cus   ) ||
            readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+        _checkState = bad;
         return;
       }
@@ -851,4 +870,5 @@
            readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
            readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+        _checkState = bad;
         return;
       }
@@ -860,4 +880,5 @@
            readDbl(line, pos[2], fieldLen, _omega   ) ||
            readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+        _checkState = bad;
         return;
       }
@@ -867,4 +888,5 @@
       if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
            readDbl(line, pos[2], fieldLen, _TOEweek) ) {
+        _checkState = bad;
         return;
       }
@@ -876,4 +898,5 @@
            readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
            readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
+        _checkState = bad;
         return;
       }
@@ -882,10 +905,9 @@
     else if ( iLine == 7 ) {
       if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
-        return;
-      }
-    }
-  }
-
-  _ok = true;
+        _checkState = bad;
+        return;
+      }
+    }
+  }
 }
 
@@ -1107,7 +1129,6 @@
   const int nLines = 4;
 
-  _ok = false;
-
   if (lines.size() != nLines) {
+    _checkState = bad;
     return;
   }
@@ -1155,4 +1176,5 @@
            readDbl(line, pos[2], fieldLen, _agf1 ) ||
            readDbl(line, pos[3], fieldLen, _TOW  ) ) {
+        _checkState = bad;
         return;
       }
@@ -1164,4 +1186,5 @@
            readDbl(line, pos[2], fieldLen, _x_acceleration) ||
            readDbl(line, pos[3], fieldLen, _health        ) ) {
+        _checkState = bad;
         return;
       }
@@ -1173,4 +1196,5 @@
            readDbl(line, pos[2], fieldLen, _y_acceleration  ) ||
            readDbl(line, pos[3], fieldLen, _ura             ) ) {
+        _checkState = bad;
         return;
       }
@@ -1182,4 +1206,5 @@
            readDbl(line, pos[2], fieldLen, _z_acceleration)  ||
            readDbl(line, pos[3], fieldLen, _IODN          ) ) {
+        _checkState = bad;
         return;
       }
@@ -1196,6 +1221,4 @@
   _y_acceleration *= 1.e3; 
   _z_acceleration *= 1.e3; 
-
-  _ok = true;
 }
 
@@ -1227,5 +1250,4 @@
   _ura            = ee->URA;
 
-  _ok     = true;
   _health = 0;
 }
@@ -1234,4 +1256,8 @@
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_ephSBAS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+
+  if (_checkState == bad) {
+    return failure;
+  }
 
   bncTime tt(GPSweek, GPSweeks);
@@ -1293,7 +1319,6 @@
   const int nLines = 8;
 
-  _ok = false;
-
   if (lines.size() != nLines) {
+    _checkState = bad;
     return;
   }
@@ -1345,4 +1370,5 @@
            readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
            readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+        _checkState = bad;
         return;
       }
@@ -1355,4 +1381,5 @@
            readDbl(line, pos[2], fieldLen, _Delta_n) ||
            readDbl(line, pos[3], fieldLen, _M0     ) ) {
+        _checkState = bad;
         return;
       }
@@ -1365,4 +1392,5 @@
            readDbl(line, pos[2], fieldLen, _Cus   ) ||
            readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+        _checkState = bad;
         return;
       }
@@ -1374,4 +1402,5 @@
            readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
            readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+        _checkState = bad;
         return;
       }
@@ -1383,4 +1412,5 @@
            readDbl(line, pos[2], fieldLen, _omega   ) ||
            readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+        _checkState = bad;
         return;
       }
@@ -1390,4 +1420,5 @@
       if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
            readDbl(line, pos[2], fieldLen, TOEw)    ) {
+        _checkState = bad;
         return;
       }
@@ -1399,4 +1430,5 @@
            readDbl(line, pos[2], fieldLen, _TGD1) ||
            readDbl(line, pos[3], fieldLen, _TGD2) ) {
+        _checkState = bad;
         return;
       }
@@ -1408,4 +1440,5 @@
       if ( readDbl(line, pos[0], fieldLen, TOTs) ||
            readDbl(line, pos[1], fieldLen, aodc) ) {
+        _checkState = bad;
         return;
       }
@@ -1428,6 +1461,4 @@
   //         but it seems to be unreliable in RINEX files
   _TOT = _TOC;
-
-  _ok = true;
 }
 
@@ -1435,4 +1466,8 @@
 //////////////////////////////////////////////////////////////////////////////
 t_irc t_ephCompass::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+
+  if (_checkState == bad) {
+    return failure;
+  }
 
   static const double gmCompass    = 398.6004418e12;
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 6517)
+++ /trunk/BNC/src/ephemeris.h	(revision 6518)
@@ -20,4 +20,5 @@
  public:
   enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, Compass};
+  enum e_checkState {unchecked, ok, suspicious, bad};
 
   t_eph();
@@ -28,7 +29,7 @@
   virtual int     IOD() const = 0;
   virtual int     slotNum() const {return 0;}
-  bool    ok() const {return _ok;}
   bncTime TOC() const {return _TOC;}
   bool    isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);}
+  e_checkState checkState() const {return _checkState;}
   t_prn   prn() const {return _prn;}
   t_irc   getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
@@ -42,10 +43,10 @@
  protected:  
   virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const = 0;
-  t_prn      _prn;
-  bncTime    _TOC;
-  QDateTime  _receptDateTime;
-  bool       _ok;
-  t_orbCorr* _orbCorr;
-  t_clkCorr* _clkCorr;
+  t_prn        _prn;
+  bncTime      _TOC;
+  QDateTime    _receptDateTime;
+  e_checkState _checkState;
+  t_orbCorr*   _orbCorr;
+  t_clkCorr*   _clkCorr;
 };
 
Index: /trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 6517)
+++ /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 6518)
@@ -200,5 +200,5 @@
       eph = new t_ephCompass(version(), lines);
     }
-    if (eph && eph->ok()) {
+    if (eph && eph->checkState() != t_eph::bad) {
       _ephs.push_back(eph);
     }
