- Timestamp:
- Feb 22, 2008, 11:32:46 AM (17 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r696 r699 377 377 void bncGetThread::run() { 378 378 379 t_irc irc = initRun();380 381 if (irc == fatal) {382 QThread::exit(1);383 return;384 }385 else if (irc != success) {386 emit(newMessage(_staID + ": initRun failed, reconnecting"));387 tryReconnect();388 }389 390 379 bool wrongEpoch = false; 391 380 bool decode = true; … … 397 386 bool begCorrupt = false; 398 387 bool endCorrupt = false; 388 399 389 _decodeTime = QDateTime::currentDateTime(); 400 390 _decodeSucc = QDateTime::currentDateTime(); 391 t_irc irc = initRun(); 392 393 if (irc == fatal) { 394 QThread::exit(1); 395 return; 396 } 397 else if (irc != success) { 398 emit(newMessage(_staID + ": initRun failed, reconnecting")); 399 tryReconnect(); 400 } 401 401 402 if (initPause < _inspSegm) { 402 403 initPause = _inspSegm; … … 452 453 if (numSucc>0) { 453 454 secSucc += _inspSegm; 455 _decodeSucc = QDateTime::currentDateTime(); 454 456 if (secSucc > _adviseReco * 60) { 455 457 secSucc = _adviseReco * 60 + 1; … … 483 485 // --------------------- 484 486 if ( begCorrupt && !endCorrupt && secSucc > _adviseReco * 60 ) { 485 _endDateCor = QDateTime::currentDateTime(). toUTC().date().toString("dd-MM-yy");486 _endTimeCor = QDateTime::currentDateTime(). toUTC().time().toString("hh:mm:ss");487 emit(newMessage( _staID + ": Corrupted recovery threshold exceeded"));487 _endDateCor = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().date().toString("yy-MM-dd"); 488 _endTimeCor = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().time().toString("hh:mm:ss"); 489 emit(newMessage((_staID + ": Corrupted recovery threshold exceeded at " + _endDateCor + " " + _endTimeCor).toAscii())); 488 490 callScript(("End_Corrupted " + _endDateCor + " " + _endTimeCor + " Begin was " + _begDateCor + " " + _begTimeCor).toAscii()); 489 491 endCorrupt = true; … … 496 498 // ----------------------- 497 499 if ( !begCorrupt && secFail > _adviseFail * 60 ) { 498 _begDateCor = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy");499 _begTimeCor = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss");500 emit(newMessage( _staID + ": Corrupted failure threshold exceeded"));500 _begDateCor = _decodeSucc.toUTC().date().toString("yy-MM-dd"); 501 _begTimeCor = _decodeSucc.toUTC().time().toString("hh:mm:ss"); 502 emit(newMessage((_staID + ": Corrupted failure threshold exceeded at " + _begDateCor + " " + _begTimeCor).toAscii())); 501 503 callScript(("Begin_Corrupted " + _begDateCor + " " + _begTimeCor).toAscii()); 502 504 begCorrupt = true; … … 517 519 _decodeStart.setTime(QTime()); 518 520 if (_inspSegm>0) { 519 _endDateOut = QDateTime::currentDateTime(). toUTC().date().toString("dd-MM-yy");520 _endTimeOut = QDateTime::currentDateTime(). toUTC().time().toString("hh:mm:ss");521 emit(newMessage( _staID + ": Outage recovery threshold exceeded"));521 _endDateOut = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().date().toString("yy-MM-dd"); 522 _endTimeOut = QDateTime::currentDateTime().addSecs(- _adviseReco * 60).toUTC().time().toString("hh:mm:ss"); 523 emit(newMessage((_staID + ": Outage recovery threshold exceeded at " + _endDateOut + " " + _endTimeOut).toAscii())); 522 524 callScript(("End_Outage " + _endDateOut + " " + _endTimeOut + " Begin was " + _begDateOut + " " + _begTimeOut).toAscii()); 523 525 } … … 625 627 _decodeStop.setTime(QTime()); 626 628 if (_inspSegm>0) { 627 _begDateOut = QDateTime::currentDateTime().toUTC().date().toString("dd-MM-yy");628 _begTimeOut = QDateTime::currentDateTime().toUTC().time().toString("hh:mm:ss");629 emit(newMessage( _staID + ": Outage failure threshold exceeded"));629 _begDateOut = _decodeTime.toUTC().date().toString("yy-MM-dd"); 630 _begTimeOut = _decodeTime.toUTC().time().toString("hh:mm:ss"); 631 emit(newMessage((_staID + ": Outage failure threshold exceeded at " + _begDateOut + " " + _begTimeOut).toAscii())); 630 632 callScript(("Begin_Outage " + _begDateOut + " " + _begTimeOut).toAscii()); 631 633 } -
trunk/BNC/bncgetthread.h
r696 r699 98 98 QDateTime _decodePause; 99 99 QDateTime _decodeTime; 100 QDateTime _decodeSucc; 100 101 QMutex _mutex; 101 102 };
Note:
See TracChangeset
for help on using the changeset viewer.