- Timestamp:
- Feb 11, 2009, 12:48:55 AM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r1571 r1572 321 321 322 322 if (tryReconnect() != success) { 323 _latencyChecker->checkReconnect(); 323 324 continue; 324 325 } … … 351 352 // ------------------ 352 353 if (nBytes == 0) { 353 _latencyChecker->checkReconnect();354 354 emit(newMessage(_staID + ": Data timeout, reconnecting", true)); 355 355 continue; -
trunk/BNC/latencychecker.cpp
r1568 r1572 151 151 _decodeSucc = QDateTime::currentDateTime(); 152 152 153 _decodeStop = QDateTime::currentDateTime(); 154 153 155 } 154 156 … … 161 163 ////////////////////////////////////////////////////////////////////////////// 162 164 void latencyChecker::checkReconnect() { 163 _reConnect = true; 165 166 // Begin outage threshold 167 // ---------------------- 168 if ( _decodeStop.isValid() ) { 169 if ( _decodeStop.secsTo(QDateTime::currentDateTime()) > _adviseFail * 60 ) { 170 _decodeStop.setDate(QDate()); 171 _decodeStop.setTime(QTime()); 172 _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd"); 173 _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss"); 174 emit(newMessage((_staID 175 + ": Failure threshold exceeded, outage since " 176 + _begDateOut + " " + _begTimeOut).toAscii(), true)); 177 callScript(("Begin_Outage " 178 + _begDateOut + " " + _begTimeOut).toAscii()); 179 } 180 _decodeStart = QDateTime::currentDateTime(); 181 } 182 164 183 } 165 184 … … 257 276 } 258 277 259 // Begin outage threshold260 // ----------------------261 if ( _decodeStop.isValid() ) {262 if ( _decodeStop.secsTo(QDateTime::currentDateTime()) > _adviseFail * 60 ) {263 _decodeStop.setDate(QDate());264 _decodeStop.setTime(QTime());265 _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd");266 _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss");267 emit(newMessage((_staID268 + ": Failure threshold exceeded, outage since "269 + _begDateOut + " " + _begTimeOut).toAscii(), true));270 callScript(("Begin_Outage "271 + _begDateOut + " " + _begTimeOut).toAscii());272 _decodeStart = QDateTime::currentDateTime();273 }274 }275 276 278 // End outage threshold 277 279 // -------------------- … … 292 294 + _endDateOut + " " + _endTimeOut + " Begin was " 293 295 + _begDateOut + " " + _begTimeOut).toAscii()); 294 _decodeStop = QDateTime::currentDateTime(); 295 } 296 } 297 _reConnect = false; 298 296 _decodeStop = QDateTime::currentDateTime(); 297 } 298 } 299 299 } 300 300 -
trunk/BNC/latencychecker.h
r1568 r1572 65 65 bool _endCorrupt; 66 66 bool _followSec; 67 bool _reConnect;68 67 double _maxDt; 69 68 double _sumLat;
Note:
See TracChangeset
for help on using the changeset viewer.