Changeset 350 in ntrip for trunk/BNC/bncgetthread.cpp
- Timestamp:
- Dec 13, 2006, 10:43:39 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncgetthread.cpp
r349 r350 49 49 #include "bnctabledlg.h" 50 50 #include "bncapp.h" 51 #include "bncutils.h"52 51 53 52 #include "RTCM/RTCM2Decoder.h" … … 61 60 bncGetThread::bncGetThread(const QUrl& mountPoint, 62 61 const QByteArray& format, int iMount) { 63 _decoder = 0; 64 _mountPoint = mountPoint; 65 _staID = mountPoint.path().mid(1).toAscii(); 66 _staID_orig = _staID; 67 _format = format; 68 _socket = 0; 69 _timeOut = 20*1000; // 20 seconds 70 _nextSleep = 1; // 1 second 71 _iMount = iMount; // index in mountpoints array 72 _rinexWriter = 0; 62 _decoder = 0; 63 _mountPoint = mountPoint; 64 _staID = mountPoint.path().mid(1).toAscii(); 65 _staID_orig = _staID; 66 _format = format; 67 _socket = 0; 68 _timeOut = 20*1000; // 20 seconds 69 _nextSleep = 1; // 1 second 70 _iMount = iMount; // index in mountpoints array 73 71 74 72 // Check name conflict … … 89 87 } 90 88 } 91 92 _samplingRate = settings.value("rnxSampl").toInt();93 89 94 90 if (num > 0) { … … 292 288 for (list<Observation*>::iterator it = _decoder->_obsList.begin(); 293 289 it != _decoder->_obsList.end(); it++) { 294 295 // Check observation epoch296 // -----------------------297 int week;298 double sec;299 currentGPSWeeks(week, sec);300 301 const double secPerWeek = 7.0 * 24.0 * 3600.0;302 const double maxDt = 600.0;303 304 if (week < (*it)->GPSWeek) {305 week += 1;306 sec -= secPerWeek;307 }308 if (week > (*it)->GPSWeek) {309 week -= 1;310 sec += secPerWeek;311 }312 double dt = fabs(sec - (*it)->GPSWeeks);313 if (week != (*it)->GPSWeek || dt > maxDt) {314 emit( newMessage("Wrong observation epoch") );315 delete (*it);316 continue;317 }318 319 290 emit newObs(_staID, *it); 320 291 bool firstObs = (it == _decoder->_obsList.begin()); 321 if ( _global_caster->newObs(_staID, firstObs, *it) == 0 ) { 322 323 if (_rinexWriter == 0) { 324 _rinexWriter = new bncRinex((*it)->StatID, _mountPoint, _format); 325 } 326 327 long iSec = long(floor((*it)->GPSWeeks+0.5)); 328 long newTime = (*it)->GPSWeek * 7*24*3600 + iSec; 329 330 if (_samplingRate == 0 || iSec % _samplingRate == 0) { 331 _rinexWriter->deepCopy(*it); 332 } 333 _rinexWriter->dumpEpoch(newTime); 334 } 335 336 292 _global_caster->newObs(_staID, _mountPoint, firstObs, *it, _format); 337 293 } 338 294 _decoder->_obsList.clear();
Note:
See TracChangeset
for help on using the changeset viewer.