Changeset 1095 in ntrip for trunk/BNC/RTCM3
- Timestamp:
- Sep 2, 2008, 1:38:23 PM (16 years ago)
- Location:
- trunk/BNC/RTCM3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r1080 r1095 68 68 QSettings settings; 69 69 _checkMountPoint = settings.value("messTypes").toString(); 70 _corrLate = settings.value("corrLate").toInt();71 70 _staID = staID; 71 72 // Latency 73 _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; } 72 93 73 94 // Ensure, that the Decoder uses the "old" convention for the data structure for Rinex2. Perlt … … 113 134 decoded = true; 114 135 115 // Latency , Weber136 // Latency 116 137 // ------- 117 if ( _corrLate == 2) {138 if (_perfIntr>0) { 118 139 if (0<_coDecoder->_epochList.size()) { 119 140 for (int ii=0;ii<_coDecoder->_epochList.size();ii++) { 120 141 int week; 121 142 double sec; 122 double secGPS = _coDecoder->_epochList[ii];143 _newSecGPS = _coDecoder->_epochList[ii]; 123 144 leapsecGPSWeeks(week, sec); 124 double dt = fabs(sec - secGPS);145 double dt = fabs(sec - _newSecGPS); 125 146 const double secPerWeek = 7.0 * 24.0 * 3600.0; 126 147 if (dt > 0.5 * secPerWeek) { 127 if (sec > secGPS) {148 if (sec > _newSecGPS) { 128 149 sec -= secPerWeek; 129 150 } else { … … 131 152 } 132 153 } 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() ) ); 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; 137 202 } 138 203 } -
trunk/BNC/RTCM3/RTCM3Decoder.h
r1080 r1095 50 50 QString _staID; 51 51 QString _checkMountPoint; 52 int _corrLate;53 52 struct RTCM3ParserData _Parser; 54 53 RTCM3coDecoder* _coDecoder; 55 54 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; 56 68 } ; 57 69
Note:
See TracChangeset
for help on using the changeset viewer.