Changeset 9504 in ntrip for trunk/BNC/src
- Timestamp:
- Sep 24, 2021, 2:34:28 PM (3 years ago)
- Location:
- trunk/BNC/src/PPP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppFilter.cpp
r9491 r9504 34 34 //////////////////////////////////////////////////////////////////////////// 35 35 t_pppFilter::t_pppFilter(t_pppObsPool* obsPool) { 36 _parlist = 0;37 36 _numSat = 0; 38 37 _obsPool = obsPool; … … 44 43 //////////////////////////////////////////////////////////////////////////// 45 44 t_pppFilter::~t_pppFilter() { 46 delete _parlist;47 45 delete _datumTrafo; 48 46 } … … 53 51 _numSat = 0; 54 52 const double maxSolGap = 60.0; 55 56 if (!_parlist) {57 _parlist = new t_pppParlist();58 }59 53 60 54 // Vector of all Observations … … 78 72 string epoTimeStr = string(_epoTime); 79 73 74 if (OPT->_obsModelType == OPT->DCMcodeBias || 75 OPT->_obsModelType == OPT->DCMphaseBias) { 76 // Save parameters of epoch before 77 _parlist_sav = _parlist; 78 } 79 80 80 //-- 81 81 // Set Parameters 82 // -------------- 83 if (_parlist->set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) { 82 if (_parlist.set(_epoTime, allObs, _obsPool->getRefSatMap()) != success) { 84 83 return failure; 85 84 } 86 const vector<t_pppParam*>& params = _parlist->params(); 85 86 const vector<t_pppParam*>& params = _parlist.params(); 87 87 #ifdef BNC_DEBUG_PPP 88 for ( unsignediPar = 0; iPar < params.size(); iPar++) {89 LOG << params[iPar]->toString() << endl;88 for (int iPar = 0; iPar < params.size(); iPar++) { 89 LOG << "available par " << params[iPar]->toString() << endl; 90 90 } 91 91 #endif … … 96 96 SymmetricMatrix QFltOld = _QFlt; 97 97 98 _QFlt.ReSize(_parlist ->nPar()); _QFlt = 0.0;99 _xFlt.ReSize(_parlist ->nPar()); _xFlt = 0.0;100 _x0.ReSize(_parlist ->nPar()); _x0 = 0.0;98 _QFlt.ReSize(_parlist.nPar()); _QFlt = 0.0; 99 _xFlt.ReSize(_parlist.nPar()); _xFlt = 0.0; 100 _x0.ReSize(_parlist.nPar()); _x0 = 0.0; 101 101 102 102 for (unsigned ii = 0; ii < params.size(); ii++) { … … 130 130 OPT->_obsModelType == OPT->DCMphaseBias) { 131 131 preProcessing = true; 132 QList<char>& usedSystems = _parlist->usedSystems();132 const QList<char>& usedSystems = _parlist.usedSystems(); 133 133 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 134 134 char sys = usedSystems[iSys]; … … 155 155 _xFlt = xFltOld; 156 156 _QFlt = QFltOld; 157 _parlist = _parlist_sav; 157 158 return success; 158 159 } … … 165 166 // ------------------------------------ 166 167 preProcessing = false; 167 QList<char>& usedSystems = _parlist->usedSystems();168 const QList<char>& usedSystems = _parlist. usedSystems(); 168 169 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 169 170 char sys = usedSystems[iSys]; … … 195 196 // ---------------------- 196 197 cmpDOP(allObs); 197 _parlist ->printResult(_epoTime, _QFlt, _xFlt);198 _parlist.printResult(_epoTime, _QFlt, _xFlt); 198 199 _lastEpoTimeOK = _epoTime; // remember time of last successful epoch processing 199 200 if (OPT->_refSatRequired) { 200 201 _obsPool->saveLastEpoRefSats(); 201 _datumTrafo->setLastEpoParlist(_parlist);202 202 } 203 203 return success; … … 226 226 SymmetricMatrix QSav = _QFlt; 227 227 string epoTimeStr = string(_epoTime); 228 const vector<t_pppParam*>& params = _parlist ->params();228 const vector<t_pppParam*>& params = _parlist.params(); 229 229 230 230 unsigned usedLCs = LCs.size(); … … 256 256 // First-Design Matrix, Terms Observed-Computed, Weight Matrix 257 257 // ----------------------------------------------------------- 258 Matrix AA(maxObs, _parlist ->nPar());258 Matrix AA(maxObs, _parlist.nPar()); 259 259 ColumnVector ll(maxObs); 260 260 DiagonalMatrix PP(maxObs); PP = 0.0; … … 318 318 (!preProcessing)) { 319 319 _datumTrafo->updateIndices(sys, iObs+1); 320 _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist ->nPar()), 1);320 _datumTrafo->prepareAA(AA.SubMatrix(1, iObs+1 , 1, _parlist.nPar()), 1); 321 321 } 322 322 … … 460 460 char sys = refPrn.system(); 461 461 string epoTimeStr = string(_epoTime); 462 const vector<t_pppParam*>& params = _parlist ->params();462 const vector<t_pppParam*>& params = _parlist.params(); 463 463 464 464 for (unsigned ii = 0; ii < LCs.size(); ii++) { … … 542 542 543 543 t_irc irc = failure; 544 vector<t_pppParam*>& params = _parlist ->params();544 vector<t_pppParam*>& params = _parlist.params(); 545 545 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 546 546 t_pppParam* par = params[iPar]; … … 579 579 580 580 t_irc irc = failure; 581 vector<t_pppParam*>& params = _parlist ->params();581 vector<t_pppParam*>& params = _parlist.params(); 582 582 for (unsigned iPar = 0; iPar < params.size(); iPar++) { 583 583 t_pppParam* par = params[iPar]; … … 614 614 ++_numSat; 615 615 for (unsigned iPar = 0; iPar < numPar; iPar++) { 616 const t_pppParam* par = _parlist ->params()[iPar];616 const t_pppParam* par = _parlist.params()[iPar]; 617 617 AA[_numSat-1][iPar] = par->partial(_epoTime, obs, t_lc::c1, refPrn); 618 618 } … … 640 640 void t_pppFilter::predictCovCrdPart(const SymmetricMatrix& QFltOld) { 641 641 642 const vector<t_pppParam*>& params = _parlist ->params();642 const vector<t_pppParam*>& params = _parlist.params(); 643 643 if (params.size() < 3) { 644 644 return; … … 705 705 // set AA2 706 706 // ======= 707 t_pppParlist* parlist = _datumTrafo->lastEpoParlist(); 708 if (parlist->set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) { 707 if (_parlist.set(epoch->epoTime(), allObs, _obsPool->getRefSatMap()) != success) { 709 708 return failure; 710 709 } 711 vector<t_pppParam*>& params = parlist->params();712 unsigned nPar = parlist->nPar();710 const vector<t_pppParam*>& _params = _parlist.params(); 711 unsigned nPar = _parlist.nPar(); 713 712 #ifdef BNC_DEBUG_PPP 714 713 LOG << " parameters of last epoch" << endl; 715 714 for (unsigned iPar = 0; iPar < nPar; iPar++) { 716 LOG << params[iPar]->toString() << "\t\t" << endl;715 LOG << _params[iPar]->toString() << "\t\t" << endl; 717 716 } 718 717 #endif 719 QList<char>& usedSystems = _parlist->usedSystems();718 const QList<char>& usedSystems = _parlist.usedSystems(); 720 719 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 721 720 char sys = usedSystems[iSys]; … … 760 759 if (tLC == t_lc::Tz0) {continue;} 761 760 ++iObs; 762 for (unsigned iPar = 0; iPar < params.size(); iPar++) {763 const t_pppParam* par = params[iPar];761 for (unsigned iPar = 0; iPar < _params.size(); iPar++) { 762 const t_pppParam* par = _params[iPar]; 764 763 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn); 765 764 } … … 778 777 ++iObs; 779 778 pseudoObsTropoConsidered = true; 780 for (unsigned iPar = 0; iPar < params.size(); iPar++) {781 const t_pppParam* par = params[iPar];779 for (unsigned iPar = 0; iPar < _params.size(); iPar++) { 780 const t_pppParam* par = _params[iPar]; 782 781 AA[iObs][iPar] = par->partial(_epoTime, obs, tLC, refPrn); 783 782 } … … 836 835 _datumTrafo->switchAA(); 837 836 838 // save parameter list839 // ====================840 _datumTrafo->setLastEpoParlist(_parlist);841 837 return success; 842 838 } … … 847 843 bool pseudoObsIono) { 848 844 unsigned trafoObs = 0; 849 QList<char>& usedSystems = _parlist->usedSystems();845 const QList<char>& usedSystems = _parlist. usedSystems(); 850 846 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 851 847 char sys = usedSystems[iSys]; … … 875 871 } 876 872 _datumTrafo->setNumObs(trafoObs); 877 _datumTrafo->setNumPar(_parlist ->nPar());873 _datumTrafo->setNumPar(_parlist.nPar()); 878 874 _datumTrafo->initAA(); 879 875 } … … 884 880 bool resetRefSat; 885 881 // reference satellite definition per system 886 QList<char>& usedSystems = _parlist->usedSystems();882 const QList<char>& usedSystems = _parlist.usedSystems(); 887 883 for (int iSys = 0; iSys < usedSystems.size(); iSys++) { 888 884 resetRefSat = false; -
trunk/BNC/src/PPP/pppFilter.h
r9433 r9504 36 36 double GDOP() const {return _dop.G;} 37 37 double trp() const { 38 const std::vector<t_pppParam*>& par = _parlist ->params();38 const std::vector<t_pppParam*>& par = _parlist.params(); 39 39 for (unsigned ii = 0; ii < par.size(); ++ii) { 40 40 if (par[ii]->type() == t_pppParam::trp) { … … 45 45 }; 46 46 double trpStdev() const { 47 const std::vector<t_pppParam*>& par = _parlist ->params();47 const std::vector<t_pppParam*>& par = _parlist.params(); 48 48 for (unsigned ii = 0; ii < par.size(); ++ii) { 49 49 if (par[ii]->type() == t_pppParam::trp) { … … 91 91 _firstRow = _lastRow + 1; 92 92 } 93 _lastRow += maxObsSys;//LOG << "updateIndices: lastRow: " << _lastRow << endl;93 _lastRow += maxObsSys;//LOG << sys << " updateIndices: lastRow: " << _lastRow << "\n" ; 94 94 }; 95 95 … … 110 110 _AA2 = _AA2.SubMatrix(1, _lastRow, 1, _numPar); 111 111 } 112 113 void setLastEpoParlist(t_pppParlist* parlist) {_parlist = parlist;}114 t_pppParlist* lastEpoParlist() {return _parlist;}115 112 116 113 const Matrix& AA1() {return _AA1;} … … 161 158 int _numPar; 162 159 QMap<char, t_prn> _refSatMapPseudoObs; 163 t_pppParlist* _parlist;164 160 }; 165 161 … … 187 183 188 184 bncTime _epoTime; 189 t_pppParlist* _parlist; 185 t_pppParlist _parlist; 186 t_pppParlist _parlist_sav; 190 187 t_pppObsPool* _obsPool; 191 188 t_datumTrafo* _datumTrafo; -
trunk/BNC/src/PPP/pppParlist.cpp
r9498 r9504 35 35 //////////////////////////////////////////////////////////////////////////// 36 36 t_pppParam::t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, 37 const vector<t_pppSatObs*>* obsVector) {37 const vector<t_pppSatObs*>* obsVector) { 38 38 39 39 _type = type; … … 132 132 } 133 133 134 // 135 //////////////////////////////////////////////////////////////////////////// 136 t_pppParam::t_pppParam(const t_pppParam* old) { 137 _type = old->type(); 138 _prn = old->prn(); 139 _tLC = old->tLC(); 140 _indexOld = old->indexOld(); 141 _indexNew = old->indexNew(); 142 _noise = old->noise(); 143 _sigma0 = old->sigma0(); 144 _epoSpec = old->epoSpec(); 145 _ambInfo = 0; 146 if (_type == t_pppParam::amb) { 147 _ambInfo = new t_ambInfo(); 148 _ambInfo->_resetCandidate = old->_ambInfo->_resetCandidate; 149 _ambInfo->_eleSat = old->_ambInfo->_eleSat; 150 _ambInfo->_numEpo = old->_ambInfo->_numEpo; 151 _x0 = x0(); 152 } else { 153 cout << endl; 154 } 155 } 156 134 157 // Destructor 135 158 //////////////////////////////////////////////////////////////////////////// 136 159 t_pppParam::~t_pppParam() { 137 delete _ambInfo; 138 } 139 160 if (_ambInfo) { 161 delete _ambInfo; 162 } 163 } 140 164 // 141 165 //////////////////////////////////////////////////////////////////////////// … … 353 377 //////////////////////////////////////////////////////////////////////////// 354 378 t_pppParlist::~t_pppParlist() { 355 for (unsigned ii = 0; ii < _params.size(); ii++) { 356 delete _params[ii]; 357 } 379 _usedSystems.clear(); 380 381 vector<t_pppParam*>::iterator it = _params.begin(); 382 while (it != _params.end()) { 383 t_pppParam* par = *it; 384 delete par; 385 it = _params.erase(it); 386 } 387 } 388 389 // 390 //////////////////////////////////////////////////////////////////////////// 391 t_pppParlist::t_pppParlist(const t_pppParlist& old) { 392 393 _usedSystems = old._usedSystems; 394 395 vector<t_pppParam*>::const_iterator it = old.params().begin(); 396 while (it != old.params().end()) { 397 const t_pppParam* oldParam = *it; 398 _params.push_back(new t_pppParam(oldParam)); 399 } 400 } 401 402 // 403 //////////////////////////////////////////////////////////////////////////// 404 const t_pppParlist& t_pppParlist::operator= (const t_pppParlist& p) { 405 406 _usedSystems.clear(); 407 408 _usedSystems = p._usedSystems; 409 410 vector<t_pppParam*>::iterator it = _params.begin(); 411 while (it != _params.end()) { 412 t_pppParam* par = *it; 413 delete par; 414 it = _params.erase(it); 415 } 416 417 for (unsigned jj = 0; jj < p.params().size(); jj++) { 418 t_pppParam* parFrom = p.params()[jj]; 419 _params.push_back(new t_pppParam(parFrom)); 420 } 421 return *this; 358 422 } 359 423 … … 685 749 t_pppParam* parY = 0; 686 750 t_pppParam* parZ = 0; 687 for (unsigned ii = 0; ii < _params.size(); ii++) { 688 t_pppParam* par = _params[ii]; 751 vector<t_pppParam*>::const_iterator it = _params.begin(); 752 while (it != _params.end()) { 753 t_pppParam* par = *it; 689 754 if (par->type() == t_pppParam::crdX) { 690 755 parX = par; … … 710 775 LOG << endl; 711 776 } 777 ++it; 712 778 } 713 779 -
trunk/BNC/src/PPP/pppParlist.h
r9431 r9504 20 20 21 21 t_pppParam(e_type type, const t_prn& prn, t_lc::type tLC, const std::vector<t_pppSatObs*>* obsVector = 0); 22 22 t_pppParam(const t_pppParam* old); 23 23 ~t_pppParam(); 24 24 … … 71 71 return false; 72 72 } 73 73 74 74 private: 75 75 class t_ambInfo { … … 103 103 t_pppParlist(); 104 104 ~t_pppParlist(); 105 105 t_pppParlist(const t_pppParlist& old); 106 const t_pppParlist&operator= (const t_pppParlist& p); 106 107 t_irc set(const bncTime& epoTime, const std::vector<t_pppSatObs*>& obsVector, 107 108 const QMap<char, t_pppRefSat*>& refSatMap); … … 109 110 const std::vector<t_pppParam*>& params() const {return _params;} 110 111 std::vector<t_pppParam*>& params() {return _params;} 111 QList<char>& usedSystems(){return _usedSystems;}112 const QList<char>& usedSystems() const {return _usedSystems;} 112 113 void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ, 113 114 const ColumnVector& xx) const;
Note:
See TracChangeset
for help on using the changeset viewer.