Changeset 6820 in ntrip


Ignore:
Timestamp:
May 8, 2015, 1:52:54 PM (9 years ago)
Author:
weber
Message:

Bug in stream corrution Failure/Recovery fixed

File:
1 edited

Legend:

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

    r6807 r6820  
    138138  _initPause  = 0;
    139139  _currPause  = 0;
    140   _begCorrupt = false;
    141   _endCorrupt = false;
    142140  _followSec  = false;
    143141  _oldSecGPS  = 0;
     
    157155
    158156  _decodeStop = QDateTime::currentDateTime();
    159 
    160157  _begDateTimeOut = QDateTime::currentDateTime();
    161158  _endDateTimeOut = QDateTime::currentDateTime();
    162 
    163159  _fromReconnect = false;
     160
     161  _decodeStopCorr = QDateTime::currentDateTime();
     162  _begDateTimeCorr = QDateTime::currentDateTime();
     163  _endDateTimeCorr = QDateTime::currentDateTime();
    164164 
    165165}
     
    222222      if (_numSucc > 0) {
    223223        _secSucc += _inspSegm;
     224        _secFail = 0;
    224225        _decodeSucc = QDateTime::currentDateTime();
    225226        if (_secSucc > _adviseReco * 60) {
     
    251252      }
    252253
    253       // End corrupt threshold
    254       // ---------------------
    255       if ( _begCorrupt && !_endCorrupt && _secSucc > _adviseReco * 60 ) {
    256         _endDateCor = QDateTime::currentDateTime()
    257                     .addSecs(- _adviseReco * 60)
    258                     .toUTC().date().toString("yy-MM-dd");
    259         _endTimeCor = QDateTime::currentDateTime()
    260                     .addSecs(- _adviseReco * 60)
    261                     .toUTC().time().toString("hh:mm:ss");
    262         emit(newMessage((_staID
    263                     + ": Recovery threshold exceeded, corruption ended "
    264                     + _endDateCor + " " + _endTimeCor + " UTC").toAscii(), true));
    265         callScript(("End_Corrupted "
    266                     + _endDateCor + " " + _endTimeCor + " UTC Begin was "
    267                     + _begDateCor + " " + _begTimeCor + " UTC").toAscii());
    268         _endCorrupt = true;
    269         _begCorrupt = false;
    270         _secFail = 0;
    271       }
    272       else {
    273 
    274         // Begin corrupt threshold
    275         // -----------------------
    276         if ( !_begCorrupt && _secFail > _adviseFail * 60 ) {
    277           _begDateCor = _decodeSucc.toUTC().date().toString("yy-MM-dd");
    278           _begTimeCor = _decodeSucc.toUTC().time().toString("hh:mm:ss");
    279           emit(newMessage((_staID
    280                     + ": Failure threshold exceeded, corrupted since "
    281                     + _begDateCor + " " + _begTimeCor + " UTC").toAscii(), true));
     254      // Begin corrupt threshold
     255      // -----------------------
     256      if (_secSucc > 0) {
     257        _endDateTimeCorr = QDateTime::currentDateTime();
     258      }
     259
     260      if (_secFail > 0) {
     261        _begDateTimeCorr = QDateTime::currentDateTime();
     262      }
     263
     264      if ( _decodeStopCorr.isValid() ) {
     265        _begDateTimeCorr = QDateTime::currentDateTime();
     266        if ( _endDateTimeCorr.secsTo(QDateTime::currentDateTime()) > _adviseFail * 60 ) {
     267          _begDateCorr = _endDateTimeCorr.toUTC().date().toString("yy-MM-dd");
     268          _begTimeCorr = _endDateTimeCorr.toUTC().time().toString("hh:mm:ss");
     269          emit(newMessage((_staID + ": Failure threshold exceeded, corrupted since "
     270                    + _begDateCorr + " " + _begTimeCorr + " UTC").toAscii(), true));
    282271          callScript(("Begin_Corrupted "
    283                     + _begDateCor + " " + _begTimeCor + " UTC").toAscii());
    284           _begCorrupt = true;
    285           _endCorrupt = false;
     272                    + _begDateCorr + " " + _begTimeCorr + " UTC").toAscii());
    286273          _secSucc = 0;
    287274          _numSucc = 0;
     275          _decodeStopCorr.setDate(QDate());
     276          _decodeStopCorr.setTime(QTime());
     277          _decodeStartCorr = QDateTime::currentDateTime();
     278        }
     279      }
     280      else {
     281
     282        // End corrupt threshold
     283        // ---------------------
     284        if ( _decodeStartCorr.isValid() ) {
     285          _endDateTimeCorr = QDateTime::currentDateTime();
     286          if ( _begDateTimeCorr.secsTo(QDateTime::currentDateTime()) > _adviseReco * 60 ) {
     287            _endDateCorr = _begDateTimeCorr.toUTC().date().toString("yy-MM-dd");
     288            _endTimeCorr = _begDateTimeCorr.toUTC().time().toString("hh:mm:ss");
     289            emit(newMessage((_staID + ": Recovery threshold exceeded, corruption ended "
     290                        + _endDateCorr + " " + _endTimeCorr + " UTC").toAscii(), true));
     291            callScript(("End_Corrupted "
     292                        + _endDateCorr + " " + _endTimeCorr + " UTC Begin was "
     293                        + _begDateCorr + " " + _begTimeCorr + " UTC").toAscii());
     294            _decodeStartCorr.setDate(QDate());
     295            _decodeStartCorr.setTime(QTime());
     296            _decodeStopCorr = QDateTime::currentDateTime();
     297            _secFail = 0;
     298          }
    288299        }
    289300      }
Note: See TracChangeset for help on using the changeset viewer.