Changeset 3635 in ntrip for trunk/BNC/bncpppclient.cpp
- Timestamp:
- Jan 23, 2012, 2:54:50 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncpppclient.cpp
r3521 r3635 48 48 #include "bncconst.h" 49 49 #include "bncmodel.h" 50 #include " bncsettings.h"50 #include "pppopt.h" 51 51 52 52 using namespace std; … … 54 54 // Constructor 55 55 //////////////////////////////////////////////////////////////////////////// 56 bncPPPclient::bncPPPclient(QByteArray staID) { 57 58 bncSettings settings; 59 60 if ( Qt::CheckState(settings.value("pppGLONASS").toInt()) == Qt::Checked) { 61 _useGlonass = true; 56 bncPPPclient::bncPPPclient(QByteArray staID, t_pppOpt* opt) { 57 58 if (opt) { 59 _opt = opt; 60 _optOwner = false; 62 61 } 63 62 else { 64 _useGlonass = false; 65 } 66 67 if ( Qt::CheckState(settings.value("pppGalileo").toInt()) == Qt::Checked) { 68 _useGalileo = true; 69 } 70 else { 71 _useGalileo = false; 72 } 73 74 if (settings.value("pppSPP").toString() == "PPP") { 75 _pppMode = true; 76 } 77 else { 78 _pppMode = false; 79 } 63 _opt = new t_pppOpt(); 64 _optOwner = true; 65 } 66 67 _staID = staID; 68 _model = new bncModel(staID); 80 69 81 70 connect(this, SIGNAL(newMessage(QByteArray,bool)), … … 85 74 this, SLOT(slotNewCorrections(QList<QString>))); 86 75 87 _staID = staID;88 _model = new bncModel(staID);89 76 connect(_model, SIGNAL(newNMEAstr(QByteArray)), 90 77 this, SIGNAL(newNMEAstr(QByteArray))); 91 92 _pppCorrMount = settings.value("pppCorrMount").toString();93 78 } 94 79 … … 111 96 delete ib.value(); 112 97 } 98 if (_optOwner) { 99 delete _opt; 100 } 113 101 } 114 102 … … 119 107 120 108 if (obs.satSys == 'R') { 121 if (!_ useGlonass) return;109 if (!_opt->useGlonass) return; 122 110 } 123 111 else if (obs.satSys == 'E') { 124 if (!_ useGalileo) return;112 if (!_opt->useGalileo) return; 125 113 } 126 114 else if (obs.satSys != 'G') { … … 265 253 // Check the Mountpoint (source of corrections) 266 254 // -------------------------------------------- 267 if (!_ pppCorrMount.isEmpty()) {255 if (!_opt->pppCorrMount.isEmpty()) { 268 256 QMutableListIterator<QString> itm(corrList); 269 257 while (itm.hasNext()) { … … 271 259 if (hlp.size() > 0) { 272 260 QString mountpoint = hlp[hlp.size()-1]; 273 if (mountpoint != _ pppCorrMount) {261 if (mountpoint != _opt->pppCorrMount) { 274 262 itm.remove(); 275 263 } … … 368 356 if (_eph.contains(prn)) { 369 357 370 if (_ pppMode) {358 if (_opt->pppMode) { 371 359 if (_corr.contains(prn)) { 372 360 t_corr* cc = _corr.value(prn); … … 483 471 void bncPPPclient::processEpochs() { 484 472 485 // Synchronization threshold (not used in SPP mode)486 // ------------------------------------------------487 bncSettings settings;488 double maxDt = settings.value("pppSync").toDouble();489 if (!_pppMode) {490 maxDt = 0.0;491 }492 493 473 // Make sure the buffer does not grow beyond any limit 494 474 // --------------------------------------------------- … … 507 487 // No corrections yet, skip the epoch 508 488 // ---------------------------------- 509 if ( maxDt!= 0.0 && !_corr_tt.valid()) {489 if (_opt->corrSync != 0.0 && !_corr_tt.valid()) { 510 490 return; 511 491 } … … 513 493 // Process the front epoch 514 494 // ----------------------- 515 if ( maxDt == 0 || frontEpoData->tt - _corr_tt < maxDt) {495 if (_opt->corrSync == 0 || frontEpoData->tt - _corr_tt < _opt->corrSync) { 516 496 processFrontEpoch(); 517 497 delete _epoData.front();
Note:
See TracChangeset
for help on using the changeset viewer.