Changeset 647 in ntrip for trunk/BNC/bncrinex.cpp


Ignore:
Timestamp:
Dec 21, 2007, 11:20:20 AM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r626 r647  
    236236}
    237237
    238 // File Name according to RINEX Standards
    239 ////////////////////////////////////////////////////////////////////////////
    240 void bncRinex::resolveFileName(const QDateTime& datTim) {
    241 
    242   QSettings settings;
    243   QString path = settings.value("rnxPath").toString();
    244   expandEnvVar(path);
    245 
    246   if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
    247     path += QDir::separator();
    248   }
    249 
    250   QString intStr = settings.value("rnxIntr").toString();
    251   QString hlpStr;
     238// Next File Epoch (static)
     239////////////////////////////////////////////////////////////////////////////
     240QString bncRinex::nextEpochStr(const QDateTime& datTim,
     241                               const QString& intStr, QDateTime* nextEpoch) {
     242
     243  QString epoStr;
    252244
    253245  QTime nextTime;
     
    259251    int step = intStr.left(indHlp-1).toInt();
    260252    char ch = 'A' + datTim.time().hour();
    261     hlpStr = ch;
     253    epoStr = ch;
    262254    if (datTim.time().minute() >= 60-step) {
    263       hlpStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
     255      epoStr += QString("%1").arg(60-step, 2, 10, QChar('0'));
    264256      if (datTim.time().hour() < 23) {
    265257        nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
     
    274266      for (int limit = step; limit <= 60-step; limit += step) {
    275267        if (datTim.time().minute() < limit) {
    276           hlpStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
     268          epoStr += QString("%1").arg(limit-step, 2, 10, QChar('0'));
    277269          nextTime.setHMS(datTim.time().hour(), limit, 0);
    278270          nextDate = datTim.date();
     
    284276  else if (intStr == "1 hour") {
    285277    char ch = 'A' + datTim.time().hour();
    286     hlpStr = ch;
     278    epoStr = ch;
    287279    if (datTim.time().hour() < 23) {
    288280      nextTime.setHMS(datTim.time().hour() + 1 , 0, 0);
     
    295287  }
    296288  else {
    297     hlpStr = "0";
     289    epoStr = "0";
    298290    nextTime.setHMS(0, 0, 0);
    299291    nextDate = datTim.date().addDays(1);
    300292  }
    301   _nextCloseEpoch = QDateTime(nextDate, nextTime);
     293
     294  if (nextEpoch) {
     295   *nextEpoch = QDateTime(nextDate, nextTime);
     296  }
     297
     298  return epoStr;
     299}
     300
     301// File Name according to RINEX Standards
     302////////////////////////////////////////////////////////////////////////////
     303void bncRinex::resolveFileName(const QDateTime& datTim) {
     304
     305  QSettings settings;
     306  QString path = settings.value("rnxPath").toString();
     307  expandEnvVar(path);
     308
     309  if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
     310    path += QDir::separator();
     311  }
     312
     313  QString hlpStr = nextEpochStr(datTim, settings.value("rnxIntr").toString(),
     314                                &_nextCloseEpoch);
    302315
    303316  QString ID4 = _statID.left(4);
Note: See TracChangeset for help on using the changeset viewer.