Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 10613)
+++ trunk/BNC/src/ephemeris.cpp	(revision 10614)
@@ -266,7 +266,7 @@
 //////////////////////////////////////////////////////////////////////////////
 t_ephGPS::t_ephGPS(double rnxVersion, const QStringList &lines, QString typeStr) {
-  
+
   setType(typeStr);
-  
+
   int nLines = 8; // LNAV
   // Source RINEX version < 4
@@ -1057,5 +1057,7 @@
   // Source RINEX version < 4
   if (type() == t_eph::undefined) {
-    _type = t_eph::FDMA;
+    // cannot be determined from input data 
+    // but is set to be able to work with old RINEX files in BNC applications
+    _type = t_eph::FDMA_M;
   }
 
@@ -1065,4 +1067,6 @@
     _M_delta_tau = 0.9999e9; // unknown
     _M_FT        = 1.5e1;    // unknown
+    _statusflags_unknown = true;
+    _healthflags_unknown = true;
   }
 
@@ -1150,5 +1154,6 @@
     // =====================
     else if (iLine == 2) {
-      if (type() == t_eph::FDMA) {
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::FDMA_M) {
         if (   readDbl(line, pos[0], fieldLen, _y_pos)
             || readDbl(line, pos[1], fieldLen, _y_vel)
@@ -1174,5 +1179,6 @@
     // =====================
     else if (iLine == 3) {
-      if (type() == t_eph::FDMA) {
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::FDMA_M) {
         if (   readDbl(line, pos[0], fieldLen, _z_pos)
             || readDbl(line, pos[1], fieldLen, _z_vel)
@@ -1206,5 +1212,6 @@
     // =====================
     else if (iLine == 4) {
-      if (type() == t_eph::FDMA) {
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::FDMA_M) {
         if (readDbl(line, pos[0], fieldLen, statusflags)) {
           //status flags BLK, do nothing
@@ -1239,4 +1246,5 @@
             _M_tau_GPS   = 0.0;
             _M_delta_tau = 0.0;
+            _type = t_eph::FDMA;
           }
           else {
Index: trunk/BNC/src/ephemeris.h
===================================================================
--- trunk/BNC/src/ephemeris.h	(revision 10613)
+++ trunk/BNC/src/ephemeris.h	(revision 10614)
@@ -276,6 +276,6 @@
     _angular_rate_max = 0.0;
     _data_validity = 0;
-    _healthflags_unknown = false;
-    _statusflags_unknown = false;
+    _healthflags_unknown = true;
+    _statusflags_unknown = true;
     _almanac_health = 0.0;
     _almanac_health_availablility_indicator = 0.0;
Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10613)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10614)
@@ -75,4 +75,6 @@
   analyzePlotSignals();
 
+  _checkEph = true;
+
   qRegisterMetaType< QVector<t_skyPlotData> >("QVector<t_skyPlotData>");
 
@@ -121,8 +123,4 @@
   }
 
-  // Check Ephemerides
-  // -----------------
-  checkEphemerides();
-
   // Initialize RINEX Observation Files
   // ----------------------------------
@@ -131,5 +129,5 @@
   // Read Ephemerides
   // ----------------
-  t_reqcEdit::readEphemerides(_navFileNames, _ephs);
+  t_reqcEdit::readEphemerides(_navFileNames, _ephs, _log, _checkEph);
 
   // Loop over all RINEX Files
@@ -968,68 +966,6 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void t_reqcAnalyze::checkEphemerides() {
-
-  QString navFileName;
-  QStringListIterator namIt(_navFileNames);
-  bool firstName = true;
-  while (namIt.hasNext()) {
-    QFileInfo navFi(namIt.next());
-    if (firstName) {
-      firstName = false;
-      navFileName += navFi.fileName();
-    }
-    else {
-      navFileName += ", " + navFi.fileName();
-    }
-  }
-  if (_log) {
-    *_log << "Navigation File(s) : " << navFileName  << Qt::endl;
-  }
-  QStringListIterator it(_navFileNames);
-  while (it.hasNext()) {
-    const QString& fileName = it.next();
-    unsigned numOK  = 0;
-    unsigned numBad = 0;
-    unsigned numUnhealthy = 0;
-    bncEphUser ephUser(false);
-    t_rnxNavFile rnxNavFile(fileName, t_rnxNavFile::input);
-    for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
-      t_eph* eph = rnxNavFile.ephs()[ii];
-      ephUser.putNewEph(eph, false);
-      if      (eph->checkState() == t_eph::bad) {
-        ++numBad;
-      }
-      else if (eph->checkState() == t_eph::unhealthy) {
-        ++numUnhealthy;
-      }
-      else {
-        ++numOK;
-      }
-    }
-    if (_log) {
-      *_log << "Ephemeris          : " << numOK        << " OK   "
-                                       << numUnhealthy << " UNHEALTHY   "
-                                       << numBad       << " WRONG\n";
-      if (numBad > 0) {
-        for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
-          t_eph* eph = rnxNavFile.ephs()[ii];
-          QFileInfo navFi(fileName);
-          if (eph->checkState() == t_eph::bad) {
-            *_log  << "                     "
-                << navFi.fileName() << ' ' << QString(": WRONG %2:%3\n")
-                           .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
-                           .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1();
-          }
-        }
-      }
-      *_log << Qt::endl;
-    }
-  }
-}
-
 void t_reqcAnalyze::setExpectedObs(const bncTime& startTime, const bncTime& endTime,
                                    double interval, const ColumnVector& xyzSta) {
-
-
   for(QMap<t_prn, int>::iterator it = _numExpObs.begin(); it != _numExpObs.end(); it++) {
     t_eph* eph = 0;
Index: trunk/BNC/src/rinex/reqcanalyze.h
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.h	(revision 10613)
+++ trunk/BNC/src/rinex/reqcanalyze.h	(revision 10614)
@@ -179,5 +179,4 @@
 
  private:
-  void   checkEphemerides();
 
   void   analyzePlotSignals();
@@ -202,8 +201,9 @@
 
   static bool mpLessThan(const t_polarPoint* p1, const t_polarPoint* p2);
-    
+
   QString                    _logFileName;
   QFile*                     _logFile;
   QTextStream*               _log;
+  bool                       _checkEph;
   QStringList                _obsFileNames;
   QVector<t_rnxObsFile*>     _rnxObsFiles;
Index: trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcedit.cpp	(revision 10613)
+++ trunk/BNC/src/rinex/reqcedit.cpp	(revision 10614)
@@ -75,4 +75,6 @@
   _begTime        = bncTime(settings.value("reqcStartDateTime").toString().toLatin1().data());
   _endTime        = bncTime(settings.value("reqcEndDateTime").toString().toLatin1().data());
+
+  _checkEph = false;
 
 }
@@ -171,5 +173,6 @@
   while (it.hasNext()) {
     QString fileName = it.next();
-    if (fileName.indexOf('*') != -1 || fileName.indexOf('?') != -1) {
+    if (fileName.indexOf('*') != -1 ||
+        fileName.indexOf('?') != -1) {
       QFileInfo fileInfo(fileName);
       QDir dir = fileInfo.dir();
@@ -316,5 +319,5 @@
     t_rnxObsFile* obsFile = _rnxObsFiles[ii];
     if (_log) {
-      *_log << "Processing File: " << obsFile->fileName() << "  start: "
+      *_log << "Input Obs File: " << obsFile->fileName() << "  start: "
             << obsFile->startTime().datestr().c_str() << ' '
             << obsFile->startTime().timestr(0).c_str() << Qt::endl;
@@ -520,10 +523,12 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_reqcEdit::readEphemerides(const QStringList& navFileNames,
-                                 QVector<t_eph*>& ephs) {
+                                 QVector<t_eph*>& ephs, QTextStream* log,
+                                 bool checkEph) {
 
   QStringListIterator it(navFileNames);
   while (it.hasNext()) {
     QString fileName = it.next();
-    if (fileName.indexOf('*') != -1 || fileName.indexOf('?') != -1) {
+    if (fileName.indexOf('*') != -1 ||
+        fileName.indexOf('?') != -1) {
       QFileInfo fileInfo(fileName);
       QDir dir = fileInfo.dir();
@@ -532,9 +537,9 @@
       while (it.hasNext()) {
         QString filePath = it.next().filePath();
-        appendEphemerides(filePath, ephs);
+        appendEphemerides(filePath, ephs, log, checkEph);
       }
     }
     else {
-      appendEphemerides(fileName, ephs);
+      appendEphemerides(fileName, ephs, log, checkEph);
     }
   }
@@ -565,4 +570,5 @@
   while (it.hasNext()) {
     QString fileName = it.next();
+
     t_rnxNavFile rnxNavFile(fileName, t_rnxNavFile::input);
     QStringListIterator itCmnt(rnxNavFile.comments());
@@ -580,5 +586,5 @@
   // Read Ephemerides
   // ----------------
-  t_reqcEdit::readEphemerides(_navFileNames, _ephs);
+  t_reqcEdit::readEphemerides(_navFileNames, _ephs, _log, _checkEph);
 
   // Check Satellite Systems
@@ -709,6 +715,20 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_reqcEdit::appendEphemerides(const QString& fileName,
-                                   QVector<t_eph*>& ephs) {
+                                   QVector<t_eph*>& ephs, QTextStream* log,
+                                   bool checkEph) {
   t_rnxNavFile rnxNavFile(fileName, t_rnxNavFile::input);
+  unsigned numOK  = 0;
+  unsigned numBad = 0;
+  unsigned numUnhealthy = 0;
+  bncEphUser ephUser(false);
+
+  if (log) {
+    QFileInfo navFi(rnxNavFile.fileName());
+      *log << "Input Nav File     : " << navFi.fileName()      << Qt::endl;
+    if (checkEph) {
+      *log << "RINEX Version      : " << rnxNavFile.version()  << Qt::endl;
+    }
+  }
+
   for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
     t_eph* eph   = rnxNavFile.ephs()[ii];
@@ -724,34 +744,64 @@
 
     if (isNew) {
-      if      (eph->system() == t_eph::GPS &&
-               eph->type()   == t_eph::LNAV) {
+
+      if (checkEph) {
+        ephUser.putNewEph(eph, false);
+        if      (eph->checkState() == t_eph::bad) {
+          ++numBad;
+        }
+        else if (eph->checkState() == t_eph::unhealthy) {
+          ++numUnhealthy;
+        }
+        else {
+          ++numOK;
+        }
+        if (eph->checkState() == t_eph::bad) {
+          continue;
+        }
+      }
+
+      if      (eph->system() == t_eph::GPS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
-      else if (eph->system() == t_eph::GLONASS &&
-               eph->type()   == t_eph::FDMA_M) {
+      else if (eph->system() == t_eph::GLONASS) {
         ephs.append(new t_ephGlo(*dynamic_cast<t_ephGlo*>(eph)));
       }
-      else if (eph->system() == t_eph::Galileo &&
-               eph->type()   ==  t_eph::INAV) {
+      else if (eph->system() == t_eph::Galileo) {
         ephs.append(new t_ephGal(*dynamic_cast<t_ephGal*>(eph)));
       }
-      else if (eph->system() == t_eph::QZSS &&
-               eph->type()   == t_eph::LNAV) {
+      else if (eph->system() == t_eph::QZSS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
-      else if (eph->system() == t_eph::SBAS &&
-               eph->type()   == t_eph::SBASL1) {
+      else if (eph->system() == t_eph::SBAS) {
         ephs.append(new t_ephSBAS(*dynamic_cast<t_ephSBAS*>(eph)));
       }
-      else if (eph->system() == t_eph::BDS &&
-               (eph->type()  == t_eph::D1 ||
-                eph->type()  == t_eph::D2)) {
+      else if (eph->system() == t_eph::BDS) {
         ephs.append(new t_ephBDS(*dynamic_cast<t_ephBDS*>(eph)));
       }
-      else if (eph->system() == t_eph::IRNSS &&
-               eph->type()   == t_eph::LNAV) {
+      else if (eph->system() == t_eph::IRNSS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
     }
+  }
+
+  if (log && checkEph) {
+    *log << "Ephemeris Check    : " << numOK        << " OK   "
+                                    << numUnhealthy << " UNHEALTHY   "
+                                    << numBad       << " WRONG\n";
+    if (numBad > 0) {
+      for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
+        t_eph* eph = rnxNavFile.ephs()[ii];
+        QFileInfo navFi(fileName);
+        if (eph->checkState() == t_eph::bad) {
+          if (log) {
+            *log << "                   : "
+                 << QString("WRONG %2:%3\n")
+                         .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
+                         .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1();
+          }
+        }
+      }
+    }
+    *log << Qt::endl;
   }
 }
Index: trunk/BNC/src/rinex/reqcedit.h
===================================================================
--- trunk/BNC/src/rinex/reqcedit.h	(revision 10613)
+++ trunk/BNC/src/rinex/reqcedit.h	(revision 10614)
@@ -51,6 +51,9 @@
                               QTextStream* log);
   static void readEphemerides(const QStringList& navFileNames,
-                              QVector<t_eph*>& ephs);
-  static void appendEphemerides(const QString& fileName, QVector<t_eph*>& ephs);
+                              QVector<t_eph*>& ephs, QTextStream* log, 
+                              bool checkEph);
+  static void appendEphemerides(const QString& fileName, 
+                                QVector<t_eph*>& ephs,
+                                QTextStream* log, bool checkEph);
 
  private:
@@ -65,4 +68,5 @@
   QFile*                 _logFile;
   QTextStream*           _log;
+  bool                   _checkEph;
   QStringList            _obsFileNames;
   QVector<t_rnxObsFile*> _rnxObsFiles;
Index: trunk/BNC/src/rinex/rnxnavfile.h
===================================================================
--- trunk/BNC/src/rinex/rnxnavfile.h	(revision 10613)
+++ trunk/BNC/src/rinex/rnxnavfile.h	(revision 10614)
@@ -62,4 +62,5 @@
   t_eph* getNextEph(const bncTime& tt, const QMap<QString, unsigned int>* corrIODs);
   const std::vector<t_eph*> ephs() const {return _ephs;}
+  const QString& fileName() const {return _fileName;}
   double version() const {return _header._version;}
   void   setVersion(double version) {_header._version = version;}
