Changeset 1562 in ntrip for trunk/BNC/RTCM3
- Timestamp:
- Feb 2, 2009, 10:42:47 PM (16 years ago)
- Location:
- trunk/BNC/RTCM3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.