Changeset 1562 in ntrip
- Timestamp:
- Feb 2, 2009, 10:42:47 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM/GPSDecoder.h
r1269 r1562 136 136 } 137 137 138 virtual QList<int>* epochList() {return 0;} 139 138 140 struct t_antInfo { 139 141 enum t_type { ARP, APC }; … … 157 159 QList<p_obs> _obsList; 158 160 QList<int> _typeList; // RTCM message types 159 QList<int> _epochList; // Broadcast corrections160 161 QStringList _antType; // RTCM antenna descriptor 161 162 QList<t_antInfo> _antList; // RTCM antenna XYZ -
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r1535 r1562 44 44 45 45 #include "RTCM3Decoder.h" 46 #include "RTCM3coDecoder.h"47 46 #include "bncconst.h" 48 47 #include "bncapp.h" … … 68 67 _checkMountPoint = settings.value("messTypes").toString(); 69 68 _staID = staID; 70 71 // Latency72 _numLat = 0;73 _minLat = 1000.;74 _maxLat = -1000.;75 _sumLat = 0.;76 _sumLatQ = 0.;77 _followSec = false;78 _meanDiff = 0.;79 _diffSecGPS= 0.;80 _numGaps = 0;81 _oldSecGPS = 0.;82 _newSecGPS = 0.;83 _curLat = 0.;84 _perfIntr = 86400;85 if ( settings.value("perfIntr").toString().isEmpty() ) { _perfIntr = 0; }86 if ( settings.value("perfIntr").toString().indexOf("1 min") != -1 ) { _perfIntr = 60; }87 if ( settings.value("perfIntr").toString().indexOf("5 min") != -1 ) { _perfIntr = 300; }88 if ( settings.value("perfIntr").toString().indexOf("15 min") != -1 ) { _perfIntr = 900; }89 if ( settings.value("perfIntr").toString().indexOf("1 hour") != -1 ) { _perfIntr = 3600; }90 if ( settings.value("perfIntr").toString().indexOf("6 hours") != -1 ) { _perfIntr = 21600; }91 if ( settings.value("perfIntr").toString().indexOf("1 day") != -1 ) { _perfIntr = 86400; }92 69 93 70 // Ensure, that the Decoder uses the "old" convention for the data structure for Rinex2. Perlt … … 133 110 if ( _coDecoder->Decode(buffer, bufLen, errmsg) == success ) { 134 111 decoded = true; 135 136 // Latency137 // -------138 if (_perfIntr>0) {139 if (0<_coDecoder->_epochList.size()) {140 for (int ii=0;ii<_coDecoder->_epochList.size();ii++) {141 int week;142 double sec;143 _newSecGPS = _coDecoder->_epochList[ii];144 currentGPSWeeks(week, sec);145 double dt = fabs(sec - _newSecGPS);146 const double secPerWeek = 7.0 * 24.0 * 3600.0;147 if (dt > 0.5 * secPerWeek) {148 if (sec > _newSecGPS) {149 sec -= secPerWeek;150 } else {151 sec += secPerWeek;152 }153 }154 if (_newSecGPS != _oldSecGPS) {155 if (int(_newSecGPS) % _perfIntr < int(_oldSecGPS) % _perfIntr) {156 if (_numLat>0) {157 QString late;158 if (_meanDiff>0.) {159 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs, %6 gaps")160 .arg(int(_sumLat/_numLat*100)/100.)161 .arg(int(_minLat*100)/100.)162 .arg(int(_maxLat*100)/100.)163 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.)164 .arg(_numLat)165 .arg(_numGaps);166 emit(newMessage(QString(_staID + late ).toAscii(), true) );167 } else {168 late = QString(": Mean latency %1 sec, min %2, max %3, rms %4, %5 epochs")169 .arg(int(_sumLat/_numLat*100)/100.)170 .arg(int(_minLat*100)/100.)171 .arg(int(_maxLat*100)/100.)172 .arg(int((sqrt((_sumLatQ - _sumLat * _sumLat / _numLat)/_numLat))*100)/100.)173 .arg(_numLat);174 emit(newMessage(QString(_staID + late ).toAscii(), true) );175 }176 }177 _meanDiff = int(_diffSecGPS)/_numLat;178 _diffSecGPS = 0.;179 _numGaps = 0;180 _sumLat = 0.;181 _sumLatQ = 0.;182 _numLat = 0;183 _minLat = 1000.;184 _maxLat = -1000.;185 }186 if (_followSec) {187 _diffSecGPS += _newSecGPS - _oldSecGPS;188 if (_meanDiff>0.) {189 if (_newSecGPS - _oldSecGPS > 1.5 * _meanDiff) {190 _numGaps += 1;191 }192 }193 }194 _curLat = sec - _newSecGPS;195 _sumLat += _curLat;196 _sumLatQ += _curLat * _curLat;197 if (_curLat < _minLat) {_minLat = _curLat;}198 if (_curLat >= _maxLat) {_maxLat = _curLat;}199 _numLat += 1;200 _oldSecGPS = _newSecGPS;201 _followSec = true;202 }203 }204 }205 }206 112 if (_mode == unknown) { 207 113 _mode = corrections; 208 114 } 209 115 } 210 _coDecoder->_epochList.clear();211 116 } 212 117 … … 360 265 decoded = true; 361 266 gpsephemeris* ep = new gpsephemeris(_Parser.ephemerisGPS); 362 363 #ifdef DEBUG_RTCM2_2021364 QString msg = QString("%1: got eph %2 IODC %3 GPSweek %4 TOC %5 TOE %6")365 .arg(_staID)366 .arg(ep->satellite, 2)367 .arg(ep->IODC, 4)368 .arg(ep->GPSweek, 4)369 .arg(ep->TOC, 6)370 .arg(ep->TOE, 6);371 emit newMessage(msg.toAscii(), false);372 #endif373 374 267 emit newGPSEph(ep); 375 268 } -
trunk/BNC/RTCM3/RTCM3Decoder.h
r1299 r1562 28 28 #include <QtCore> 29 29 #include "../RTCM/GPSDecoder.h" 30 #include "../RTCM/GPSDecoder.h" 31 #include "RTCM3coDecoder.h" 30 32 31 33 extern "C" { 32 34 #include "rtcm3torinex.h" 33 35 } 34 35 class RTCM3coDecoder;36 36 37 37 class RTCM3Decoder : public QObject, public GPSDecoder { … … 41 41 virtual ~RTCM3Decoder(); 42 42 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg); 43 virtual QList<int>* epochList() { 44 return (_coDecoder ? &(_coDecoder->_epochList) : 0); 45 } 43 46 signals: 44 47 void newMessage(QByteArray msg,bool showOnScreen); … … 53 56 RTCM3coDecoder* _coDecoder; 54 57 t_mode _mode; 55 int _perfIntr; 56 int _numLat; 57 int _numGaps; 58 bool _followSec; 59 double _curLat; 60 double _sumLat; 61 double _sumLatQ; 62 double _minLat; 63 double _maxLat; 64 double _newSecGPS; 65 double _oldSecGPS; 66 double _diffSecGPS; 67 double _meanDiff; 68 } ; 58 }; 69 59 70 60 #endif -
trunk/BNC/RTCM3/RTCM3coDecoder.h
r1222 r1562 43 43 virtual ~RTCM3coDecoder(); 44 44 virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg); 45 virtual QList<int>* epochList() {return &_epochList;} 46 QList<int> _epochList; 45 47 46 48 signals: … … 51 53 void printLine(const QString& line, long coTime); 52 54 53 int 54 std::ofstream* 55 QString 56 QString 57 QString 58 QByteArray 59 ClockOrbit 60 Bias 55 int _port; 56 std::ofstream* _out; 57 QString _staID; 58 QString _fileNameSkl; 59 QString _fileName; 60 QByteArray _buffer; 61 ClockOrbit _co; 62 Bias _bias; 61 63 }; 62 64 -
trunk/BNC/bncgetthread.cpp
r1561 r1562 371 371 // ----------- 372 372 vector<string> errmsg; 373 _decoder->Decode(data.data(), data.size(), errmsg);373 t_irc irc = _decoder->Decode(data.data(), data.size(), errmsg); 374 374 375 375 // Perform various scans and checks 376 376 // -------------------------------- 377 _latencyChecker->checkOutage(irc == success); 378 _latencyChecker->checkObsLatency(_decoder->_obsList); 379 _latencyChecker->checkCorrLatency(_decoder->epochList()); 377 380 scanRTCM(); 378 _latencyChecker->check(_decoder->_obsList);379 381 380 382 // Loop over all observations (observations output) -
trunk/BNC/latencychecker.cpp
r1561 r1562 157 157 ////////////////////////////////////////////////////////////////////////////// 158 158 latencyChecker::~latencyChecker() { 159 160 159 } 161 160 162 // Perform latency checks161 // Perform check for outages 163 162 ////////////////////////////////////////////////////////////////////////////// 164 void latencyChecker::check (const QList<p_obs>& obsList) {163 void latencyChecker::checkOutage(bool decoded) { 165 164 166 165 // Check - once per inspect segment 167 166 // -------------------------------- 168 if ( obsList.size() > 0) {167 if (decoded) { 169 168 170 169 _decodeTime = QDateTime::currentDateTime(); … … 244 243 } 245 244 } 246 247 // Latency and completeness 248 // ------------------------ 245 } 246 247 // Perform latency checks (observations) 248 ////////////////////////////////////////////////////////////////////////////// 249 void latencyChecker::checkObsLatency(const QList<p_obs>& obsList) { 250 249 251 if ( _checkMountPoint == _staID || _checkMountPoint == "ALL" ) { 250 252 if (_perfIntr > 0 ) { … … 317 319 if (_curLat < _minLat) { 318 320 _minLat = _curLat; 319 321 } 320 322 if (_curLat >= _maxLat) { 321 323 _maxLat = _curLat; 322 324 } 323 325 _numLat += 1; 324 326 _oldSecGPS = _newSecGPS; … … 328 330 } 329 331 } 332 } 333 334 // Perform latency checks (corrections) 335 ////////////////////////////////////////////////////////////////////////////// 336 void latencyChecker::checkCorrLatency(QList<int>* epochList) { 337 338 if (epochList == 0) { 339 return; 340 } 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; 362 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) ); 380 } 381 } 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; 411 } 412 } 413 } 414 } 415 416 epochList->clear(); 330 417 } 331 418 -
trunk/BNC/latencychecker.h
r1561 r1562 36 36 latencyChecker(QByteArray staID); 37 37 ~latencyChecker(); 38 void check(const QList<p_obs>& obsList); 38 void checkOutage(bool decoded); 39 void checkObsLatency(const QList<p_obs>& obsList); 40 void checkCorrLatency(QList<int>* epochList); 39 41 40 42 signals:
Note:
See TracChangeset
for help on using the changeset viewer.