Index: trunk/BNC/rinex/rnxnavfile.cpp
===================================================================
--- trunk/BNC/rinex/rnxnavfile.cpp	(revision 3757)
+++ trunk/BNC/rinex/rnxnavfile.cpp	(revision 3758)
@@ -101,8 +101,6 @@
 ////////////////////////////////////////////////////////////////////////////
 t_rnxNavFile::~t_rnxNavFile() {
-  while (!_ephs.empty()) {
-    t_eph* eph = _ephs.front();
-    _ephs.pop();
-    delete eph;
+  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
+    delete _ephs[ii];
   }
 }
@@ -151,5 +149,5 @@
     }
     if (eph && eph->ok()) {
-      _ephs.push(eph);
+      _ephs.push_back(eph);
     }
     else {
@@ -163,16 +161,36 @@
 t_eph* t_rnxNavFile::getNextEph(const bncTime& tt, 
                                 const QMap<QString, int>* corrIODs) {
-  while (!_ephs.empty()) {
-    t_eph* eph = _ephs.front();
-    bncTime ephTime(eph->GPSweek(), eph->GPSweeks());
-    double dt = ephTime - tt;
-    if (dt < 2*3600.0) {
-      _ephs.pop();
-      return eph;
-    }
-    else {
-      return 0;
+
+  if (corrIODs) {
+    QMapIterator<QString, int> itIOD(*corrIODs);
+    while (itIOD.hasNext()) {
+      itIOD.next();
+      QString prn = itIOD.key();
+      int     iod = itIOD.value();
+      vector<t_eph*>::iterator it = _ephs.begin();
+      while (it != _ephs.end()) {
+        t_eph* eph = *it;
+        if (eph->prn() == prn && eph->IOD() == iod) {
+          it = _ephs.erase(it);
+          return eph;
+        }
+        ++it;
+      }
     }
   }
+
+//  while (!_ephs.empty()) {
+//    t_eph* eph = _ephs.front();
+//    bncTime ephTime(eph->GPSweek(), eph->GPSweeks());
+//    double dt = ephTime - tt;
+//    if (dt < 2*3600.0) {
+//      _ephs.pop();
+//      return eph;
+//    }
+//    else {
+//      return 0;
+//    }
+//  }
+
   return 0;
 }
Index: trunk/BNC/rinex/rnxnavfile.h
===================================================================
--- trunk/BNC/rinex/rnxnavfile.h	(revision 3757)
+++ trunk/BNC/rinex/rnxnavfile.h	(revision 3758)
@@ -57,7 +57,8 @@
 
  private:
-  void               read(QTextStream* stream);
-  std::queue<t_eph*> _ephs;
-  t_rnxNavHeader     _header;
+  void read(QTextStream* stream);
+
+  std::vector<t_eph*> _ephs;
+  t_rnxNavHeader      _header;
 };
 
