Changeset 408 in ntrip
- Timestamp:
- Feb 26, 2007, 6:15:18 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnccaster.cpp
r397 r408 92 92 if (_waitTime < 1) { 93 93 _waitTime = 1; 94 }95 96 if ( settings.value("rnxPath").toString().isEmpty() ) {97 _rinexWriters = 0;98 }99 else {100 _rinexWriters = new QMap<QString, bncRinex*>;101 94 } 102 95 … … 123 116 delete _sockets; 124 117 delete _epochs; 125 delete _rinexWriters;126 }127 128 // Reconnecting129 ////////////////////////////////////////////////////////////////////////////130 void bncCaster::reconnecting(const QByteArray& staID) {131 QMutexLocker locker(&_mutex);132 133 if (_rinexWriters && _rinexWriters->find(staID) != _rinexWriters->end()) {134 bncRinex* rnx = _rinexWriters->find(staID).value();135 rnx->setReconnectFlag(true);136 }137 118 } 138 119 139 120 // New Observations 140 121 //////////////////////////////////////////////////////////////////////////// 141 void bncCaster::newObs(const QByteArray& staID, const QUrl& mountPoint, 142 bool firstObs, Observation* obs, 143 const QByteArray& format, 144 const QByteArray& latitude, 145 const QByteArray& longitude, 146 const QByteArray& nmea) { 122 void bncCaster::newObs(const QByteArray& staID, bool firstObs, 123 Observation* obs) { 147 124 148 125 QMutexLocker locker(&_mutex); … … 157 134 obs->StatID[sizeof(obs->StatID)-1] = '\0'; 158 135 159 // Prepare RINEX Output160 // --------------------161 if (_rinexWriters) {162 if (_rinexWriters->find(obs->StatID) == _rinexWriters->end()) {163 _rinexWriters->insert(obs->StatID, new bncRinex(obs->StatID, mountPoint,164 format, latitude, longitude, nmea));165 }166 bncRinex* rnx = _rinexWriters->find(obs->StatID).value();167 if (_samplingRate == 0 || iSec % _samplingRate == 0) {168 rnx->deepCopy(obs);169 }170 rnx->dumpEpoch(_newTime);171 }172 173 136 // First time, set the _lastDumpSec immediately 174 137 // -------------------------------------------- -
trunk/BNC/bnccaster.h
r393 r408 32 32 33 33 #include "RTCM/GPSDecoder.h" 34 #include "bncrinex.h"35 34 36 35 class bncGetThread; … … 44 43 void addGetThread(bncGetThread* getThread); 45 44 int numStations() const {return _staIDs.size();} 46 void newObs(const QByteArray& staID, const QUrl& mountPoint, 47 bool firstObs, Observation* obs, const QByteArray& format, 48 const QByteArray& latitude, const QByteArray& longitude, 49 const QByteArray& nmea); 50 void reconnecting(const QByteArray& staID); 45 void newObs(const QByteArray& staID, bool firstObs, Observation* obs); 51 46 52 47 signals: … … 70 65 QList<QTcpSocket*>* _sockets; 71 66 QList<QByteArray> _staIDs; 72 QMap<QString, bncRinex*>* _rinexWriters;73 67 QList<bncGetThread*> _threads; 74 68 int _samplingRate; -
trunk/BNC/bncgetthread.cpp
r406 r408 51 51 #include "bncapp.h" 52 52 #include "bncutils.h" 53 #include "bncrinex.h" 53 54 54 55 #include "RTCM/RTCM2Decoder.h" … … 100 101 _staID = _staID.left(_staID.length()-1) + QString("%1").arg(num).toAscii(); 101 102 } 103 104 // RINEX writer 105 // ------------ 106 _samplingRate = settings.value("rnxSampl").toInt(); 107 if ( settings.value("rnxPath").toString().isEmpty() ) { 108 _rnx = 0; 109 } 110 else { 111 _rnx = new bncRinex(_staID, mountPoint, format, latitude, longitude, nmea); 112 } 113 102 114 msleep(100); //sleep 0.1 sec 103 115 } … … 382 394 emit newObs(_staID, *it); 383 395 bool firstObs = (it == _decoder->_obsList.begin()); 384 _global_caster->newObs(_staID, _mountPoint, firstObs, *it, _format, _latitude, _longitude, _nmea); 396 _global_caster->newObs(_staID, firstObs, *it); 397 398 // RINEX Output 399 // ------------ 400 if (_rnx) { 401 long iSec = long(floor((*it)->GPSWeeks+0.5)); 402 long newTime = (*it)->GPSWeek * 7*24*3600 + iSec; 403 if (_samplingRate == 0 || iSec % _samplingRate == 0) { 404 _rnx->deepCopy(*it); 405 } 406 _rnx->dumpEpoch(newTime); 407 } 408 385 409 } 386 410 _decoder->_obsList.clear(); … … 411 435 //////////////////////////////////////////////////////////////////////////// 412 436 void bncGetThread::tryReconnect() { 413 _global_caster->reconnecting(_staID); 437 if (_rnx) { 438 _rnx->setReconnectFlag(true); 439 } 414 440 while (1) { 415 441 delete _socket; _socket = 0; -
trunk/BNC/bncgetthread.h
r406 r408 32 32 #include "RTCM/GPSDecoder.h" 33 33 #include "bncconst.h" 34 35 class bncRinex; 34 36 35 37 class bncGetThread : public QThread { … … 75 77 int _iMount; 76 78 bool _zeroDecoder; 79 int _samplingRate; 80 bncRinex* _rnx; 77 81 }; 78 82 -
trunk/BNC/bncrinex.cpp
r391 r408 61 61 // Constructor 62 62 //////////////////////////////////////////////////////////////////////////// 63 bncRinex::bncRinex(const char* StatID, const QUrl& mountPoint,63 bncRinex::bncRinex(const QByteArray& statID, const QUrl& mountPoint, 64 64 const QByteArray& format, const QByteArray& latitude, 65 65 const QByteArray& longitude, const QByteArray& nmea) { 66 _statID = StatID;66 _statID = statID; 67 67 _mountPoint = mountPoint; 68 68 _format = format.left(6); -
trunk/BNC/bncrinex.h
r369 r408 38 38 class bncRinex { 39 39 public: 40 bncRinex(const char* StatID, const QUrl& mountPoint,40 bncRinex(const QByteArray& statID, const QUrl& mountPoint, 41 41 const QByteArray& format, const QByteArray& latitude, 42 42 const QByteArray& longitude, const QByteArray& nmea);
Note:
See TracChangeset
for help on using the changeset viewer.