Changeset 7179 in ntrip for trunk/BNC/src/bncrinex.cpp


Ignore:
Timestamp:
Aug 11, 2015, 3:46:18 PM (9 years ago)
Author:
stuerze
Message:

RINEX v3 filenames can now be formed optionally during RINEX file generation from RTCM observation and navigation streams

File:
1 edited

Legend:

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

    r7174 r7179  
    209209////////////////////////////////////////////////////////////////////////////
    210210QString bncRinex::nextEpochStr(const QDateTime& datTim,
    211                                const QString& intStr, QDateTime* nextEpoch) {
     211                               const QString& intStr, bool rnxV3filenames,
     212                               QDateTime* nextEpoch) {
    212213
    213214  QString epoStr;
     
    216217  QDate nextDate;
    217218
     219  (rnxV3filenames) ? epoStr = "" : epoStr = "A";
     220
    218221  int indHlp = intStr.indexOf("min");
    219222
    220223  if ( indHlp != -1) {
    221224    int step = intStr.left(indHlp-1).toInt();
    222     char ch = 'A' + datTim.time().hour();
    223     epoStr = ch;
     225    if (rnxV3filenames) {
     226      epoStr +=  QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0')); // H
     227    }
    224228    if (datTim.time().minute() >= 60-step) {
    225       epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
     229      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));               // M
    226230      if (datTim.time().hour() < 23) {
    227231        nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
     
    236240      for (int limit = step; limit <= 60-step; limit += step) {
    237241        if (datTim.time().minute() < limit) {
    238           epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
     242          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));        // M
    239243          nextTime.setHMS(datTim.time().hour(), limit, 0);
    240244          nextDate = datTim.date();
     
    243247      }
    244248    }
     249    if (rnxV3filenames) {
     250      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                     // S
     251      epoStr += QString("_%1M").arg(step, 2, 10, QChar('0'));                // period
     252    }
    245253  }
    246254  else if (intStr == "1 hour") {
    247     char ch = 'A' + datTim.time().hour();
    248     epoStr = ch;
     255    int step = intStr.left(indHlp-1).toInt();
     256    if (rnxV3filenames) {
     257      epoStr +=  QString("%1").arg(datTim.time().hour(), 2, 10, QChar('0')); // H
     258      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                     // M
     259      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                     // S
     260      epoStr += QString("_%1H").arg(step+1, 2, 10, QChar('0'));              // period
     261    }
    249262    if (datTim.time().hour() < 23) {
    250263      nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
     
    257270  }
    258271  else {
    259     epoStr = "0";
     272    int step = intStr.left(indHlp-1).toInt();
     273    if (rnxV3filenames) {
     274      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // H
     275      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // M
     276      epoStr += QString("%1").arg(0, 2, 10, QChar('0'));                    // S
     277      epoStr += QString("_%1D").arg(step+1, 2, 10, QChar('0'));             // period
     278    } else {
     279      epoStr = "0";
     280    }
    260281    nextTime.setHMS(0, 0, 0);
    261282    nextDate = datTim.date().addDays(1);
     
    282303
    283304  QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(),
    284                                 &_nextCloseEpoch);
     305                                _rnxV3filenames, &_nextCloseEpoch);
    285306
    286307  QString ID4 = _statID.left(4);
     
    306327  }
    307328
    308   path += ID4 +
    309           QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
    310           hlpStr + distStr + datTim.toString(".yyO");
     329  if (_rnxV3filenames) {
     330    QString country;
     331    QString monNum = "0";
     332    QString recNum = "0";
     333    QListIterator<QString> it(settings.value("mountPoints").toStringList());
     334    while (it.hasNext()) {
     335      QStringList hlp = it.next().split(" ");
     336      if (hlp.size() <= 1)
     337        continue;
     338      if (hlp.join(" ").indexOf(_statID, 0) != -1) {
     339        country = hlp[2];
     340      }
     341    }
     342    int sampl = settings.value("rnxSampl").toString().mid(0,2).toInt();
     343    if (!sampl)
     344      sampl++;
     345    path += ID4 +
     346            QString("%1").arg(monNum, 1, 10) +
     347            QString("%1").arg(recNum, 1, 10) +
     348            country +
     349            "_S_" + // stream
     350            QString("%1").arg(datTim.date().year()) +
     351            QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
     352            hlpStr + // HMS_period
     353            QString("_%1S").arg(sampl, 2, 10, QChar('0')) + // sampling rate
     354            distStr +
     355            "_MO.rnx"; // mixed OBS
     356  }
     357  else {
     358    path += ID4 +
     359            QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0')) +
     360            hlpStr + distStr + datTim.toString(".yyO");
     361  }
    311362
    312363  _fName = path.toAscii();
Note: See TracChangeset for help on using the changeset viewer.