Changeset 8011 in ntrip for trunk/BNC/src/latencychecker.cpp


Ignore:
Timestamp:
Aug 12, 2016, 5:25:52 PM (8 years ago)
Author:
stuerze
Message:

check regarding wrong observation epochs is done in latencychecker as well to prevent erroneous latencies

File:
1 edited

Legend:

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

    r7422 r8011  
    3535 * Created:    02-Feb-2009
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    6060  _staID = staID;
    6161
    62   connect(this, SIGNAL(newMessage(QByteArray,bool)), 
     62  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    6363          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
    6464
     
    6969  QString adviseObsRate = settings.value("adviseObsRate").toString();
    7070  _inspSegm = 0;
    71   if      ( adviseObsRate.isEmpty() ) { 
    72     _inspSegm = 0; 
    73   }
    74   else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) { 
    75     _inspSegm = 20; 
    76   }
    77   else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) { 
    78     _inspSegm = 10; 
    79   }
    80   else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) { 
    81     _inspSegm = 20; 
    82   }
    83   else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) { 
    84     _inspSegm = 40; 
    85   }
    86   else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) { 
    87     _inspSegm = 50; 
     71  if      ( adviseObsRate.isEmpty() ) {
     72    _inspSegm = 0;
     73  }
     74  else if ( adviseObsRate.indexOf("5 Hz")   != -1 ) {
     75    _inspSegm = 20;
     76  }
     77  else if ( adviseObsRate.indexOf("1 Hz")   != -1 ) {
     78    _inspSegm = 10;
     79  }
     80  else if ( adviseObsRate.indexOf("0.5 Hz") != -1 ) {
     81    _inspSegm = 20;
     82  }
     83  else if ( adviseObsRate.indexOf("0.2 Hz") != -1 ) {
     84    _inspSegm = 40;
     85  }
     86  else if ( adviseObsRate.indexOf("0.1 Hz") != -1 ) {
     87    _inspSegm = 50;
    8888  }
    8989  _adviseFail = settings.value("adviseFail").toInt();
     
    9696  _miscIntr = 1;
    9797  QString miscIntr = settings.value("miscIntr").toString();
    98   if      ( miscIntr.isEmpty() ) { 
    99     _miscIntr = 1; 
    100   }
    101   else if ( miscIntr.indexOf("2 sec")   != -1 ) { 
    102     _miscIntr = 2; 
    103   }
    104   else if ( miscIntr.indexOf("10 sec")  != -1 ) { 
    105     _miscIntr = 10; 
    106   }
    107   else if ( miscIntr.indexOf("1 min")   != -1 ) { 
    108     _miscIntr = 60; 
    109   }
    110   else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) { 
    111     _miscIntr = 300; 
    112   }
    113   else if ( miscIntr.indexOf("15 min")  != -1 ) { 
    114     _miscIntr = 900; 
    115   }
    116   else if ( miscIntr.indexOf("1 hour")  != -1 ) { 
    117     _miscIntr = 3600; 
    118   }
    119   else if ( miscIntr.indexOf("6 hours") != -1 ) { 
    120     _miscIntr = 21600; 
    121   }
    122   else if ( miscIntr.indexOf("1 day")   != -1 ) { 
    123     _miscIntr = 86400; 
     98  if      ( miscIntr.isEmpty() ) {
     99    _miscIntr = 1;
     100  }
     101  else if ( miscIntr.indexOf("2 sec")   != -1 ) {
     102    _miscIntr = 2;
     103  }
     104  else if ( miscIntr.indexOf("10 sec")  != -1 ) {
     105    _miscIntr = 10;
     106  }
     107  else if ( miscIntr.indexOf("1 min")   != -1 ) {
     108    _miscIntr = 60;
     109  }
     110  else if ( miscIntr.left(5).indexOf("5 min")   != -1 ) {
     111    _miscIntr = 300;
     112  }
     113  else if ( miscIntr.indexOf("15 min")  != -1 ) {
     114    _miscIntr = 900;
     115  }
     116  else if ( miscIntr.indexOf("1 hour")  != -1 ) {
     117    _miscIntr = 3600;
     118  }
     119  else if ( miscIntr.indexOf("6 hours") != -1 ) {
     120    _miscIntr = 21600;
     121  }
     122  else if ( miscIntr.indexOf("1 day")   != -1 ) {
     123    _miscIntr = 86400;
    124124  }
    125125
     
    162162  _begDateTimeCorr = QDateTime::currentDateTime();
    163163  _endDateTimeCorr = QDateTime::currentDateTime();
    164  
     164
    165165}
    166166
     
    180180  if (!_fromReconnect) {
    181181    _endDateTimeOut = QDateTime::currentDateTime();
    182   } 
     182  }
    183183  _fromReconnect = true;
    184184
     
    277277          _decodeStartCorr = QDateTime::currentDateTime();
    278278        }
    279       } 
     279      }
    280280      else {
    281281
     
    307307  if (_fromReconnect) {
    308308    _begDateTimeOut = QDateTime::currentDateTime();
    309   } 
     309  }
    310310  _fromReconnect = false;
    311311
     
    336336    while (it.hasNext()) {
    337337      const t_satObs& obs = it.next();
    338      
     338      bool wrongObservationEpoch = checkForWrongObsEpoch(obs._time);
    339339      _newSecGPS = static_cast<int>(obs._time.gpssec());
    340       if (_newSecGPS != _oldSecGPS) {
     340      if (_newSecGPS != _oldSecGPS && !wrongObservationEpoch) {
    341341        if (_newSecGPS % _miscIntr < _oldSecGPS % _miscIntr) {
    342342          if (_numLat > 0) {
     
    454454              emit(newMessage(QString(_staID + late ).toAscii(), true) );
    455455            }
    456           } 
     456          }
    457457          else {
    458458            late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")
     
    500500}
    501501
    502 // Call advisory notice script   
     502// Call advisory notice script
    503503////////////////////////////////////////////////////////////////////////////
    504504void latencyChecker::callScript(const char* comment) {
Note: See TracChangeset for help on using the changeset viewer.