Index: /trunk/BNC/src/bnccore.cpp
===================================================================
--- /trunk/BNC/src/bnccore.cpp	(revision 6518)
+++ /trunk/BNC/src/bnccore.cpp	(revision 6519)
@@ -207,17 +207,15 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGPSEph(t_ephGPS eph) {
-
-  QMutexLocker locker(&_mutex);
+  QMutexLocker locker(&_mutex);
+
+  t_irc irc = _ephUser.putNewEph(&eph, true);
+  if (eph.checkState() == t_eph::bad) {
+    return;
+  }
 
   emit newGPSEph(eph);
 
   printEphHeader();
-
-  if (_ephUser.putNewEph(&eph, true) == success) {
-    printEph(eph, true);
-  }
-  else {
-    printEph(eph, false);
-  }
+  printEph(eph, (irc == success));
 }
     
@@ -225,17 +223,15 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGlonassEph(t_ephGlo eph) {
-
-  QMutexLocker locker(&_mutex);
+  QMutexLocker locker(&_mutex);
+
+  t_irc irc = _ephUser.putNewEph(&eph, true);
+  if (eph.checkState() == t_eph::bad) {
+    return;
+  }
 
   emit newGlonassEph(eph);
 
   printEphHeader();
-
-  if (_ephUser.putNewEph(&eph, true) == success) {
-    printEph(eph, true);
-  }
-  else {
-    printEph(eph, false);
-  }
+  printEph(eph, (irc == success));
 }
 
@@ -243,17 +239,15 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewGalileoEph(t_ephGal eph) {
-
-  QMutexLocker locker(&_mutex);
+  QMutexLocker locker(&_mutex);
+
+  t_irc irc = _ephUser.putNewEph(&eph, true);
+  if (eph.checkState() == t_eph::bad) {
+    return;
+  }
 
   emit newGalileoEph(eph);
 
   printEphHeader();
-
-  if (_ephUser.putNewEph(&eph, true) == success) {
-    printEph(eph, true);
-  }
-  else {
-    printEph(eph, false);
-  }
+  printEph(eph, (irc == success));
 }
 
@@ -261,17 +255,15 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_bncCore::slotNewSBASEph(t_ephSBAS eph) {
-
-  QMutexLocker locker(&_mutex);
+  QMutexLocker locker(&_mutex);
+
+  t_irc irc = _ephUser.putNewEph(&eph, true);
+  if (eph.checkState() == t_eph::bad) {
+    return;
+  }
 
   emit newSBASEph(eph);
 
   printEphHeader();
-
-  if (_ephUser.putNewEph(&eph, true) == success) {
-    printEph(eph, true);
-  }
-  else {
-    printEph(eph, false);
-  }
+  printEph(eph, (irc == success));
 }
 
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 6518)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 6519)
@@ -103,5 +103,5 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-t_irc bncEphUser::putNewEph(const t_eph* eph, bool check) {
+t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {
 
   QMutexLocker locker(&_mutex);
@@ -163,5 +163,25 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncEphUser::checkEphemeris(const t_eph* eph) {
+void bncEphUser::checkEphemeris(t_eph* eph) {
 
+  if (!eph || eph->checkState() == t_eph::ok || eph->checkState() == t_eph::bad) {
+    return;
+  }
+
+  // Simple Check - check satellite radial distance
+  // ----------------------------------------------
+  ColumnVector xc(4);
+  ColumnVector vv(3);
+
+  if (eph->getCrd(eph->TOC(), xc, vv, false) != success) {
+    eph->setCheckState(t_eph::bad);
+    return;
+  }
+
+  double rr = xc.Rows(1,3).norm_Frobenius();
+
+  if (rr < 2.e7 || rr > 4.e7) {
+    eph->setCheckState(t_eph::bad);
+    return;
+  }
 }
Index: /trunk/BNC/src/bncephuser.h
===================================================================
--- /trunk/BNC/src/bncephuser.h	(revision 6518)
+++ /trunk/BNC/src/bncephuser.h	(revision 6519)
@@ -47,5 +47,5 @@
   virtual ~bncEphUser();
 
-  t_irc putNewEph(const t_eph* newEph, bool check);
+  t_irc putNewEph(t_eph* newEph, bool check);
 
   t_eph* ephLast(const QString& prn) {
@@ -72,5 +72,5 @@
 
  private:
-  void checkEphemeris(const t_eph* eph);
+  void checkEphemeris(t_eph* eph);
   QMutex                             _mutex;
   static const unsigned              _maxQueueSize = 5;
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 6518)
+++ /trunk/BNC/src/ephemeris.h	(revision 6519)
@@ -32,4 +32,5 @@
   bool    isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);}
   e_checkState checkState() const {return _checkState;}
+  void    setCheckState(e_checkState checkState) {_checkState = checkState;}
   t_prn   prn() const {return _prn;}
   t_irc   getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
