Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 7505)
+++ trunk/BNC/src/bncmain.cpp	(revision 7506)
@@ -203,8 +203,9 @@
       "           PPP/corrFile    <Corrections file>\n"
       "           PPP/crdFile     <Coordinates file>\n"
-      "           PPP/pppPath     <Directory for PPP log file>\n"
       "           PPP/antexFile   <ANTEX file>\n"
+      "           PPP/logPath     <Directory for PPP log file>\n"
       "           PPP/nmeaPath    <Directory for NMEA output file>\n"
       "           PPP/snxtroPath  <Directory for SINEX troposphere output file>\n"
+      "           PPP/v3filenames <Produce version 3 filenames, 0=no, 2=yes>\n"
       "           PPP/snxtroIntr  <SINEX troposphere file interval [character string: 1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day]>\n"
       "           PPP/snxtroSampl <SINEX troposphere file sampling rate [integer number of seconds: 0,30,60,90,120,150,180,210,240,270,300]>\n"
Index: trunk/BNC/src/bncoutf.cpp
===================================================================
--- trunk/BNC/src/bncoutf.cpp	(revision 7505)
+++ trunk/BNC/src/bncoutf.cpp	(revision 7506)
@@ -12,5 +12,5 @@
  * Created:    25-Apr-2008
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -39,6 +39,6 @@
     _path        = fileInfo.absolutePath() + QDir::separator();
     _sklBaseName = fileInfo.baseName();
-    _extension   = fileInfo.completeSuffix(); 
-    
+    _extension   = fileInfo.completeSuffix();
+
     expandEnvVar(_path);
     if (!_extension.isEmpty()) {
@@ -48,4 +48,5 @@
 
   _append = Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked;
+  _v3filenames = settings.value("PPP/v3filenames").toBool();
 }
 
@@ -64,35 +65,71 @@
 // Epoch String
 ////////////////////////////////////////////////////////////////////////////
-QString bncoutf::epochStr(const QDateTime& datTim, const QString& intStr) {
-
-  QString epoStr;
+QString bncoutf::epochStr(const QDateTime& datTim, const QString& intStr,
+    int sampl) {
+
+  QString epoStr = "";
 
   int indHlp = intStr.indexOf("min");
+  if (!sampl) {
+    sampl++;
+  }
 
   if ( indHlp != -1) {
     int step = intStr.left(indHlp-1).toInt();
-    char ch = 'A' + datTim.time().hour();
-    epoStr = QString("_") + ch;
+    if (_v3filenames) {
+      epoStr +=  QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0')); // H
+    } else {
+      epoStr +=  'A' + datTim.time().hour();
+    }
+
     if (datTim.time().minute() >= 60-step) {
-      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
+      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));               // M
     }
     else {
       for (int limit = step; limit <= 60-step; limit += step) {
         if (datTim.time().minute() < limit) {
-          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
+          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));        // M
           break;
         }
       }
     }
+
+    if (_v3filenames) {
+      epoStr += QString("_%1M").arg(step, 2, 10, QChar('0'));                // period
+    }
+
     _numSec = 60 * step;
   }
   else if (intStr == "1 hour") {
-    char ch = 'A' + datTim.time().hour();
-    epoStr = QString("_") + ch;
+    int step = intStr.left(indHlp-1).toInt();
+    if (_v3filenames) {
+      epoStr += QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0'));  // H
+      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                     // M
+      epoStr += QString("_%1H").arg(step+1, 2, 10, QChar('0'));              // period
+    } else {
+      epoStr +=  'A' + datTim.time().hour();
+    }
     _numSec = 3600;
   }
   else {
-    epoStr = "";
+    int step = intStr.left(indHlp-1).toInt();
+    if (_v3filenames) {
+      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // H
+      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // M
+      epoStr += QString("_%1D").arg(step+1, 2, 10, QChar('0'));             // period
+    } else {
+      epoStr = "0";
+    }
     _numSec = 86400;
+  }
+
+  if (_v3filenames) {
+    if (sampl < 60) {
+      epoStr += QString("_%1S").arg(sampl, 2, 10, QChar('0'));
+    }
+    else {
+      sampl /= 60;
+      epoStr += QString("_%1M").arg(sampl, 2, 10, QChar('0'));
+    }
   }
 
@@ -111,12 +148,11 @@
 
   QString yyyy     = QString::number(datTim.date().year());
-  QString doy      = QString("%1%2").arg(dayOfYear,3,10, QLatin1Char('0')).arg(0);
+  QString doy      = QString("%1").arg(dayOfYear,3,10, QLatin1Char('0'));
   QString gpswd    = QString("%1%2").arg(GPSweek).arg(dayOfWeek);
-  QString epoStr   = epochStr(datTim, _intr);
-  QString baseName = _sklBaseName; 
+  QString epoStr   = epochStr(datTim, _intr, _sampl);
+  QString baseName = _sklBaseName;
   baseName.replace("${GPSWD}", gpswd);
-  baseName.replace("${DATE}" , datTim.date().toString(Qt::ISODate));
-  baseName.replace("${DOY}"  , doy);
-  _extension.replace("${YY}" , yyyy.right(2));
+  baseName.replace("${V3}" , QString("_U_%1%2").arg(yyyy).arg(doy));
+
   return _path + baseName + epoStr + _extension;
 }
Index: trunk/BNC/src/bncoutf.h
===================================================================
--- trunk/BNC/src/bncoutf.h	(revision 7505)
+++ trunk/BNC/src/bncoutf.h	(revision 7506)
@@ -23,5 +23,6 @@
 
  private:
-  QString epochStr(const QDateTime& datTim, const QString& intStr);
+  QString epochStr(const QDateTime& datTim, const QString& intStr,
+      int sampl);
   QString resolveFileName(int GPSweek, const QDateTime& datTim);
 
@@ -33,4 +34,5 @@
   QString _fName;
   bool    _append;
+  bool    _v3filenames;
 };
 
Index: trunk/BNC/src/bncwindow.cpp
===================================================================
--- trunk/BNC/src/bncwindow.cpp	(revision 7505)
+++ trunk/BNC/src/bncwindow.cpp	(revision 7506)
@@ -865,5 +865,5 @@
   _pppWidgets._crdFile->setMaximumWidth(35*ww);
   _pppWidgets._antexFile->setMaximumWidth(35*ww);
-  _pppWidgets._snxtroFile->setMaximumWidth(35*ww);
+  _pppWidgets._snxtroPath->setMaximumWidth(35*ww);
   _pppWidgets._snxtroIntr->setMaximumWidth(15*ww);
 
@@ -887,20 +887,23 @@
   pppLayout1->addWidget(new QLabel("Coordinates"),           ir, 0);
   pppLayout1->addWidget(_pppWidgets._crdFile,                ir, 1);
-  pppLayout1->addWidget(new QLabel("   Logfile"),            ir, 3);
-  pppLayout1->addWidget(_pppWidgets._logFile,                ir, 4, 1, 3);
+  pppLayout1->addWidget(new QLabel("   Logfile Directory"),  ir, 3);
+  pppLayout1->addWidget(_pppWidgets._logPath,                ir, 4, 1, 3);
   ++ir;
   pppLayout1->addWidget(new QLabel("ANTEX file"),            ir, 0);
   pppLayout1->addWidget(_pppWidgets._antexFile,              ir, 1);
 
-  pppLayout1->addWidget(new QLabel("   NMEA file"),          ir, 3);
-  pppLayout1->addWidget(_pppWidgets._nmeaFile,               ir, 4, 1, 3);
-
-  ++ir;
-  pppLayout1->addWidget(new QLabel("SNX TRO file"),          ir, 0);
-  pppLayout1->addWidget(_pppWidgets._snxtroFile,             ir, 1);
+  pppLayout1->addWidget(new QLabel("   NMEA Directory"),     ir, 3);
+  pppLayout1->addWidget(_pppWidgets._nmeaPath,               ir, 4, 1, 3);
+
+  ++ir;
+  pppLayout1->addWidget(new QLabel("SNX TRO directory"),     ir, 0);
+  pppLayout1->addWidget(_pppWidgets._snxtroPath,             ir, 1);
   pppLayout1->addWidget(new QLabel("   SNX TRO interval"),   ir, 3);
   pppLayout1->addWidget(_pppWidgets._snxtroIntr,             ir, 4);
   pppLayout1->addWidget(new QLabel("   SNX TRO sampling"),   ir, 5, Qt::AlignRight);
   pppLayout1->addWidget(_pppWidgets._snxtroSampl,            ir, 6, Qt::AlignRight);
+  ++ir;
+  pppLayout1->addWidget(new QLabel("Version 3 filenames"),   ir, 0);
+  pppLayout1->addWidget(_pppWidgets._v3filenames,            ir, 1);
 
   ++ir;
@@ -924,9 +927,9 @@
   _pppWidgets._corrFile->setWhatsThis(tr("<p>Specify the Broadcast Ephemeris Corrections file as saved beforehand using BNC.</p><p>If you don't specify corrections through this option, BNC will fall back to Single Point Positioning (SPP, positioning from RINEX Obs and RINEX Nav files only) instead of doing PPP.</p>"));
 
-  _pppWidgets._logFile->setWhatsThis(tr("<p>Specify the path to daily PPP logfiles using e.g. the following syntax (example):</p><p> ./PPP_${STATION}_${DATE}.log</p><p>BNC will produce one daily PPP logfile per station. Variable ${STATION} stands for the affected station and ${DATE} stands for the date.</p>"));
-
-  _pppWidgets._nmeaFile->setWhatsThis(tr("<p>Specify the path to daily NMEA files using e.g. the following syntax (example):</p><p> ./PPP_${STATION}_${DATE}.nmea</p><p>BNC will produce one daily NMEA file per station, mainly to save NMEA GGA sentences from the PPP solution. Variable ${STATION} stands for the affected station and ${DATE} stands for the date.</p>"));
-
-  _pppWidgets._snxtroFile->setWhatsThis(tr("<p>Specify a path for saving SINEX Troposphere files on disk using e.g. the following syntax (example):</p><p> ./PPP_${STATION}${DOY}.${YY}.zpd</p><p>BNC will produce files per station to save troposphere parameters from the PPP solution in SINEX Troposphere format. Variable ${STATION} stands for the affected station, ${DOY} stands for the Day Of Year, and ${YY} for the year.</p>"));
+  _pppWidgets._logPath->setWhatsThis(tr("<p>Specify the path to daily PPP logfiles using e.g. the following syntax (example):</p><p> ./PPP_${STATION}_${DATE}.log</p><p>BNC will produce one daily PPP logfile per station. Variable ${STATION} stands for the affected station and ${DATE} stands for the date.</p>"));
+
+  _pppWidgets._nmeaPath->setWhatsThis(tr("<p>Specify the path to daily NMEA files using e.g. the following syntax (example):</p><p> ./PPP_${STATION}_${DATE}.nmea</p><p>BNC will produce one daily NMEA file per station, mainly to save NMEA GGA sentences from the PPP solution. Variable ${STATION} stands for the affected station and ${DATE} stands for the date.</p>"));
+
+  _pppWidgets._snxtroPath->setWhatsThis(tr("<p>Specify a path for saving SINEX Troposphere files on disk using e.g. the following syntax (example):</p><p> ./PPP_${STATION}${DOY}.${YY}.zpd</p><p>BNC will produce files per station to save troposphere parameters from the PPP solution in SINEX Troposphere format. Variable ${STATION} stands for the affected station, ${DOY} stands for the Day Of Year, and ${YY} for the year.</p>"));
 
   _pppWidgets._snxtroSampl->setWhatsThis(tr("<p>Select a 'Sampling' rate for saving troposphere paramers.</p><p>Default 'Sampling' rate is '0', meaning that all troposphere estimates will be saved on disk.</p>"));
Index: trunk/BNC/src/pppRun.cpp
===================================================================
--- trunk/BNC/src/pppRun.cpp	(revision 7505)
+++ trunk/BNC/src/pppRun.cpp	(revision 7506)
@@ -137,47 +137,67 @@
   _stopFlag = false;
 
-  QString roverName(_opt->_roverName.c_str());
-
-  QString logFileSkl = settings.value("PPP/logFilePPP").toString();
+  QString roverName(_opt->_roverName.c_str()), fullRoverName("");
+  QString country;
+  QString monNum = "0";
+  QString recNum = "0";
+  QString intr = "1 day";
+  int     sampl  = 0;
+  QListIterator<QString> it(settings.value("mountPoints").toStringList());
+  while (it.hasNext()) {
+    QStringList hlp = it.next().split(" ");
+    if (hlp.size() < 7)
+      continue;
+    if (hlp.join(" ").indexOf(roverName, 0) != -1) {
+      country = hlp[2];
+    }
+  }
+  fullRoverName = roverName.left(4) +
+                  QString("%1").arg(monNum, 1, 10) +
+                  QString("%1").arg(recNum, 1, 10) +
+                  country;
+
+  bool v3filenames = settings.value("PPP/v3filenames").toBool();
+  QString logFileSkl = settings.value("PPP/logPath").toString();
   if (logFileSkl.isEmpty()) {
     _logFile = 0;
   }
   else {
-    if (logFileSkl.indexOf("${STATION}") == -1) {
-      logFileSkl = logFileSkl + "_" + roverName;
+    if (v3filenames) {
+      logFileSkl = logFileSkl + fullRoverName + "${V3}" + ".ppp";
     }
     else {
-      logFileSkl.replace("${STATION}", roverName);
-    }
-    _logFile = new bncoutf(logFileSkl, "1 day", 0);
-  }
-
-  QString nmeaFileSkl = settings.value("PPP/nmeaFile").toString();
+      logFileSkl = logFileSkl + roverName.left(4) + "${GPSWD}" + ".ppp";
+    }
+    _logFile = new bncoutf(logFileSkl, intr, sampl);
+  }
+
+  QString nmeaFileSkl = settings.value("PPP/nmeaPath").toString();
   if (nmeaFileSkl.isEmpty()) {
     _nmeaFile = 0;
   }
   else {
-    if (nmeaFileSkl.indexOf("${STATION}") == -1) {
-      nmeaFileSkl = roverName + "_" + nmeaFileSkl;
+    if (v3filenames) {
+      nmeaFileSkl = nmeaFileSkl + fullRoverName + "${V3}" + ".nmea";
     }
     else {
-      nmeaFileSkl.replace("${STATION}", roverName);
-    }
-    _nmeaFile = new bncoutf(nmeaFileSkl, "1 day", 0);
-  }
-
-  QString snxtroFileSkl = settings.value("PPP/snxtroFile").toString();
+      nmeaFileSkl = nmeaFileSkl + roverName.left(4) + "${GPSWD}" + ".nmea";
+    }
+    _nmeaFile = new bncoutf(nmeaFileSkl, intr, sampl);
+  }
+
+  QString snxtroFileSkl = settings.value("PPP/snxtroPath").toString();
   if (snxtroFileSkl.isEmpty()) {
     _snxtroFile = 0;
   }
   else {
-    if (snxtroFileSkl.indexOf("${STATION}") == -1) {
-      snxtroFileSkl = snxtroFileSkl + "_" + roverName;
+    if (v3filenames) {
+      snxtroFileSkl = snxtroFileSkl + fullRoverName + "${V3}" + ".tra";
     }
     else {
-      snxtroFileSkl.replace("${STATION}", roverName.left(4));
-    }
-    int samplSnxTro = settings.value("PPP/snxtroSampl").toInt();
-    _snxtroFile = new bncSinexTro(_opt, snxtroFileSkl, "1 day", samplSnxTro);
+      snxtroFileSkl = snxtroFileSkl + roverName.left(4) + "${GPSWD}" + ".tro";
+    }
+    sampl = settings.value("PPP/snxtroSampl").toInt();
+    intr  = settings.value("PPP/snxtroIntr").toString();
+    _snxtroFile = new bncSinexTro(_opt, snxtroFileSkl, intr, sampl);
   }
 }
Index: trunk/BNC/src/pppWidgets.cpp
===================================================================
--- trunk/BNC/src/pppWidgets.cpp	(revision 7505)
+++ trunk/BNC/src/pppWidgets.cpp	(revision 7506)
@@ -59,9 +59,10 @@
   _crdFile      = new qtFileChooser(); _crdFile     ->setObjectName("PPP/crdFile");      _widgets << _crdFile;
   _antexFile    = new qtFileChooser(); _antexFile   ->setObjectName("PPP/antexFile");    _widgets << _antexFile;
-  _logFile      = new QLineEdit();     _logFile     ->setObjectName("PPP/logFilePPP");   _widgets << _logFile;
-  _nmeaFile     = new QLineEdit();     _nmeaFile    ->setObjectName("PPP/nmeaFile");     _widgets << _nmeaFile;
-  _snxtroFile   = new QLineEdit();     _snxtroFile  ->setObjectName("PPP/snxtroFile");   _widgets << _snxtroFile;
+  _logPath      = new QLineEdit();     _logPath     ->setObjectName("PPP/logPath");      _widgets << _logPath;
+  _nmeaPath     = new QLineEdit();     _nmeaPath    ->setObjectName("PPP/nmeaPath");     _widgets << _nmeaPath;
+  _snxtroPath   = new QLineEdit();     _snxtroPath  ->setObjectName("PPP/snxtroPath");   _widgets << _snxtroPath;
   _snxtroSampl  = new QSpinBox();      _snxtroSampl ->setObjectName("PPP/snxtroSampl");  _widgets << _snxtroSampl;
   _snxtroIntr   = new QComboBox();     _snxtroIntr  ->setObjectName("PPP/snxtroIntr");   _widgets << _snxtroIntr;
+  _v3filenames  = new QCheckBox();     _v3filenames ->setObjectName("PPP/v3filenames");  _widgets << _v3filenames;
   _staTable     = new QTableWidget();  _staTable    ->setObjectName("PPP/staTable");     _widgets << _staTable;
   _lcGPS        = new QComboBox();     _lcGPS       ->setObjectName("PPP/lcGPS");        _widgets << _lcGPS;
@@ -99,5 +100,5 @@
   connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
 
-  connect(_snxtroFile, SIGNAL(textChanged(const QString &)),
+  connect(_snxtroPath, SIGNAL(textChanged(const QString &)),
          this, SLOT(slotPPPTextChanged()));
 
@@ -248,7 +249,7 @@
   // ---------
   _corrMount  ->setText(settings.value(_corrMount  ->objectName()).toString());
-  _logFile    ->setText(settings.value(_logFile    ->objectName()).toString());
-  _nmeaFile   ->setText(settings.value(_nmeaFile   ->objectName()).toString());
-  _snxtroFile ->setText(settings.value(_snxtroFile ->objectName()).toString());
+  _logPath    ->setText(settings.value(_logPath    ->objectName()).toString());
+  _nmeaPath   ->setText(settings.value(_nmeaPath   ->objectName()).toString());
+  _snxtroPath ->setText(settings.value(_snxtroPath ->objectName()).toString());
 
   if (!settings.value(_sigmaC1->objectName()).toString().isEmpty()) {
@@ -291,4 +292,5 @@
   _eleWgtCode ->setCheckState(Qt::CheckState(settings.value(_eleWgtCode ->objectName()).toInt()));
   _eleWgtPhase->setCheckState(Qt::CheckState(settings.value(_eleWgtPhase->objectName()).toInt()));
+  _v3filenames->setCheckState(Qt::CheckState(settings.value(_v3filenames->objectName()).toInt()));
 
   // SpinBoxex
@@ -346,8 +348,9 @@
   settings.setValue(_crdFile     ->objectName(), _crdFile     ->fileName());
   settings.setValue(_antexFile   ->objectName(), _antexFile   ->fileName());
-  settings.setValue(_logFile     ->objectName(), _logFile     ->text());
-  settings.setValue(_nmeaFile    ->objectName(), _nmeaFile    ->text());
-  settings.setValue(_snxtroFile  ->objectName(), _snxtroFile  ->text());
+  settings.setValue(_logPath     ->objectName(), _logPath     ->text());
+  settings.setValue(_nmeaPath    ->objectName(), _nmeaPath    ->text());
+  settings.setValue(_snxtroPath  ->objectName(), _snxtroPath  ->text());
   settings.setValue(_snxtroSampl ->objectName(), _snxtroSampl ->value());
+  settings.setValue(_v3filenames ->objectName(), _v3filenames ->checkState());
   settings.setValue(_snxtroIntr  ->objectName(), _snxtroIntr  ->currentText());
   settings.setValue(_lcGPS       ->objectName(), _lcGPS       ->currentText());
@@ -417,5 +420,5 @@
   }
 
-  if ( _snxtroFile->text() != "" && !allDisabled) {
+  if ( _snxtroPath->text() != "" && !allDisabled) {
     _snxtroSampl->setEnabled(true);
     _snxtroIntr ->setEnabled(true);
@@ -488,6 +491,6 @@
   // SNX TRO file sampling
   // ---------------------
-  if (sender() == 0 || sender() == _snxtroFile) {
-    if ( _snxtroFile->text() != "" ) {
+  if (sender() == 0 || sender() == _snxtroPath) {
+    if ( _snxtroPath->text() != "" ) {
       _snxtroSampl->setEnabled(true);
       _snxtroIntr->setEnabled(true);
Index: trunk/BNC/src/pppWidgets.h
===================================================================
--- trunk/BNC/src/pppWidgets.h	(revision 7505)
+++ trunk/BNC/src/pppWidgets.h	(revision 7506)
@@ -44,9 +44,10 @@
   qtFileChooser* _crdFile;
   qtFileChooser* _antexFile;
-  QLineEdit*     _logFile;
-  QLineEdit*     _nmeaFile;
-  QLineEdit*     _snxtroFile;
+  QLineEdit*     _logPath;
+  QLineEdit*     _nmeaPath;
+  QLineEdit*     _snxtroPath;
   QSpinBox*      _snxtroSampl;
   QComboBox*     _snxtroIntr;
+  QCheckBox*     _v3filenames;
   QTableWidget*  _staTable;
   QComboBox*     _lcGPS;
