Changeset 3209 in ntrip for trunk/BNC/upload
- Timestamp:
- Mar 30, 2011, 8:39:39 PM (14 years ago)
- Location:
- trunk/BNC/upload
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/upload/bncrtnetdecoder.cpp
r3207 r3209 41 41 #include <iostream> 42 42 #include "bncrtnetdecoder.h" 43 #include "bncutils.h"44 43 #include "bncsettings.h" 45 44 … … 79 78 //////////////////////////////////////////////////////////////////////// 80 79 t_irc bncRtnetDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) { 81 QMutexLocker locker(&_mutex);82 80 errmsg.clear(); 83 81 for (int ic = 0; ic < _casters.size(); ic++) { 84 _casters[ic]->decodeRtnetStream(buffer, bufLen , _eph);82 _casters[ic]->decodeRtnetStream(buffer, bufLen); 85 83 } 86 84 return success; -
trunk/BNC/upload/bncrtnetdecoder.h
r3206 r3209 28 28 #include <fstream> 29 29 #include <QtCore> 30 #include "bncephuser.h"31 #include "bnctime.h"32 30 #include "bncuploadcaster.h" 33 31 #include "RTCM/GPSDecoder.h" 34 32 35 class bncRtnetDecoder: public GPSDecoder , public bncEphUser{33 class bncRtnetDecoder: public GPSDecoder { 36 34 public: 37 35 bncRtnetDecoder(); -
trunk/BNC/upload/bncuploadcaster.cpp
r3208 r3209 182 182 _t0 = settings.value("trafo_t0").toDouble(); 183 183 } 184 185 // Deep copy of ephemerides186 // ------------------------ 187 _eph Map = 0;184 185 // Member that receives the ephemeris 186 // ---------------------------------- 187 _ephUser = new bncEphUser(); 188 188 } 189 189 … … 204 204 wait(); 205 205 } 206 if (_ephMap) {207 QMapIterator<QString, t_eph*> it(*_ephMap);208 while (it.hasNext()) {209 it.next();210 t_eph* eph = it.value();211 delete eph;212 }213 delete _ephMap;214 }215 206 delete _outFile; 216 207 delete _rnx; 217 208 delete _sp3; 209 delete _ephUser; 218 210 } 219 211 … … 306 298 // 307 299 //////////////////////////////////////////////////////////////////////////// 308 void bncUploadCaster::decodeRtnetStream(char* buffer, int bufLen, 309 const QMap<QString, bncEphUser::t_ephPair*>& ephPairMap) { 300 void bncUploadCaster::decodeRtnetStream(char* buffer, int bufLen) { 310 301 311 302 QMutexLocker locker(&_mutex); 312 313 // Delete old ephemeris314 // --------------------315 if (_ephMap) {316 QMapIterator<QString, t_eph*> it(*_ephMap);317 while (it.hasNext()) {318 it.next();319 t_eph* eph = it.value();320 delete eph;321 }322 delete _ephMap;323 }324 _ephMap = new QMap<QString, t_eph*>;325 326 // Make a deep copy of ephemeris327 // -----------------------------328 QMapIterator<QString, bncEphUser::t_ephPair*> it(ephPairMap);329 while (it.hasNext()) {330 it.next();331 bncEphUser::t_ephPair* pair = it.value();332 t_eph* ep = pair->last;333 if (pair->prev && ep &&334 ep->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) {335 ep = pair->prev;336 }337 QString prn(ep->prn().c_str());338 if (prn[0] == 'G') {339 t_ephGPS* epGPS = static_cast<t_ephGPS*>(ep);340 (*_ephMap)[prn] = new t_ephGPS(*epGPS);341 }342 else if (prn[0] == 'R') {343 t_ephGlo* epGlo = static_cast<t_ephGlo*>(ep);344 (*_ephMap)[prn] = new t_ephGlo(*epGlo);345 }346 else if (prn[0] == 'E') {347 t_ephGal* epGal = static_cast<t_ephGal*>(ep);348 (*_ephMap)[prn] = new t_ephGal(*epGal);349 }350 }351 303 352 304 // Append to buffer … … 418 370 } 419 371 420 if ( _ephMap->contains(prn) ) { 421 t_eph* ep = (*_ephMap)[prn]; 372 const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn); 373 if (ephPair) { 374 t_eph* eph = ephPair->last; 375 if (ephPair->prev && 376 eph->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) { 377 eph = ephPair->prev; 378 } 422 379 423 380 in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5) … … 448 405 if (sd) { 449 406 QString outLine; 450 processSatellite(ep, _epoTime.gpsw(), _epoTime.gpssec(), prn, xx, sd, outLine); 407 processSatellite(eph, _epoTime.gpsw(), _epoTime.gpssec(), prn, 408 xx, sd, outLine); 451 409 if (_outFile) { 452 410 _outFile->write(_epoTime.gpsw(), _epoTime.gpssec(), outLine); -
trunk/BNC/upload/bncuploadcaster.h
r3207 r3209 25 25 void deleteSafely(); 26 26 virtual void run(); 27 void decodeRtnetStream(char* buffer, int bufLen, 28 const QMap<QString, bncEphUser::t_ephPair*>& ephMap); 27 void decodeRtnetStream(char* buffer, int bufLen); 29 28 30 29 signals: … … 42 41 void crdTrafo(int GPSWeek, ColumnVector& xyz); 43 42 44 QMap<QString, t_eph*>* _ephMap;45 bool 46 QMutex 47 QString 48 bncTime 43 bncEphUser* _ephUser; 44 bool _isToBeDeleted; 45 QMutex _mutex; 46 QString _rtnetStreamBuffer; 47 bncTime _epoTime; 49 48 QString _mountpoint; 50 49 QString _outHost;
Note:
See TracChangeset
for help on using the changeset viewer.