Index: /trunk/BNC/bncapp.cpp
===================================================================
--- /trunk/BNC/bncapp.cpp	(revision 534)
+++ /trunk/BNC/bncapp.cpp	(revision 535)
@@ -147,5 +147,5 @@
 }
 
-// 
+// New GPS Ephemeris 
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::slotNewGPSEph(gpsephemeris* gpseph) {
@@ -171,5 +171,5 @@
 }
     
-// 
+// New Glonass Ephemeris
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::slotNewGlonassEph(glonassephemeris* glonasseph) {
@@ -197,12 +197,13 @@
 }
 
-// 
+// Print Header of the output File(s)
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printEphHeader() {
+
+  QSettings settings;
 
   // Initialization
   // --------------
   if (_rinexVers == 0) {
-    QSettings settings;
 
     if ( Qt::CheckState(settings.value("ephV3").toInt()) == Qt::Checked) {
@@ -229,5 +230,6 @@
     QDate date = QDate::currentDate();
 
-    QString ephFileNameGPS = _ephPath + "GPS_" +
+    QString hlp = (_rinexVers == 3) ? "MIX_" : "GPS_";
+    QString ephFileNameGPS = _ephPath + hlp +
           QString("%1").arg(date.dayOfYear(), 3, 10, QChar('0')) +
                             date.toString("0.yyN");
@@ -243,6 +245,12 @@
     delete _ephFileGPS;
 
+    QFlags<QIODevice::OpenModeFlag> appendFlagGPS;
+    if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
+         QFile::exists(ephFileNameGPS) ) {
+      appendFlagGPS = QIODevice::Append;
+    }
+
     _ephFileGPS = new QFile(ephFileNameGPS);
-    _ephFileGPS->open(QIODevice::WriteOnly);
+    _ephFileGPS->open(QIODevice::WriteOnly | appendFlagGPS);
     _ephStreamGPS = new QTextStream();
     _ephStreamGPS->setDevice(_ephFileGPS);
@@ -260,6 +268,12 @@
       delete _ephFileGlonass;
 
+      QFlags<QIODevice::OpenModeFlag> appendFlagGlonass;
+      if ( Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked &&
+           QFile::exists(ephFileNameGlonass) ) {
+        appendFlagGlonass = QIODevice::Append;
+      }
+
       _ephFileGlonass = new QFile(ephFileNameGlonass);
-      _ephFileGlonass->open(QIODevice::WriteOnly);
+      _ephFileGlonass->open(QIODevice::WriteOnly | appendFlagGlonass);
       _ephStreamGlonass = new QTextStream();
       _ephStreamGlonass->setDevice(_ephFileGlonass);
@@ -269,4 +283,9 @@
     // ------------------------
     if (_rinexVers == 3) {
+
+      if (appendFlagGPS & QIODevice::Append) {
+        return;
+      }
+
       QString line;
 
@@ -292,5 +311,5 @@
 }
 
-// 
+// Print One GPS Ephemeris
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printGPSEph(gpsephemeris* ep) {
@@ -358,5 +377,5 @@
 }
 
-// 
+// Print One Glonass Ephemeris
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printGlonassEph(glonassephemeris* ep) {
