Changeset 9598 in ntrip for trunk/BNC/src/PPP


Ignore:
Timestamp:
Jan 12, 2022, 2:14:56 PM (3 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

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

    r9596 r9598  
    6565  // Select pseudo-ranges and phase observations
    6666  // -------------------------------------------
    67   string preferredAttrib = "G:12&WCPSLX R:12&PC E:1&CBX E:5&QIX C:26&IQX";
     67
     68  QString preferredAttribList = "G:12&CWPSLX R:12&CP E:1&CBX E:5&QIX C:26&IQX";
    6869  if (OPT->_obsModelType == OPT->DCMcodeBias ||
    6970      OPT->_obsModelType == OPT->DCMphaseBias) {
    70     // at the moment only one code or phase bias per system (G,R,E,C)/modulation considered,
    71     preferredAttrib = "G:12&W R:12&P E:1&CX E:5&QX C:26&I";
    72   }
    73 
     71    // at the moment only one code or phase bias per system (G,R,E,C)/modulation considered
     72    preferredAttribList = "G:12&CW R:12&CP E:1&CX E:5&QX C:26&I";
     73  }
     74  QStringList priorList = preferredAttribList.split(" ", QString::SkipEmptyParts);
     75  string preferredAttrib;
     76  char obsSys = pppSatObs._prn.system();  //cout << "SATELLITE: " << pppSatObs._prn.toString() << endl;
    7477  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
    75     string frqNum = t_frequency::toString(t_frequency::type(iFreq)).substr(1);
    76     for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
    77       string obsType = (preferredAttrib[iPref] == '_') ? frqNum : frqNum + preferredAttrib[iPref];
    78       if (_obs[iFreq] == 0) {
    79         for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
    80           const t_frqObs* obs = pppSatObs._obs[ii];
    81           if (obs->_rnxType2ch == obsType &&
    82               obs->_codeValid && obs->_code &&
    83               obs->_phaseValid && obs->_phase &&
    84               obs->_lockTimeValid &&  obs->_lockTime > 5.0)   {
    85             _obs[iFreq] = new t_frqObs(*obs);
     78    t_frequency::type frqType = static_cast<t_frequency::type>(iFreq);
     79    char frqSys = t_frequency::toString(frqType)[0]; //cout << "frqSys: " << frqSys << endl;
     80    char frqNum = t_frequency::toString(frqType)[1]; //cout << "frqNum: " << frqNum << endl;
     81    if (obsSys != frqSys) {
     82      continue;
     83    }
     84    QStringList hlp;
     85    for (int ii = 0; ii < priorList.size(); ii++) {
     86      if (priorList[ii].indexOf(":") != -1) {
     87        hlp = priorList[ii].split(":", QString::SkipEmptyParts);
     88        if (hlp.size() == 2 && hlp[0].length() == 1 && hlp[0][0] == frqSys) {
     89          hlp = hlp[1].split("&", QString::SkipEmptyParts);
     90        }
     91        if (hlp.size() == 2 && hlp[0].indexOf(frqNum) != -1) {
     92          preferredAttrib = hlp[1].toStdString(); //cout << "preferredAttrib: " << preferredAttrib << endl;
     93        }
     94      }
     95      for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
     96        QString obsType = QString("%1").arg(frqNum) + preferredAttrib[iPref];  //cout << "obstype: " << obsType.toStdString().c_str() << endl;
     97        if (_obs[iFreq] == 0) {
     98          for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
     99            const t_frqObs* obs = pppSatObs._obs[ii];
     100            //cout << "observation2char: " << obs->_rnxType2ch << " vs. " << obsType.toStdString().c_str()<< endl;
     101            if (obs->_rnxType2ch == obsType.toStdString() &&
     102                obs->_codeValid && obs->_code &&
     103                obs->_phaseValid && obs->_phase &&
     104                obs->_lockTimeValid &&  obs->_lockTime > 5.0) {
     105              _obs[iFreq] = new t_frqObs(*obs); //cout << "================> newObs: " << obs->_rnxType2ch <<endl;
     106            }
    86107          }
    87108        }
     
    436457    for (unsigned ii = 0; ii < t_frequency::max; ii++) {
    437458      t_frequency::type frqType = static_cast<t_frequency::type>(ii);
     459      string frqStr = t_frequency::toString(frqType);
     460      if (frqStr[0] != _prn.system()) {continue;}
    438461      bool found;
    439462      QString prn(_prn.toString().c_str());
     
    470493      const t_frqCodeBias& bias = satCodeBias->_bias[ii];
    471494      for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     495        string frqStr = t_frequency::toString(t_frequency::type(iFreq));
     496        if (frqStr[0] != _prn.system()) {
     497          continue;
     498        }
    472499        const t_frqObs* obs = _obs[iFreq];
    473500        if (obs && obs->_rnxType2ch == bias._rnxType2ch) {
     
    493520      const t_frqPhaseBias& bias = satPhaseBias->_bias[ii];
    494521      for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     522        string frqStr = t_frequency::toString(t_frequency::type(iFreq));
     523        if (frqStr[0] != _prn.system()) {
     524          continue;
     525        }
    495526        const t_frqObs* obs = _obs[iFreq];
    496527        if (obs && obs->_rnxType2ch == bias._rnxType2ch) {
     
    561592  LOG << "\nMODEL for Satellite " << _prn.toString() << (isReference() ? " (Reference Satellite)" : "")
    562593
    563       << "======================= " << endl
     594      << "\n======================= " << endl
    564595     << "PPP STRATEGY  : " <<  OPT->_obsmodelTypeStr.at((int)OPT->_obsModelType).toLocal8Bit().constData()
    565596      <<  ((OPT->_pseudoObsIono) ? " with pseudo-observations for STEC" : "")          << endl
     
    584615      if (_prn.system() == frqStr[0]) {
    585616      LOG << "PCO           : " << frqStr << setw(12) << setprecision(3) << _model._antPCO[iFreq]       << endl
    586           << "BIAS CODE     : " << frqStr << setw(12) << setprecision(3) << _model._codeBias[iFreq]     << endl
    587           << "BIAS PHASE    : " << frqStr << setw(12) << setprecision(3) << _model._phaseBias[iFreq]    << endl
     617          << "BIAS CODE     : " << frqStr << setw(12) << setprecision(3) << _model._codeBias[iFreq]     << "\t(" << _obs[iFreq]->_rnxType2ch[1] << ") " << endl
     618          << "BIAS PHASE    : " << frqStr << setw(12) << setprecision(3) << _model._phaseBias[iFreq]    << "\t(" << _obs[iFreq]->_rnxType2ch[1] << ") " << endl
    588619          << "IONO CODEDELAY: " << frqStr << setw(12) << setprecision(3) << _model._ionoCodeDelay[iFreq]<< endl;
    589620      }
Note: See TracChangeset for help on using the changeset viewer.