Changeset 6805 in ntrip
- Timestamp:
- Apr 30, 2015, 3:16:10 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/latencychecker.cpp
r6769 r6805 154 154 155 155 _checkTime = QDateTime::currentDateTime(); 156 157 _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd"); // weber158 _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss");159 160 156 _decodeSucc = QDateTime::currentDateTime(); 161 157 162 _decodeStart = QDateTime::currentDateTime();163 158 _decodeStop = QDateTime::currentDateTime(); 159 160 _begDateTimeOut = QDateTime::currentDateTime(); 161 _endDateTimeOut = QDateTime::currentDateTime(); 162 163 _fromReconnect = false; 164 164 165 165 } … … 178 178 // Begin outage threshold 179 179 // ---------------------- 180 if (!_fromReconnect) { 181 _endDateTimeOut = QDateTime::currentDateTime(); 182 } 183 _fromReconnect = true; 184 180 185 if ( _decodeStop.isValid() ) { 181 if ( _decodeStop.secsTo(QDateTime::currentDateTime()) > _adviseFail * 60 ) { 186 _begDateTimeOut = QDateTime::currentDateTime(); 187 if ( _endDateTimeOut.secsTo(QDateTime::currentDateTime()) > _adviseFail * 60 ) { 188 _begDateOut = _endDateTimeOut.toUTC().date().toString("yy-MM-dd"); 189 _begTimeOut = _endDateTimeOut.toUTC().time().toString("hh:mm:ss"); 190 emit(newMessage((_staID + ": Failure threshold exceeded, outage since " 191 + _begDateOut + " " + _begTimeOut + " UTC").toAscii(), true)); 192 callScript(("Begin_Outage" 193 + _begDateOut + " " + _begTimeOut + " UTC").toAscii()); 182 194 _decodeStop.setDate(QDate()); 183 195 _decodeStop.setTime(QTime()); 184 _begDateOut = _checkTime.toUTC().date().toString("yy-MM-dd"); 185 _begTimeOut = _checkTime.toUTC().time().toString("hh:mm:ss"); 186 emit(newMessage((_staID 187 + ": Failure threshold exceeded, outage since " 188 + _begDateOut + " " + _begTimeOut).toAscii(), true)); 189 emit(newMessage((_staID + ": Begin_Outage " // weber 190 + _begDateOut + " " + _begTimeOut).toAscii(),true)); 191 callScript(("Begin_Outage " 192 + _begDateOut + " " + _begTimeOut).toAscii()); 193 } 194 } 195 _fromReconnect = true; 196 _decodeStart = QDateTime::currentDateTime(); 196 _decodeStart = QDateTime::currentDateTime(); 197 } 198 } 197 199 } 198 200 … … 232 234 _secFail += _inspSegm; 233 235 _secSucc = 0; 234 if (_secFail > _adviseFail * 60) { 236 if (_secFail > _adviseFail * 60) { 235 237 _secFail = _adviseFail * 60 + 1; 236 238 } … … 248 250 } 249 251 } 250 252 251 253 // End corrupt threshold 252 254 // --------------------- … … 258 260 .addSecs(- _adviseReco * 60) 259 261 .toUTC().time().toString("hh:mm:ss"); 260 emit(newMessage((_staID 261 + ": Recovery threshold exceeded, corruption ended " 262 + _endDateCor + " " + _endTimeCor ).toAscii(), true));263 callScript(("End_Corrupted " 264 + _endDateCor + " " + _endTimeCor + " Begin was "265 + _begDateCor + " " + _begTimeCor ).toAscii());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()); 266 268 _endCorrupt = true; 267 269 _begCorrupt = false; 268 270 _secFail = 0; 269 } 271 } 270 272 else { 271 273 … … 275 277 _begDateCor = _decodeSucc.toUTC().date().toString("yy-MM-dd"); 276 278 _begTimeCor = _decodeSucc.toUTC().time().toString("hh:mm:ss"); 277 emit(newMessage((_staID 278 + ": Failure threshold exceeded, corrupted since " 279 + _begDateCor + " " + _begTimeCor ).toAscii(), true));280 callScript(("Begin_Corrupted " 281 + _begDateCor + " " + _begTimeCor ).toAscii());279 emit(newMessage((_staID 280 + ": Failure threshold exceeded, corrupted since " 281 + _begDateCor + " " + _begTimeCor + " UTC").toAscii(), true)); 282 callScript(("Begin_Corrupted " 283 + _begDateCor + " " + _begTimeCor + " UTC").toAscii()); 282 284 _begCorrupt = true; 283 285 _endCorrupt = false; … … 290 292 } 291 293 292 if (_fromReconnect) {293 _decodeStart = QDateTime::currentDateTime();294 }295 296 294 // End outage threshold 297 295 // -------------------- 296 if (_fromReconnect) { 297 _begDateTimeOut = QDateTime::currentDateTime(); 298 } 299 _fromReconnect = false; 300 298 301 if ( _decodeStart.isValid() ) { 299 if ( _decodeStart.secsTo(QDateTime::currentDateTime()) > _adviseReco * 60 ) { 302 _endDateTimeOut = QDateTime::currentDateTime(); 303 if ( _begDateTimeOut.secsTo(QDateTime::currentDateTime()) > _adviseReco * 60 ) { 304 _endDateOut = _begDateTimeOut.toUTC().date().toString("yy-MM-dd"); 305 _endTimeOut = _begDateTimeOut.toUTC().time().toString("hh:mm:ss"); 306 emit(newMessage((_staID + ": Recovery threshold exceeded, outage ended " 307 + _endDateOut + " " + _endTimeOut + " UTC").toAscii(), true)); 308 callScript(("End_Outage " 309 + _endDateOut + " " + _endTimeOut + " UTC Begin was " 310 + _begDateOut + " " + _begTimeOut + " UTC").toAscii()); 300 311 _decodeStart.setDate(QDate()); 301 312 _decodeStart.setTime(QTime()); 302 _endDateOut = QDateTime::currentDateTime() 303 .addSecs(- _adviseReco * 60) 304 .toUTC().date().toString("yy-MM-dd"); 305 _endTimeOut = QDateTime::currentDateTime() 306 .addSecs(- _adviseReco * 60) 307 .toUTC().time().toString("hh:mm:ss"); 308 emit(newMessage((_staID 309 + ": Recovery threshold exceeded, outage ended " 310 + _endDateOut + " " + _endTimeOut).toAscii(), true)); 311 emit(newMessage((_staID + ": End_Outage " // weber 312 + _endDateOut + " " + _endTimeOut + " Begin was " 313 + _begDateOut + " " + _begTimeOut).toAscii(),true)); 314 callScript(("End_Outage " 315 + _endDateOut + " " + _endTimeOut + " Begin was " 316 + _begDateOut + " " + _begTimeOut).toAscii()); 317 } 318 } 319 _fromReconnect = false; 320 _decodeStop = QDateTime::currentDateTime(); 313 _decodeStop = QDateTime::currentDateTime(); 314 } 315 } 321 316 } 322 317
Note:
See TracChangeset
for help on using the changeset viewer.