Changeset 7506 in ntrip


Ignore:
Timestamp:
Oct 13, 2015, 3:19:43 PM (9 years ago)
Author:
stuerze
Message:

automatic file name generation for ppp output files is added

Location:
trunk/BNC/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmain.cpp

    r7504 r7506  
    203203      "           PPP/corrFile    <Corrections file>\n"
    204204      "           PPP/crdFile     <Coordinates file>\n"
    205       "           PPP/pppPath     <Directory for PPP log file>\n"
    206205      "           PPP/antexFile   <ANTEX file>\n"
     206      "           PPP/logPath     <Directory for PPP log file>\n"
    207207      "           PPP/nmeaPath    <Directory for NMEA output file>\n"
    208208      "           PPP/snxtroPath  <Directory for SINEX troposphere output file>\n"
     209      "           PPP/v3filenames <Produce version 3 filenames, 0=no, 2=yes>\n"
    209210      "           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"
    210211      "           PPP/snxtroSampl <SINEX troposphere file sampling rate [integer number of seconds: 0,30,60,90,120,150,180,210,240,270,300]>\n"
  • trunk/BNC/src/bncoutf.cpp

    r6607 r7506  
    1212 * Created:    25-Apr-2008
    1313 *
    14  * Changes:   
     14 * Changes:
    1515 *
    1616 * -----------------------------------------------------------------------*/
     
    3939    _path        = fileInfo.absolutePath() + QDir::separator();
    4040    _sklBaseName = fileInfo.baseName();
    41     _extension   = fileInfo.completeSuffix(); 
    42    
     41    _extension   = fileInfo.completeSuffix();
     42
    4343    expandEnvVar(_path);
    4444    if (!_extension.isEmpty()) {
     
    4848
    4949  _append = Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked;
     50  _v3filenames = settings.value("PPP/v3filenames").toBool();
    5051}
    5152
     
    6465// Epoch String
    6566////////////////////////////////////////////////////////////////////////////
    66 QString bncoutf::epochStr(const QDateTime& datTim, const QString& intStr) {
    67 
    68   QString epoStr;
     67QString bncoutf::epochStr(const QDateTime& datTim, const QString& intStr,
     68    int sampl) {
     69
     70  QString epoStr = "";
    6971
    7072  int indHlp = intStr.indexOf("min");
     73  if (!sampl) {
     74    sampl++;
     75  }
    7176
    7277  if ( indHlp != -1) {
    7378    int step = intStr.left(indHlp-1).toInt();
    74     char ch = 'A' + datTim.time().hour();
    75     epoStr = QString("_") + ch;
     79    if (_v3filenames) {
     80      epoStr +=  QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0')); // H
     81    } else {
     82      epoStr +=  'A' + datTim.time().hour();
     83    }
     84
    7685    if (datTim.time().minute() >= 60-step) {
    77       epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
     86      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));               // M
    7887    }
    7988    else {
    8089      for (int limit = step; limit <= 60-step; limit += step) {
    8190        if (datTim.time().minute() < limit) {
    82           epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
     91          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));        // M
    8392          break;
    8493        }
    8594      }
    8695    }
     96
     97    if (_v3filenames) {
     98      epoStr += QString("_%1M").arg(step, 2, 10, QChar('0'));                // period
     99    }
     100
    87101    _numSec = 60 * step;
    88102  }
    89103  else if (intStr == "1 hour") {
    90     char ch = 'A' + datTim.time().hour();
    91     epoStr = QString("_") + ch;
     104    int step = intStr.left(indHlp-1).toInt();
     105    if (_v3filenames) {
     106      epoStr += QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0'));  // H
     107      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                     // M
     108      epoStr += QString("_%1H").arg(step+1, 2, 10, QChar('0'));              // period
     109    } else {
     110      epoStr +=  'A' + datTim.time().hour();
     111    }
    92112    _numSec = 3600;
    93113  }
    94114  else {
    95     epoStr = "";
     115    int step = intStr.left(indHlp-1).toInt();
     116    if (_v3filenames) {
     117      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // H
     118      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // M
     119      epoStr += QString("_%1D").arg(step+1, 2, 10, QChar('0'));             // period
     120    } else {
     121      epoStr = "0";
     122    }
    96123    _numSec = 86400;
     124  }
     125
     126  if (_v3filenames) {
     127    if (sampl < 60) {
     128      epoStr += QString("_%1S").arg(sampl, 2, 10, QChar('0'));
     129    }
     130    else {
     131      sampl /= 60;
     132      epoStr += QString("_%1M").arg(sampl, 2, 10, QChar('0'));
     133    }
    97134  }
    98135
     
    111148
    112149  QString yyyy     = QString::number(datTim.date().year());
    113   QString doy      = QString("%1%2").arg(dayOfYear,3,10, QLatin1Char('0')).arg(0);
     150  QString doy      = QString("%1").arg(dayOfYear,3,10, QLatin1Char('0'));
    114151  QString gpswd    = QString("%1%2").arg(GPSweek).arg(dayOfWeek);
    115   QString epoStr   = epochStr(datTim, _intr);
    116   QString baseName = _sklBaseName; 
     152  QString epoStr   = epochStr(datTim, _intr, _sampl);
     153  QString baseName = _sklBaseName;
    117154  baseName.replace("${GPSWD}", gpswd);
    118   baseName.replace("${DATE}" , datTim.date().toString(Qt::ISODate));
    119   baseName.replace("${DOY}"  , doy);
    120   _extension.replace("${YY}" , yyyy.right(2));
     155  baseName.replace("${V3}" , QString("_U_%1%2").arg(yyyy).arg(doy));
     156
    121157  return _path + baseName + epoStr + _extension;
    122158}
  • trunk/BNC/src/bncoutf.h

    r4380 r7506  
    2323
    2424 private:
    25   QString epochStr(const QDateTime& datTim, const QString& intStr);
     25  QString epochStr(const QDateTime& datTim, const QString& intStr,
     26      int sampl);
    2627  QString resolveFileName(int GPSweek, const QDateTime& datTim);
    2728
     
    3334  QString _fName;
    3435  bool    _append;
     36  bool    _v3filenames;
    3537};
    3638
  • trunk/BNC/src/bncwindow.cpp

    r7497 r7506  
    865865  _pppWidgets._crdFile->setMaximumWidth(35*ww);
    866866  _pppWidgets._antexFile->setMaximumWidth(35*ww);
    867   _pppWidgets._snxtroFile->setMaximumWidth(35*ww);
     867  _pppWidgets._snxtroPath->setMaximumWidth(35*ww);
    868868  _pppWidgets._snxtroIntr->setMaximumWidth(15*ww);
    869869
     
    887887  pppLayout1->addWidget(new QLabel("Coordinates"),           ir, 0);
    888888  pppLayout1->addWidget(_pppWidgets._crdFile,                ir, 1);
    889   pppLayout1->addWidget(new QLabel("   Logfile"),            ir, 3);
    890   pppLayout1->addWidget(_pppWidgets._logFile,                ir, 4, 1, 3);
     889  pppLayout1->addWidget(new QLabel("   Logfile Directory"),  ir, 3);
     890  pppLayout1->addWidget(_pppWidgets._logPath,                ir, 4, 1, 3);
    891891  ++ir;
    892892  pppLayout1->addWidget(new QLabel("ANTEX file"),            ir, 0);
    893893  pppLayout1->addWidget(_pppWidgets._antexFile,              ir, 1);
    894894
    895   pppLayout1->addWidget(new QLabel("   NMEA file"),          ir, 3);
    896   pppLayout1->addWidget(_pppWidgets._nmeaFile,               ir, 4, 1, 3);
    897 
    898   ++ir;
    899   pppLayout1->addWidget(new QLabel("SNX TRO file"),          ir, 0);
    900   pppLayout1->addWidget(_pppWidgets._snxtroFile,             ir, 1);
     895  pppLayout1->addWidget(new QLabel("   NMEA Directory"),     ir, 3);
     896  pppLayout1->addWidget(_pppWidgets._nmeaPath,               ir, 4, 1, 3);
     897
     898  ++ir;
     899  pppLayout1->addWidget(new QLabel("SNX TRO directory"),     ir, 0);
     900  pppLayout1->addWidget(_pppWidgets._snxtroPath,             ir, 1);
    901901  pppLayout1->addWidget(new QLabel("   SNX TRO interval"),   ir, 3);
    902902  pppLayout1->addWidget(_pppWidgets._snxtroIntr,             ir, 4);
    903903  pppLayout1->addWidget(new QLabel("   SNX TRO sampling"),   ir, 5, Qt::AlignRight);
    904904  pppLayout1->addWidget(_pppWidgets._snxtroSampl,            ir, 6, Qt::AlignRight);
     905  ++ir;
     906  pppLayout1->addWidget(new QLabel("Version 3 filenames"),   ir, 0);
     907  pppLayout1->addWidget(_pppWidgets._v3filenames,            ir, 1);
    905908
    906909  ++ir;
     
    924927  _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>"));
    925928
    926   _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>"));
    927 
    928   _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>"));
    929 
    930   _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>"));
     929  _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>"));
     930
     931  _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>"));
     932
     933  _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>"));
    931934
    932935  _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>"));
  • trunk/BNC/src/pppRun.cpp

    r7301 r7506  
    137137  _stopFlag = false;
    138138
    139   QString roverName(_opt->_roverName.c_str());
    140 
    141   QString logFileSkl = settings.value("PPP/logFilePPP").toString();
     139  QString roverName(_opt->_roverName.c_str()), fullRoverName("");
     140  QString country;
     141  QString monNum = "0";
     142  QString recNum = "0";
     143  QString intr = "1 day";
     144  int     sampl  = 0;
     145  QListIterator<QString> it(settings.value("mountPoints").toStringList());
     146  while (it.hasNext()) {
     147    QStringList hlp = it.next().split(" ");
     148    if (hlp.size() < 7)
     149      continue;
     150    if (hlp.join(" ").indexOf(roverName, 0) != -1) {
     151      country = hlp[2];
     152    }
     153  }
     154  fullRoverName = roverName.left(4) +
     155                  QString("%1").arg(monNum, 1, 10) +
     156                  QString("%1").arg(recNum, 1, 10) +
     157                  country;
     158
     159  bool v3filenames = settings.value("PPP/v3filenames").toBool();
     160  QString logFileSkl = settings.value("PPP/logPath").toString();
    142161  if (logFileSkl.isEmpty()) {
    143162    _logFile = 0;
    144163  }
    145164  else {
    146     if (logFileSkl.indexOf("${STATION}") == -1) {
    147       logFileSkl = logFileSkl + "_" + roverName;
     165    if (v3filenames) {
     166      logFileSkl = logFileSkl + fullRoverName + "${V3}" + ".ppp";
    148167    }
    149168    else {
    150       logFileSkl.replace("${STATION}", roverName);
    151     }
    152     _logFile = new bncoutf(logFileSkl, "1 day", 0);
    153   }
    154 
    155   QString nmeaFileSkl = settings.value("PPP/nmeaFile").toString();
     169      logFileSkl = logFileSkl + roverName.left(4) + "${GPSWD}" + ".ppp";
     170    }
     171    _logFile = new bncoutf(logFileSkl, intr, sampl);
     172  }
     173
     174  QString nmeaFileSkl = settings.value("PPP/nmeaPath").toString();
    156175  if (nmeaFileSkl.isEmpty()) {
    157176    _nmeaFile = 0;
    158177  }
    159178  else {
    160     if (nmeaFileSkl.indexOf("${STATION}") == -1) {
    161       nmeaFileSkl = roverName + "_" + nmeaFileSkl;
     179    if (v3filenames) {
     180      nmeaFileSkl = nmeaFileSkl + fullRoverName + "${V3}" + ".nmea";
    162181    }
    163182    else {
    164       nmeaFileSkl.replace("${STATION}", roverName);
    165     }
    166     _nmeaFile = new bncoutf(nmeaFileSkl, "1 day", 0);
    167   }
    168 
    169   QString snxtroFileSkl = settings.value("PPP/snxtroFile").toString();
     183      nmeaFileSkl = nmeaFileSkl + roverName.left(4) + "${GPSWD}" + ".nmea";
     184    }
     185    _nmeaFile = new bncoutf(nmeaFileSkl, intr, sampl);
     186  }
     187
     188  QString snxtroFileSkl = settings.value("PPP/snxtroPath").toString();
    170189  if (snxtroFileSkl.isEmpty()) {
    171190    _snxtroFile = 0;
    172191  }
    173192  else {
    174     if (snxtroFileSkl.indexOf("${STATION}") == -1) {
    175       snxtroFileSkl = snxtroFileSkl + "_" + roverName;
     193    if (v3filenames) {
     194      snxtroFileSkl = snxtroFileSkl + fullRoverName + "${V3}" + ".tra";
    176195    }
    177196    else {
    178       snxtroFileSkl.replace("${STATION}", roverName.left(4));
    179     }
    180     int samplSnxTro = settings.value("PPP/snxtroSampl").toInt();
    181     _snxtroFile = new bncSinexTro(_opt, snxtroFileSkl, "1 day", samplSnxTro);
     197      snxtroFileSkl = snxtroFileSkl + roverName.left(4) + "${GPSWD}" + ".tro";
     198    }
     199    sampl = settings.value("PPP/snxtroSampl").toInt();
     200    intr  = settings.value("PPP/snxtroIntr").toString();
     201    _snxtroFile = new bncSinexTro(_opt, snxtroFileSkl, intr, sampl);
    182202  }
    183203}
  • trunk/BNC/src/pppWidgets.cpp

    r7500 r7506  
    5959  _crdFile      = new qtFileChooser(); _crdFile     ->setObjectName("PPP/crdFile");      _widgets << _crdFile;
    6060  _antexFile    = new qtFileChooser(); _antexFile   ->setObjectName("PPP/antexFile");    _widgets << _antexFile;
    61   _logFile      = new QLineEdit();     _logFile     ->setObjectName("PPP/logFilePPP");   _widgets << _logFile;
    62   _nmeaFile     = new QLineEdit();     _nmeaFile    ->setObjectName("PPP/nmeaFile");     _widgets << _nmeaFile;
    63   _snxtroFile   = new QLineEdit();     _snxtroFile  ->setObjectName("PPP/snxtroFile");   _widgets << _snxtroFile;
     61  _logPath      = new QLineEdit();     _logPath     ->setObjectName("PPP/logPath");      _widgets << _logPath;
     62  _nmeaPath     = new QLineEdit();     _nmeaPath    ->setObjectName("PPP/nmeaPath");     _widgets << _nmeaPath;
     63  _snxtroPath   = new QLineEdit();     _snxtroPath  ->setObjectName("PPP/snxtroPath");   _widgets << _snxtroPath;
    6464  _snxtroSampl  = new QSpinBox();      _snxtroSampl ->setObjectName("PPP/snxtroSampl");  _widgets << _snxtroSampl;
    6565  _snxtroIntr   = new QComboBox();     _snxtroIntr  ->setObjectName("PPP/snxtroIntr");   _widgets << _snxtroIntr;
     66  _v3filenames  = new QCheckBox();     _v3filenames ->setObjectName("PPP/v3filenames");  _widgets << _v3filenames;
    6667  _staTable     = new QTableWidget();  _staTable    ->setObjectName("PPP/staTable");     _widgets << _staTable;
    6768  _lcGPS        = new QComboBox();     _lcGPS       ->setObjectName("PPP/lcGPS");        _widgets << _lcGPS;
     
    99100  connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
    100101
    101   connect(_snxtroFile, SIGNAL(textChanged(const QString &)),
     102  connect(_snxtroPath, SIGNAL(textChanged(const QString &)),
    102103         this, SLOT(slotPPPTextChanged()));
    103104
     
    248249  // ---------
    249250  _corrMount  ->setText(settings.value(_corrMount  ->objectName()).toString());
    250   _logFile    ->setText(settings.value(_logFile    ->objectName()).toString());
    251   _nmeaFile   ->setText(settings.value(_nmeaFile   ->objectName()).toString());
    252   _snxtroFile ->setText(settings.value(_snxtroFile ->objectName()).toString());
     251  _logPath    ->setText(settings.value(_logPath    ->objectName()).toString());
     252  _nmeaPath   ->setText(settings.value(_nmeaPath   ->objectName()).toString());
     253  _snxtroPath ->setText(settings.value(_snxtroPath ->objectName()).toString());
    253254
    254255  if (!settings.value(_sigmaC1->objectName()).toString().isEmpty()) {
     
    291292  _eleWgtCode ->setCheckState(Qt::CheckState(settings.value(_eleWgtCode ->objectName()).toInt()));
    292293  _eleWgtPhase->setCheckState(Qt::CheckState(settings.value(_eleWgtPhase->objectName()).toInt()));
     294  _v3filenames->setCheckState(Qt::CheckState(settings.value(_v3filenames->objectName()).toInt()));
    293295
    294296  // SpinBoxex
     
    346348  settings.setValue(_crdFile     ->objectName(), _crdFile     ->fileName());
    347349  settings.setValue(_antexFile   ->objectName(), _antexFile   ->fileName());
    348   settings.setValue(_logFile     ->objectName(), _logFile     ->text());
    349   settings.setValue(_nmeaFile    ->objectName(), _nmeaFile    ->text());
    350   settings.setValue(_snxtroFile  ->objectName(), _snxtroFile  ->text());
     350  settings.setValue(_logPath     ->objectName(), _logPath     ->text());
     351  settings.setValue(_nmeaPath    ->objectName(), _nmeaPath    ->text());
     352  settings.setValue(_snxtroPath  ->objectName(), _snxtroPath  ->text());
    351353  settings.setValue(_snxtroSampl ->objectName(), _snxtroSampl ->value());
     354  settings.setValue(_v3filenames ->objectName(), _v3filenames ->checkState());
    352355  settings.setValue(_snxtroIntr  ->objectName(), _snxtroIntr  ->currentText());
    353356  settings.setValue(_lcGPS       ->objectName(), _lcGPS       ->currentText());
     
    417420  }
    418421
    419   if ( _snxtroFile->text() != "" && !allDisabled) {
     422  if ( _snxtroPath->text() != "" && !allDisabled) {
    420423    _snxtroSampl->setEnabled(true);
    421424    _snxtroIntr ->setEnabled(true);
     
    488491  // SNX TRO file sampling
    489492  // ---------------------
    490   if (sender() == 0 || sender() == _snxtroFile) {
    491     if ( _snxtroFile->text() != "" ) {
     493  if (sender() == 0 || sender() == _snxtroPath) {
     494    if ( _snxtroPath->text() != "" ) {
    492495      _snxtroSampl->setEnabled(true);
    493496      _snxtroIntr->setEnabled(true);
  • trunk/BNC/src/pppWidgets.h

    r7488 r7506  
    4444  qtFileChooser* _crdFile;
    4545  qtFileChooser* _antexFile;
    46   QLineEdit*     _logFile;
    47   QLineEdit*     _nmeaFile;
    48   QLineEdit*     _snxtroFile;
     46  QLineEdit*     _logPath;
     47  QLineEdit*     _nmeaPath;
     48  QLineEdit*     _snxtroPath;
    4949  QSpinBox*      _snxtroSampl;
    5050  QComboBox*     _snxtroIntr;
     51  QCheckBox*     _v3filenames;
    5152  QTableWidget*  _staTable;
    5253  QComboBox*     _lcGPS;
Note: See TracChangeset for help on using the changeset viewer.