Changeset 1080 in ntrip
- Timestamp:
- Aug 30, 2008, 12:15:14 AM (16 years ago)
- Location:
- trunk/BNC/RTCM3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r1079 r1080 68 68 QSettings settings; 69 69 _checkMountPoint = settings.value("messTypes").toString(); 70 _corrLate = settings.value("corrLate").toInt(); 70 71 _staID = staID; 71 72 // Latency73 _numLat = 0;74 _minLat = 1000.;75 _maxLat = -1000.;76 _sumLat = 0.;77 _sumLatQ = 0.;78 _followSec = false;79 _meanDiff = 0.;80 _diffSecGPS= 0.;81 _numGaps = 0;82 _oldSecGPS = 0.;83 _newSecGPS = 0.;84 _curLat = 0.;85 _perfIntr = 86400;86 if ( settings.value("perfIntr").toString().isEmpty() ) { _perfIntr = 0; }87 if ( settings.value("perfIntr").toString().indexOf("1 min") != -1 ) { _perfIntr = 60; }88 if ( settings.value("perfIntr").toString().indexOf("5 min") != -1 ) { _perfIntr = 300; }89 if ( settings.value("perfIntr").toString().indexOf("15 min") != -1 ) { _perfIntr = 900; }90 if ( settings.value("perfIntr").toString().indexOf("1 hour") != -1 ) { _perfIntr = 3600; }91 if ( settings.value("perfIntr").toString().indexOf("6 hours") != -1 ) { _perfIntr = 21600; }92 if ( settings.value("perfIntr").toString().indexOf("1 day") != -1 ) { _perfIntr = 86400; }93 72 94 73 // Ensure, that the Decoder uses the "old" convention for the data structure for Rinex2. Perlt … … 134 113 decoded = true; 135 114 136 // Latency 115 // Latency, Weber 137 116 // ------- 138 if ( _perfIntr>0) {117 if ( _corrLate == 2 ) { 139 118 if (0<_coDecoder->_epochList.size()) { 140 119 for (int ii=0;ii<_coDecoder->_epochList.size();ii++) { 141 120 int week; 142 121 double sec; 143 _newSecGPS = _coDecoder->_epochList[ii];122 double secGPS = _coDecoder->_epochList[ii]; 144 123 leapsecGPSWeeks(week, sec); 145 double dt = fabs(sec - _newSecGPS);124 double dt = fabs(sec - secGPS); 146 125 const double secPerWeek = 7.0 * 24.0 * 3600.0; 147 126 if (dt > 0.5 * secPerWeek) { 148 if (sec > _newSecGPS) {127 if (sec > secGPS) { 149 128 sec -= secPerWeek; 150 129 } else { … … 152 131 } 153 132 } 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() ) ); 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() ) ); 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; 133 QString late; 134 late = QString("%1 ").arg(int((sec - secGPS)*100.)/100.); 135 if (late != "") { 136 emit(newMessage(QString(_staID + ": Latency " + late + "sec").toAscii() ) ); 202 137 } 203 138 } -
trunk/BNC/RTCM3/RTCM3Decoder.h
r1079 r1080 50 50 QString _staID; 51 51 QString _checkMountPoint; 52 int _corrLate; 52 53 struct RTCM3ParserData _Parser; 53 54 RTCM3coDecoder* _coDecoder; 54 55 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 56 } ; 69 57
Note:
See TracChangeset
for help on using the changeset viewer.