Changeset 10225 in ntrip for trunk/BNC/src
- Timestamp:
- Oct 17, 2023, 2:01:48 PM (13 months ago)
- Location:
- trunk/BNC/src/combination
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/combination/bnccomb.cpp
r10224 r10225 448 448 // ----------------------------------------------------- 449 449 for (int ii = 0; ii < clkCorrections.size(); ii++) { 450 t_clkCorr* newClk = new t_clkCorr(clkCorrections[ii]); 451 452 char sys = newClk->_prn.system(); 450 t_clkCorr& newClk = clkCorrections[ii]; 451 char sys = newClk._prn.system(); 453 452 if (!_cmbSysPrn.contains(sys)){ 454 delete newClk;455 453 continue; 456 454 } … … 458 456 // Check Modulo Time 459 457 // ----------------- 460 int sec = int(nint(newClk ->_time.gpssec()*10));458 int sec = int(nint(newClk._time.gpssec()*10)); 461 459 if (sec % (_cmbSampl*10) != 0.0) { 462 delete newClk;463 460 continue; 464 461 } … … 468 465 QString acName; 469 466 bool isAPC; 470 QString staID(newClk ->_staID.c_str());467 QString staID(newClk._staID.c_str()); 471 468 QListIterator<cmbAC*> icAC(_ACs); 472 469 while (icAC.hasNext()) { … … 479 476 } 480 477 if (acName.isEmpty() || isAPC != _masterIsAPC[sys]) { 481 delete newClk;482 478 continue; 483 479 } … … 486 482 // ---------------------------- 487 483 if (BNC_CORE->mode() != t_bncCore::batchPostProcessing) { 488 if ((newClk ->_time >= currentTime) || // future time stamp489 (currentTime - newClk ->_time) > 60.0) { // very old data sets484 if ((newClk._time >= currentTime) || // future time stamp 485 (currentTime - newClk._time) > 60.0) { // very old data sets 490 486 #ifdef BNC_DEBUG_CMB 491 emit newMessage("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk ->_prn.toString().c_str() +492 QString(" %1 ").arg(newClk ->_time.timestr().c_str()).toLatin1() + "vs. current time" +487 emit newMessage("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() + 488 QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. current time" + 493 489 QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1(), true); 494 490 #endif 495 delete newClk;496 491 continue; 497 492 } … … 500 495 // Check Correction Age 501 496 // -------------------- 502 if (_resTime.valid() && newClk ->_time <= _resTime) {497 if (_resTime.valid() && newClk._time <= _resTime) { 503 498 #ifdef BNC_DEBUG_CMB 504 emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + newClk ->_prn.toString().c_str() +505 QString(" %1 ").arg(newClk ->_time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" +499 emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() + 500 QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" + 506 501 QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1(), true); 507 502 #endif 508 delete newClk;509 503 continue; 510 504 } … … 512 506 // Set the last time 513 507 // ----------------- 514 if (_lastClkCorrTime.undef() || newClk ->_time > _lastClkCorrTime) {515 _lastClkCorrTime = newClk ->_time;508 if (_lastClkCorrTime.undef() || newClk._time > _lastClkCorrTime) { 509 _lastClkCorrTime = newClk._time; 516 510 } 517 511 … … 521 515 deque<epoClkData*>::const_iterator it; 522 516 for (it = _epoClkData.begin(); it != _epoClkData.end(); it++) { 523 if (newClk ->_time == (*it)->_time) {517 if (newClk._time == (*it)->_time) { 524 518 epoch = *it; 525 519 break; … … 527 521 } 528 522 if (epoch == 0) { 529 if (_epoClkData.empty() || newClk ->_time > _epoClkData.back()->_time) {523 if (_epoClkData.empty() || newClk._time > _epoClkData.back()->_time) { 530 524 epoch = new epoClkData; 531 epoch->_time = newClk ->_time;525 epoch->_time = newClk._time; 532 526 _epoClkData.push_back(epoch); 533 527 } … … 538 532 if (epoch != 0) { 539 533 epoch->_clkCorr.push_back(newClk); 540 }541 else {542 delete newClk;543 534 } 544 535 } … … 560 551 } 561 552 562 const vector<t_clkCorr *>& clkCorrVec = _epoClkData.front()->_clkCorr;553 const vector<t_clkCorr>& clkCorrVec = _epoClkData.front()->_clkCorr; 563 554 564 555 bncTime epoTime = _epoClkData.front()->_time; … … 625 616 corr->_orbCorr._xr += dRAO; 626 617 corr->_orbCorr._dotXr += dDotRAO; 627 corr->_clkCorr ->_dClk -= dC;618 corr->_clkCorr._dClk -= dC; 628 619 } 629 620 630 621 // Process Epoch 631 622 //////////////////////////////////////////////////////////////////////////// 632 void bncComb::processEpoch(bncTime epoTime, const vector<t_clkCorr *>& clkCorrVec) {623 void bncComb::processEpoch(bncTime epoTime, const vector<t_clkCorr>& clkCorrVec) { 633 624 634 625 for (unsigned ii = 0; ii < clkCorrVec.size(); ii++) { 635 t_clkCorr* clkCorr = clkCorrVec.at(ii);636 QString staID(clkCorr ->_staID.c_str());637 QString prn(clkCorr ->_prn.toInternalString().c_str());638 char sys = clkCorr ->_prn.system();626 const t_clkCorr& clkCorr = clkCorrVec[ii]; 627 QString staID(clkCorr._staID.c_str()); 628 QString prn(clkCorr._prn.toInternalString().c_str()); 629 char sys = clkCorr._prn.system(); 639 630 640 631 // Find/Check the AC Name … … 656 647 cmbCorr* newCorr = new cmbCorr(); 657 648 newCorr->_prn = prn; 658 newCorr->_time = clkCorr ->_time;659 newCorr->_iod = clkCorr ->_iod;649 newCorr->_time = clkCorr._time; 650 newCorr->_iod = clkCorr._iod; 660 651 newCorr->_acName = acName; 661 652 newCorr->_weightFactor = weigthFactor; … … 670 661 else { 671 662 QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName]; 672 if (!storage.contains(clkCorr ->_prn) ||673 storage[clkCorr ->_prn]._iod != newCorr->_iod) {663 if (!storage.contains(clkCorr._prn) || 664 storage[clkCorr._prn]._iod != newCorr->_iod) { 674 665 delete newCorr; 675 666 continue; 676 667 } 677 668 else { 678 newCorr->_orbCorr = storage[clkCorr ->_prn];669 newCorr->_orbCorr = storage[clkCorr._prn]; 679 670 } 680 671 } … … 686 677 if (ephLast == 0) { 687 678 #ifdef BNC_DEBUG_CMB 688 //emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1(), true);679 emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1(), true); 689 680 #endif 690 681 delete newCorr; … … 695 686 ephLast->checkState() == t_eph::unhealthy) { 696 687 #ifdef BNC_DEBUG_CMB 697 //emit newMessage("bncComb: ephLast not ok (checkState: " + ephLast->checkStateToString().toLatin1() + ") for " + prn.mid(0,3).toLatin1(), true);688 emit newMessage("bncComb: ephLast not ok (checkState: " + ephLast->checkStateToString().toLatin1() + ") for " + prn.mid(0,3).toLatin1(), true); 698 689 #endif 699 690 delete newCorr; … … 711 702 else { 712 703 #ifdef BNC_DEBUG_CMB 713 //emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1() +714 //QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true);704 emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1() + 705 QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true); 715 706 #endif 716 707 delete newCorr; … … 723 714 if (_satCodeBiases.contains(acName)) { 724 715 QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName]; 725 if (storage.contains(clkCorr ->_prn)) {726 newCorr->_satCodeBias = storage[clkCorr ->_prn];716 if (storage.contains(clkCorr._prn)) { 717 newCorr->_satCodeBias = storage[clkCorr._prn]; 727 718 QMap<t_frequency::type, double> codeBiasesRefSig; 728 719 for (unsigned ii = 1; ii < cmbRefSig::cIF; ii++) { … … 1046 1037 1047 1038 // CLOCK 1048 t_clkCorr clkCorr( static_cast<t_clkCorr>(*corr->_clkCorr));1039 t_clkCorr clkCorr(corr->_clkCorr); 1049 1040 clkCorr._staID = "INTERNAL"; 1050 1041 clkCorr._dClk = corr->_dClkResult; … … 1186 1177 } 1187 1178 1188 ll(iObs) = (corr->_clkCorr ->_dClk * t_CST::c - corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0);1179 ll(iObs) = (corr->_clkCorr._dClk * t_CST::c - corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0); 1189 1180 1190 1181 PP(iObs, iObs) *= 1.0 / (corr->_weightFactor * corr->_weightFactor); -
trunk/BNC/src/combination/bnccomb.h
r10224 r10225 99 99 cmbCorr() { 100 100 _eph = 0; 101 _clkCorr = 0;102 101 _iod = 0; 103 102 _dClkResult = 0.0; … … 106 105 } 107 106 ~cmbCorr() { 108 109 107 } 110 108 QString _prn; … … 113 111 t_eph* _eph; 114 112 t_orbCorr _orbCorr; 115 t_clkCorr *_clkCorr;113 t_clkCorr _clkCorr; 116 114 t_satCodeBias _satCodeBias; 117 115 QString _acName; … … 142 140 epoClkData() {} 143 141 ~epoClkData() { 144 for (unsigned ii = 0; ii < _clkCorr.size(); ii++) { 145 delete _clkCorr[ii]; 146 } 142 _clkCorr.erase(_clkCorr.begin(), _clkCorr.end()); 147 143 } 148 144 bncTime _time; 149 std::vector<t_clkCorr *> _clkCorr;145 std::vector<t_clkCorr> _clkCorr; 150 146 }; 151 147 … … 231 227 }; 232 228 233 void processEpoch(bncTime epoTime, const std::vector<t_clkCorr *>& clkCorrVec);229 void processEpoch(bncTime epoTime, const std::vector<t_clkCorr>& clkCorrVec); 234 230 void processSystem(bncTime epoTime, char sys, QTextStream& out); 235 231 t_irc processEpoch_filter(bncTime epoTime, char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr, ColumnVector& dx);
Note:
See TracChangeset
for help on using the changeset viewer.