Index: trunk/BNC/bncapp.cpp
===================================================================
--- trunk/BNC/bncapp.cpp	(revision 646)
+++ trunk/BNC/bncapp.cpp	(revision 647)
@@ -47,4 +47,5 @@
 #include "bncapp.h" 
 #include "bncutils.h" 
+#include "bncrinex.h" 
 
 using namespace std;
@@ -263,69 +264,6 @@
                QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'));
 
-    QString hlpStr;
-    QString intStr = settings.value("ephIntr").toString();
-    if      (intStr == "1 day") {
-      hlpStr = "0";
-    }
-    else if (intStr == "1 hour") {
-      char ch = 'A' + datTim.time().hour();
-      hlpStr = ch;
-    }
-    else if (intStr == "15 min") {
-      char ch = 'A' + datTim.time().hour();
-      hlpStr = ch;
-      if      (datTim.time().minute() < 15) {
-        hlpStr += "00";
-      }
-      else if (datTim.time().minute() < 30) {
-        hlpStr += "15";
-      }
-      else if (datTim.time().minute() < 45) {
-        hlpStr += "30";
-      }
-      else {
-        hlpStr += "45";
-      }
-    }
-    else {
-      char ch = 'A' + datTim.time().hour();
-      hlpStr = ch;
-      if      (datTim.time().minute() <  5) {
-        hlpStr += "00";
-      }
-      else if (datTim.time().minute() < 10) {
-        hlpStr += "05";
-      }
-      else if (datTim.time().minute() < 15) {
-        hlpStr += "10";
-      }
-      else if (datTim.time().minute() < 20) {
-        hlpStr += "15";
-      }
-      else if (datTim.time().minute() < 25) {
-        hlpStr += "20";
-      }
-      else if (datTim.time().minute() < 30) {
-        hlpStr += "25";
-      }
-      else if (datTim.time().minute() < 35) {
-        hlpStr += "30";
-      }
-      else if (datTim.time().minute() < 40) {
-        hlpStr += "35";
-      }
-      else if (datTim.time().minute() < 45) {
-        hlpStr += "40";
-      }
-      else if (datTim.time().minute() < 50) {
-        hlpStr += "45";
-      }
-      else if (datTim.time().minute() < 55) {
-        hlpStr += "50";
-      }
-      else {
-        hlpStr += "55";
-      }
-    }
+    QString hlpStr = bncRinex::nextEpochStr(datTim, 
+                         settings.value("ephIntr").toString());
 
     if (_rinexVers == 3) {
Index: trunk/BNC/bncrinex.cpp
===================================================================
--- trunk/BNC/bncrinex.cpp	(revision 646)
+++ trunk/BNC/bncrinex.cpp	(revision 647)
@@ -236,18 +236,10 @@
 }
 
-// File Name according to RINEX Standards
-////////////////////////////////////////////////////////////////////////////
-void bncRinex::resolveFileName(const QDateTime& datTim) {
-
-  QSettings settings;
-  QString path = settings.value("rnxPath").toString();
-  expandEnvVar(path);
-
-  if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
-    path += QDir::separator();
-  }
-
-  QString intStr = settings.value("rnxIntr").toString();
-  QString hlpStr;
+// Next File Epoch (static)
+////////////////////////////////////////////////////////////////////////////
+QString bncRinex::nextEpochStr(const QDateTime& datTim, 
+                               const QString& intStr, QDateTime* nextEpoch) {
+
+  QString epoStr;
 
   QTime nextTime;
@@ -259,7 +251,7 @@
     int step = intStr.left(indHlp-1).toInt();
     char ch = 'A' + datTim.time().hour();
-    hlpStr = ch;
+    epoStr = ch;
     if (datTim.time().minute() >= 60-step) {
-      hlpStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
+      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
       if (datTim.time().hour() < 23) {
         nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
@@ -274,5 +266,5 @@
       for (int limit = step; limit <= 60-step; limit += step) {
         if (datTim.time().minute() < limit) {
-          hlpStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
+          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
           nextTime.setHMS(datTim.time().hour(), limit, 0);
           nextDate = datTim.date();
@@ -284,5 +276,5 @@
   else if (intStr == "1 hour") {
     char ch = 'A' + datTim.time().hour();
-    hlpStr = ch;
+    epoStr = ch;
     if (datTim.time().hour() < 23) {
       nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
@@ -295,9 +287,30 @@
   }
   else {
-    hlpStr = "0";
+    epoStr = "0";
     nextTime.setHMS(0, 0, 0);
     nextDate = datTim.date().addDays(1);
   }
-  _nextCloseEpoch = QDateTime(nextDate, nextTime);
+
+  if (nextEpoch) {
+   *nextEpoch = QDateTime(nextDate, nextTime);
+  }
+
+  return epoStr;
+}
+
+// File Name according to RINEX Standards
+////////////////////////////////////////////////////////////////////////////
+void bncRinex::resolveFileName(const QDateTime& datTim) {
+
+  QSettings settings;
+  QString path = settings.value("rnxPath").toString();
+  expandEnvVar(path);
+
+  if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
+    path += QDir::separator();
+  }
+
+  QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(), 
+                                &_nextCloseEpoch);
 
   QString ID4 = _statID.left(4);
Index: trunk/BNC/bncrinex.h
===================================================================
--- trunk/BNC/bncrinex.h	(revision 646)
+++ trunk/BNC/bncrinex.h	(revision 647)
@@ -44,4 +44,7 @@
    void dumpEpoch(long maxTime);
    void setReconnectFlag(bool flag){_reconnectFlag = flag;}
+   static QString bncRinex::nextEpochStr(const QDateTime& datTim,
+                                         const QString& intStr, 
+                                         QDateTime* nextEpoch = 0);
 
  private:
Index: trunk/BNC/bncwindow.cpp
===================================================================
--- trunk/BNC/bncwindow.cpp	(revision 646)
+++ trunk/BNC/bncwindow.cpp	(revision 647)
@@ -185,5 +185,5 @@
   _ephIntrComboBox->setMaximumWidth(9*ww);
   _ephIntrComboBox->setEditable(false);
-  _ephIntrComboBox->addItems(QString("5 min,15 min,1 hour,1 day").split(","));
+  _ephIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
   int jj = _ephIntrComboBox->findText(settings.value("ephIntr").toString());
   if (jj != -1) {
