Changeset 1563 in ntrip
- Timestamp:
- Feb 3, 2009, 11:05:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/latencychecker.cpp
r1562 r1563 340 340 } 341 341 342 if (_perfIntr > 0) { 343 if (0 < epochList->size()) { 344 for (int ii = 0; ii < epochList->size(); ii++) { 345 int week; 346 double sec; 347 _newSecGPS = epochList->at(ii); 348 currentGPSWeeks(week, sec); 349 double dt = fabs(sec - _newSecGPS); 350 const double secPerWeek = 7.0 * 24.0 * 3600.0; 351 if (dt > 0.5 * secPerWeek) { 352 if (sec > _newSecGPS) { 353 sec -= secPerWeek; 354 } else { 355 sec += secPerWeek; 356 } 357 } 358 if (_newSecGPS != _oldSecGPS) { 359 if (int(_newSecGPS) % _perfIntr < int(_oldSecGPS) % _perfIntr) { 360 if (_numLat>0) { 361 QString late; 342 if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) { 343 if (_perfIntr > 0) { 344 if (0 < epochList->size()) { 345 for (int ii = 0; ii < epochList->size(); ii++) { 346 int week; 347 double sec; 348 _newSecGPS = epochList->at(ii); 349 currentGPSWeeks(week, sec); 350 double dt = fabs(sec - _newSecGPS); 351 const double secPerWeek = 7.0 * 24.0 * 3600.0; 352 if (dt > 0.5 * secPerWeek) { 353 if (sec > _newSecGPS) { 354 sec -= secPerWeek; 355 } else { 356 sec += secPerWeek; 357 } 358 } 359 if (_newSecGPS != _oldSecGPS) { 360 if (int(_newSecGPS) % _perfIntr < int(_oldSecGPS) % _perfIntr) { 361 if (_numLat>0) { 362 QString late; 363 if (_meanDiff>0.) { 364 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs, %6 gaps") 365 .arg(int(_sumLat/_numLat*100)/100.) 366 .arg(int(_minLat*100)/100.) 367 .arg(int(_maxLat*100)/100.) 368 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.) 369 .arg(_numLat) 370 .arg(_numGaps); 371 emit(newMessage(QString(_staID + late ).toAscii(), true) ); 372 } 373 else { 374 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs") 375 .arg(int(_sumLat/_numLat*100)/100.) 376 .arg(int(_minLat*100)/100.) 377 .arg(int(_maxLat*100)/100.) 378 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.) 379 .arg(_numLat); 380 emit(newMessage(QString(_staID + late ).toAscii(), true) ); 381 } 382 } 383 _meanDiff = int(_diffSecGPS)/_numLat; 384 _diffSecGPS = 0; 385 _numGaps = 0; 386 _sumLat = 0.0; 387 _sumLatQ = 0.0; 388 _numLat = 0; 389 _minLat = 1000.; 390 _maxLat = -1000.; 391 } 392 if (_followSec) { 393 _diffSecGPS += _newSecGPS - _oldSecGPS; 362 394 if (_meanDiff>0.) { 363 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs, %6 gaps") 364 .arg(int(_sumLat/_numLat*100)/100.) 365 .arg(int(_minLat*100)/100.) 366 .arg(int(_maxLat*100)/100.) 367 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.) 368 .arg(_numLat) 369 .arg(_numGaps); 370 emit(newMessage(QString(_staID + late ).toAscii(), true) ); 371 } 372 else { 373 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs") 374 .arg(int(_sumLat/_numLat*100)/100.) 375 .arg(int(_minLat*100)/100.) 376 .arg(int(_maxLat*100)/100.) 377 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.) 378 .arg(_numLat); 379 emit(newMessage(QString(_staID + late ).toAscii(), true) ); 395 if (_newSecGPS - _oldSecGPS > 1.5 * _meanDiff) { 396 _numGaps += 1; 397 } 380 398 } 381 399 } 382 _meanDiff = int(_diffSecGPS)/_numLat; 383 _diffSecGPS = 0; 384 _numGaps = 0; 385 _sumLat = 0.0; 386 _sumLatQ = 0.0; 387 _numLat = 0; 388 _minLat = 1000.; 389 _maxLat = -1000.; 390 } 391 if (_followSec) { 392 _diffSecGPS += _newSecGPS - _oldSecGPS; 393 if (_meanDiff>0.) { 394 if (_newSecGPS - _oldSecGPS > 1.5 * _meanDiff) { 395 _numGaps += 1; 396 } 397 } 398 } 399 _curLat = sec - _newSecGPS; 400 _sumLat += _curLat; 401 _sumLatQ += _curLat * _curLat; 402 if (_curLat < _minLat) { 403 _minLat = _curLat; 404 } 405 if (_curLat >= _maxLat) { 406 _maxLat = _curLat; 407 } 408 _numLat += 1; 409 _oldSecGPS = _newSecGPS; 410 _followSec = true; 400 _curLat = sec - _newSecGPS; 401 _sumLat += _curLat; 402 _sumLatQ += _curLat * _curLat; 403 if (_curLat < _minLat) { 404 _minLat = _curLat; 405 } 406 if (_curLat >= _maxLat) { 407 _maxLat = _curLat; 408 } 409 _numLat += 1; 410 _oldSecGPS = _newSecGPS; 411 _followSec = true; 412 } 411 413 } 412 414 }
Note:
See TracChangeset
for help on using the changeset viewer.