Changeset 9386 in ntrip for trunk/BNC/src/PPP/pppClient.cpp
- Timestamp:
- Mar 25, 2021, 3:17:35 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/PPP/pppClient.cpp
r9288 r9386 309 309 } 310 310 if (!std::isnan(maxRes) && maxRes < BLUNDER) { 311 if (print ) {311 if (print && _numEpoProcessing == 1) { 312 312 LOG.setf(ios::fixed); 313 313 LOG << string(epoTime) << " BANCROFT:" << ' ' … … 370 370 offGR = 0.0; 371 371 } 372 373 if (fabs(maxRes) > 1000.0) { 372 if (fabs(maxRes) > OPT->_aprSigOGC) { 374 373 LOG << "t_pppClient::cmpOffGR outlier " << maxResPrn.toString() << " " << maxRes << endl; 375 374 delete obsVector.at(maxResIndex); … … 424 423 } 425 424 426 if (fabs(maxRes) > 1000.0) {425 if (fabs(maxRes) > OPT->_aprSigOGE) { 427 426 LOG << "t_pppClient::cmpOffGE outlier " << maxResPrn.toString() << " " << maxRes << endl; 428 427 delete obsVector.at(maxResIndex); … … 477 476 } 478 477 479 if (fabs(maxRes) > 1000.0) {478 if (fabs(maxRes) > OPT->_aprSigOGC) { 480 479 LOG << "t_pppClient::cmpOffGC outlier " << maxResPrn.toString() << " " << maxRes << endl; 481 480 delete obsVector.at(maxResIndex); … … 529 528 _output->_trpStdev = _filter->trpStdev(); 530 529 531 _output->_numSat 532 _output->_hDop 530 _output->_numSat = _filter->numSat(); 531 _output->_hDop = _filter->HDOP(); 533 532 _output->_error = false; 534 533 } … … 593 592 void t_pppClient::processEpoch(const vector<t_satObs*>& satObs, t_output* output) { 594 593 595 _historicalRefSats.clear();596 594 try { 597 595 initOutput(output); 598 int num = 0;599 596 bool epochReProcessing = false; 600 597 _numEpoProcessing = 0; 601 598 do { 602 num++; 603 if (num == 1) { 604 LOG << "\nPPP of Epoch "; 605 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover); 606 LOG << "\n---------------------------------------------------------------\n"; 607 } 608 599 _numEpoProcessing++; 600 if (_obsPool->refSatChanged()) { 601 if(_filter->datumTransformation() != success) { 602 return finish(failure); 603 } 604 else { 605 _obsPool->saveLastEpoRefSats(); 606 } 607 } 609 608 // Prepare Observations of the Rover 610 609 // --------------------------------- 611 610 if (prepareObs(satObs, _obsRover, _epoTimeRover) != success) { 612 611 return finish(failure); 612 } 613 614 if (_numEpoProcessing == 1) { 615 LOG << "\nPPP of Epoch "; 616 if (!_epoTimeRover.undef()) LOG << string(_epoTimeRover); 617 LOG << "\n---------------------------------------------------------------\n"; 613 618 } 614 619 … … 624 629 } 625 630 631 if (_opt->_refSatRequired) { 632 if (handleRefSatellites(_obsRover) != success) { 633 _historicalRefSats.clear(); 634 return finish(failure); 635 } 636 if (_obsPool->refSatChanged()) { 637 epochReProcessing = true; 638 continue; 639 } 640 } 641 626 642 _offGR = cmpOffGR(_obsRover); 627 643 _offGE = cmpOffGE(_obsRover); 628 644 _offGC = cmpOffGC(_obsRover); 629 645 630 if (_opt->_refSatRequired) {631 setRefSatellites(_obsRover);632 LOG.setf(ios::fixed);633 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap());634 while (it.hasNext()) {635 it.next();636 char sys = it.key();637 string prn = it.value()->prn().toString();638 if (num == 1) {639 LOG << "set ";640 }641 else {642 LOG << "reset ";643 }644 LOG << string(_epoTimeRover) << " REFSAT " << sys << ": " << prn << endl;645 }646 }647 648 649 646 // Prepare Pseudo Observations of the Rover 650 647 // ---------------------------------------- … … 656 653 } 657 654 658 659 655 // Store last epoch of data 660 656 // ------------------------ 661 657 _obsPool->putEpoch(_epoTimeRover, _obsRover, _pseudoObsIono); 662 _obsPool->setHistoricalRefSatList(_historicalRefSats);663 658 664 659 // Process Epoch in Filter 665 660 // ----------------------- 666 if (_filter->processEpoch( num) != success) {661 if (_filter->processEpoch() != success) { 667 662 return finish(failure); 668 663 } … … 670 665 // Epoch re-processing required? 671 666 // ----------------------------- 672 if (_obsPool->refSatChangeRequired()) { 667 if (_obsPool->refSatChangeRequired()) {//SLIP 673 668 epochReProcessing = true; 674 669 _obsPool->deleteLastEpoch(); 675 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap()); 676 while (it.hasNext()) { 677 it.next(); 678 _historicalRefSats.append(it.value()->prn()); 679 } 670 setHistoricalRefSats(); 680 671 } 681 672 else { 682 673 epochReProcessing = false; 683 674 _historicalRefSats.clear(); 684 675 } 685 676 } while (epochReProcessing); … … 789 780 // reference satellite definition per system 790 781 for (unsigned iSys = 0; iSys < _opt->systems().size(); iSys++) { 791 char sys tem= _opt->systems()[iSys];782 char sys = _opt->systems()[iSys]; 792 783 bool refSatDefined = false; 793 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys tem);784 t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys); 794 785 for (unsigned ii = 0; ii < obsVector.size(); ii++) { 795 786 t_pppSatObs* satObs = obsVector.at(ii); 796 if (satObs->eleSat() < _opt->_minEle) {continue;} 787 if (satObs->eleSat() < _opt->_minEle) { 788 continue; 789 } 797 790 // reference satellite is unchanged 798 if (!_obsPool->refSatChangeRequired( ) &&refSat->prn() == satObs->prn()) {791 if (!_obsPool->refSatChangeRequired(sys) && refSat->prn() == satObs->prn()) { 799 792 refSatDefined = true; 800 793 obsVector[ii]->setAsReference(); 794 #ifdef BNC_DEBUG_PPP 795 LOG << "=> unchanged refsatprn: " << satObs->prn().toString() << endl; 796 #endif 801 797 } 802 798 // reference satellite has changed 803 else if ( _obsPool->refSatChangeRequired() && refSat->prn() != satObs->prn() && !_historicalRefSats.contains(satObs->prn())) { 804 if (satObs->prn().system() == system) { 799 else if ( _obsPool->refSatChangeRequired(sys) && 800 refSat->prn() != satObs->prn() && 801 !_historicalRefSats[sys].contains(satObs->prn())) { 802 if (satObs->prn().system() == sys) { 805 803 refSatDefined = true; 806 804 obsVector[ii]->setAsReference(); 807 805 refSat->setPrn(satObs->prn()); 806 #ifdef BNC_DEBUG_PPP 807 LOG << "=> set refsatprn: " << satObs->prn().toString() << endl; 808 #endif 808 809 } 809 810 } … … 822 823 continue; 823 824 } 824 if (satObs->prn().system() == system) { 825 if (satObs->prn().system() == sys && 826 !_historicalRefSats[sys].contains(satObs->prn())) { 825 827 obsVector[ii]->setAsReference(); 826 828 refSat->setPrn(satObs->prn()); 829 #ifdef BNC_DEBUG_PPP 830 LOG << " => set refsatprn: " << satObs->prn().toString() << endl; 831 #endif 827 832 if (OPT->_pseudoObsIono) { 828 833 refSat->setStecValue(satObs->getIonoCodeDelay(t_frequency::G1)); … … 833 838 } 834 839 } 835 } 836 _obsPool->setRefSatChangeRequired(false); 837 840 if (!refSatDefined) { 841 refSat->setPrn(t_prn()); 842 } 843 _obsPool->setRefSatChangeRequired(sys, false); 844 } 845 } 846 847 // 848 ////////////////////////////////////////////////////////////////////////////// 849 t_irc t_pppClient::handleRefSatellites(std::vector<t_pppSatObs*>& obsVector) { 850 851 // set refSats in current epoch 852 // ============================ 853 setRefSatellites(obsVector); // current epoch 854 LOG.setf(ios::fixed); 855 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap()); 856 while (it.hasNext()) { 857 it.next(); 858 char sys = it.key(); 859 t_prn prn = it.value()->prn(); 860 if (prn.number() == 0) { 861 return failure; 862 } 863 QString str; 864 if (prn == _obsPool->getRefSatMapElementLastEpoch(sys) || 865 _obsPool->getRefSatMapElementLastEpoch(sys) == t_prn() ) { 866 _obsPool->setRefSatChanged(sys, false); 867 str = " SET "; 868 } 869 else { 870 _obsPool->setRefSatChanged(sys, true); 871 str = " RESET "; 872 } 873 LOG << string(_epoTimeRover) << str.toStdString() << " REFSAT " << sys << ": " << prn.toString() << endl; 874 } 875 return success; 876 } 877 878 void t_pppClient::setHistoricalRefSats() { 879 QMapIterator<char, t_pppRefSat*> it(_obsPool->getRefSatMap()); 880 while (it.hasNext()) { 881 it.next(); 882 t_prn prn = it.value()->prn(); 883 char sys = prn.system(); 884 if (_obsPool->refSatChangeRequired(sys)){ 885 _historicalRefSats[sys].append(prn); 886 } 887 } 838 888 } 839 889
Note:
See TracChangeset
for help on using the changeset viewer.