Changeset 647 in ntrip


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

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncapp.cpp

    r642 r647  
    4747#include "bncapp.h"
    4848#include "bncutils.h"
     49#include "bncrinex.h"
    4950
    5051using namespace std;
     
    263264               QString("%1").arg(datTim.date().dayOfYear(), 3, 10, QChar('0'));
    264265
    265     QString hlpStr;
    266     QString intStr = settings.value("ephIntr").toString();
    267     if      (intStr == "1 day") {
    268       hlpStr = "0";
    269     }
    270     else if (intStr == "1 hour") {
    271       char ch = 'A' + datTim.time().hour();
    272       hlpStr = ch;
    273     }
    274     else if (intStr == "15 min") {
    275       char ch = 'A' + datTim.time().hour();
    276       hlpStr = ch;
    277       if      (datTim.time().minute() < 15) {
    278         hlpStr += "00";
    279       }
    280       else if (datTim.time().minute() < 30) {
    281         hlpStr += "15";
    282       }
    283       else if (datTim.time().minute() < 45) {
    284         hlpStr += "30";
    285       }
    286       else {
    287         hlpStr += "45";
    288       }
    289     }
    290     else {
    291       char ch = 'A' + datTim.time().hour();
    292       hlpStr = ch;
    293       if      (datTim.time().minute() <  5) {
    294         hlpStr += "00";
    295       }
    296       else if (datTim.time().minute() < 10) {
    297         hlpStr += "05";
    298       }
    299       else if (datTim.time().minute() < 15) {
    300         hlpStr += "10";
    301       }
    302       else if (datTim.time().minute() < 20) {
    303         hlpStr += "15";
    304       }
    305       else if (datTim.time().minute() < 25) {
    306         hlpStr += "20";
    307       }
    308       else if (datTim.time().minute() < 30) {
    309         hlpStr += "25";
    310       }
    311       else if (datTim.time().minute() < 35) {
    312         hlpStr += "30";
    313       }
    314       else if (datTim.time().minute() < 40) {
    315         hlpStr += "35";
    316       }
    317       else if (datTim.time().minute() < 45) {
    318         hlpStr += "40";
    319       }
    320       else if (datTim.time().minute() < 50) {
    321         hlpStr += "45";
    322       }
    323       else if (datTim.time().minute() < 55) {
    324         hlpStr += "50";
    325       }
    326       else {
    327         hlpStr += "55";
    328       }
    329     }
     266    QString hlpStr = bncRinex::nextEpochStr(datTim,
     267                         settings.value("ephIntr").toString());
    330268
    331269    if (_rinexVers == 3) {
  • 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);
  • trunk/BNC/bncrinex.h

    r622 r647  
    4444   void dumpEpoch(long maxTime);
    4545   void setReconnectFlag(bool flag){_reconnectFlag = flag;}
     46   static QString bncRinex::nextEpochStr(const QDateTime& datTim,
     47                                         const QString& intStr,
     48                                         QDateTime* nextEpoch = 0);
    4649
    4750 private:
  • trunk/BNC/bncwindow.cpp

    r638 r647  
    185185  _ephIntrComboBox->setMaximumWidth(9*ww);
    186186  _ephIntrComboBox->setEditable(false);
    187   _ephIntrComboBox->addItems(QString("5 min,15 min,1 hour,1 day").split(","));
     187  _ephIntrComboBox->addItems(QString("1 min,2 min,5 min,10 min,15 min,30 min,1 hour,1 day").split(","));
    188188  int jj = _ephIntrComboBox->findText(settings.value("ephIntr").toString());
    189189  if (jj != -1) {
Note: See TracChangeset for help on using the changeset viewer.