Changeset 9431 in ntrip for trunk/BNC/src/PPP/pppFilter.cpp


Ignore:
Timestamp:
May 18, 2021, 5:15:10 PM (3 years ago)
Author:
stuerze
Message:

update regarding PPP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppFilter.cpp

    r9421 r9431  
    130130      OPT->_obsModelType == OPT->DCMphaseBias) {
    131131    preProcessing = true;
    132     unsigned usableSys = 0;
    133     for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    134       char sys = OPT->systems()[iSys];
     132    QList<char>& usedSystems = _parlist->usedSystems();
     133    for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     134      char sys = usedSystems[iSys];
    135135      _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
    136136     vector<t_pppSatObs*> obsVector;
     
    140140        }
    141141      }
    142       if (!obsVector.size()) {
    143         continue;
    144       }
    145       else {
    146         ++usableSys;
    147         if (usableSys == 1) {
    148           _datumTrafo->setFirstSystem(sys);
    149         }
     142      if (iSys == 0) {
     143        _datumTrafo->setFirstSystem(sys);
    150144      }
    151145      if (processSystem(OPT->LCs(sys), obsVector, _refPrn,
     
    171165  // ------------------------------------
    172166  preProcessing = false;
    173   unsigned usableSys = 0;
    174   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    175     char sys = OPT->systems()[iSys];
     167  QList<char>& usedSystems = _parlist-> usedSystems();
     168  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     169    char sys = usedSystems[iSys];
    176170    if (OPT->_refSatRequired) {
    177171      _refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
     
    188182      }
    189183    }
    190     if (!num) {
    191       continue;
    192     }
    193     else {
    194       ++usableSys;
    195       if (usableSys == 1 &&
    196           OPT->_obsModelType == OPT->UncombPPP) {
    197         _datumTrafo->setFirstSystem(sys);
    198       }
     184    if (iSys == 0 && OPT->_obsModelType == OPT->UncombPPP) {
     185      _datumTrafo->setFirstSystem(sys);
    199186    }
    200187    LOG << epoTimeStr << " SATNUM " << sys << ' ' << right << setw(2) << num << endl;
     
    299286          PP[iObs] = 1.0 / (obs->sigma(tLC) * obs->sigma(tLC));
    300287        }
     288      }
     289    }
     290    if (OPT->_obsModelType == OPT->DCMcodeBias ||
     291        OPT->_obsModelType == OPT->DCMphaseBias) {
     292      if (iObs < 2) { // TODO SATNUM => usableSys has to be removed
     293        return failure;
    301294      }
    302295    }
     
    394387      t_pppSatObs* obs = usedObs[maxOutlierIndex];
    395388      t_pppParam* par = 0;
    396 #ifdef BNC_DEBUG_PPP
    397389      LOG << epoTimeStr << " Outlier ("
    398390          << ((preProcessing) ? "pre-processing) " : "fin-processing) ") << t_lc::toString(maxOutlierLC) << ' '
    399391          << obs->prn().toString()                        << ' '
    400392          << setw(8) << setprecision(4) << maxOutlier << endl;
    401 #endif
    402393      for (unsigned iPar = 0; iPar < params.size(); iPar++) {
    403394        t_pppParam* hlp = params[iPar];
     
    710701  // =============================================================
    711702  if (resetRefSatellitesLastEpoch(allObs) != true) {
    712     LOG  << "resetRefSatellitesLastEpoch = failure" << endl;
    713     return failure;
     703    LOG  << "refsatChange required" << endl;
     704    return success;
    714705  }
    715706
     
    725716  }
    726717  vector<t_pppParam*>& params = parlist->params();
     718  unsigned nPar = parlist->nPar();
    727719#ifdef BNC_DEBUG_PPP
    728720  LOG << " parameters of last epoch" << endl;
    729   for (unsigned iPar = 0; iPar < params.size(); iPar++) {
     721  for (unsigned iPar = 0; iPar < nPar; iPar++) {
    730722    LOG << params[iPar]->toString() << "\t\t" << endl;
    731723  }
    732724#endif
    733   unsigned nPar = parlist->nPar();
    734   unsigned usableSys = 0;
    735   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    736     char sys = OPT->systems()[iSys];
     725  QList<char>& usedSystems = _parlist->usedSystems();
     726  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     727    char sys = usedSystems[iSys];
    737728    t_prn refPrn = (_obsPool->getRefSatMapElement(sys))->prn();
    738729    vector<t_pppSatObs*> obsVector;
     
    742733      }
    743734    }
    744     if (!obsVector.size()) {
    745       continue;
    746     }
    747     else {
    748       ++usableSys;
    749       if (usableSys == 1) {
    750         _datumTrafo->setFirstSystem(sys);
    751       }
     735    if (iSys == 0) {
     736      _datumTrafo->setFirstSystem(sys);
    752737    }
    753738    vector<t_lc::type> LCs = OPT->LCs(sys);
     
    839824  // Reset Ambiguities after Datum Transformation
    840825  // ============================================
    841   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    842     char sys = OPT->systems()[iSys];
     826  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     827    char sys = usedSystems[iSys];
    843828    t_prn refPrnOld = _obsPool->getRefSatMapElementLastEpoch(sys);
    844829    t_prn refPrnNew = (_obsPool->getRefSatMapElement(sys))->prn();
     
    868853                                          bool pseudoObsIono) {
    869854  unsigned trafoObs = 0;
    870   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    871     char sys = OPT->systems()[iSys];
     855  QList<char>& usedSystems = _parlist-> usedSystems();
     856  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     857    char sys = usedSystems[iSys];
    872858    int satNum = 0;
    873859    for (unsigned jj = 0; jj < allObs.size(); jj++) {
     
    875861        satNum++;
    876862      }
    877     }
    878     if (!satNum) {
    879       continue;
    880863    }
    881864    // all LCs
     
    905888//////////////////////////////////////////////////////////////////////////////
    906889bool t_pppFilter::resetRefSatellitesLastEpoch(std::vector<t_pppSatObs*>& obsVector) {
    907 
    908   bool resetRefSat = false;
     890  bool resetRefSat;
    909891  // reference satellite definition per system
    910   for (unsigned iSys = 0; iSys < OPT->systems().size(); iSys++) {
    911     char sys = OPT->systems()[iSys];
     892  QList<char>& usedSystems = _parlist-> usedSystems();
     893  for (int iSys = 0; iSys < usedSystems.size(); iSys++) {
     894    resetRefSat = false;
     895    char sys = usedSystems[iSys];
    912896    t_pppRefSat* refSat = _obsPool->getRefSatMapElement(sys);
    913897    t_prn newPrn = refSat->prn();
     
    928912     it++;
    929913    }
     914    if (!resetRefSat) {
     915      _obsPool->setRefSatChangeRequired(sys, true);
     916      return resetRefSat;
     917    }
    930918  }
    931919  return resetRefSat;
Note: See TracChangeset for help on using the changeset viewer.