Changeset 6147 in ntrip


Ignore:
Timestamp:
Sep 13, 2014, 8:31:24 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncrinex.cpp

    r6139 r6147  
    597597string bncRinex::rinexSatLine(const t_satObs& obs, char lli1, char lli2, char lli5) {
    598598  ostringstream str;
    599 ////  str.setf(ios::showpoint | ios::fixed);
    600 ////
    601 ////  if (_header._version >= 3.0) {
    602 ////    str << obs._prn;
    603 ////  }
    604 ////
    605 ////  const QVector<QString>& types = _header._obsTypes[obs._prn.system()];
    606 ////  for (int ii = 0; ii < types.size(); ii++) {
    607 ////    if (_header._version < 3.0 && ii > 0 && ii % 5 == 0) {
    608 ////      str << endl;
    609 ////    }
    610 ////    for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
    611 ////      const t_frqObs*     frqObs   = obs._obs[iFrq];
    612 ////
    613 ////
    614 ////    double value = obs.measdata(types[ii], _header._version);
    615 ////    str << setw(14) << setprecision(3) << value;
    616 ////    if      (value != 0.0 && types[ii].indexOf("L1") == 0) {
    617 ////      str << lli1 << ' ';
    618 ////    }
    619 ////    else if (value != 0.0 && types[ii].indexOf("L2") == 0) {
    620 ////      str << lli2 << ' ';
    621 ////    }
    622 ////    else if (value != 0.0 && types[ii].indexOf("L5") == 0) {
    623 ////      str << lli5 << ' ';
    624 ////    }
    625 ////    else {
    626 ////      str << "  ";
    627 ////    }
    628 ////  }
     599  str.setf(ios::showpoint | ios::fixed);
     600
     601  if (_header._version >= 3.0) {
     602    str << obs._prn;
     603  }
     604
     605  const QString obsKinds = "LCDS";
     606
     607  char sys = obs._prn.system();
     608  const QVector<QString>& types = _header._obsTypes[sys];
     609  for (int ii = 0; ii < types.size(); ii++) {
     610    if (_header._version < 3.0 && ii > 0 && ii % 5 == 0) {
     611      str << endl;
     612    }
     613    double  obsValue = 0.0;
     614    char    lli      = ' ';
     615    QString rnxType = types[ii];
     616    for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
     617      const t_frqObs* frqObs = obs._obs[iFrq];
     618      for (int ik = 0; ik < obsKinds.length(); ik++) {
     619        QChar ch = obsKinds[ik];
     620        QString obsType  = (ch + QString(frqObs->_rnxType2ch.c_str())).left(rnxType.length());
     621        if (rnxType == obsType) {
     622          if      (ch == 'L' && frqObs->_phaseValid) {
     623            obsValue = frqObs->_phase;
     624            if      (obsType[1] == '1') {
     625              lli = lli1;
     626            }
     627            else if (obsType[1] == '2') {
     628              lli = lli2;
     629            }
     630            else if (obsType[1] == '5') {
     631              lli = lli5;
     632            }
     633          }
     634          else if (ch == 'C' && frqObs->_codeValid) {
     635            obsValue = frqObs->_code;
     636          }
     637          else if (ch == 'D' && frqObs->_dopplerValid) {
     638            obsValue = frqObs->_doppler;
     639          }
     640          else if (ch == 'S' && frqObs->_snrValid) {
     641            obsValue = frqObs->_snr;
     642          }
     643        }
     644      }
     645    }
     646    if (obsValue != 0.0) {
     647      str << setw(14) << setprecision(3) << obsValue << lli << ' ';
     648    }
     649    else {
     650      str << "                ";
     651    }
     652  }
     653
     654  cout << str.str() << endl;
    629655
    630656  return str.str();
  • trunk/BNC/src/rinex/rnxobsfile.cpp

    r6137 r6147  
    951951// Translate Observation Type v2 --> v3
    952952////////////////////////////////////////////////////////////////////////////
    953 QString t_rnxObsFile::type2to3(char sys, const QString& typeV2) {
    954 
    955   if      (sys == 'G') {
    956     if (typeV2 == "C1") return "C1C";
    957     if (typeV2 == "C2") return "C2C";
    958     if (typeV2 == "C5") return "C5C";
    959     if (typeV2 == "P1") return "C1P";
    960     if (typeV2 == "P2") return "C2P";
    961     if (typeV2 == "L1") return "L1";
    962     if (typeV2 == "L2") return "L2";
    963     if (typeV2 == "L5") return "L5";
    964     if (typeV2 == "D1") return "D1";
    965     if (typeV2 == "D2") return "D2";
    966     if (typeV2 == "D5") return "D5";
    967     if (typeV2 == "S1") return "S1";
    968     if (typeV2 == "S2") return "S2";
    969     if (typeV2 == "S5") return "S5";
    970   }
    971 
    972   else if (sys == 'R') {
    973     if (typeV2 == "C1") return "C1C";
    974     if (typeV2 == "C2") return "C2C";
    975     if (typeV2 == "P1") return "C1P";
    976     if (typeV2 == "P2") return "C2P";
    977     if (typeV2 == "L1") return "L1";
    978     if (typeV2 == "L2") return "L2";
    979     if (typeV2 == "D1") return "D1";
    980     if (typeV2 == "D2") return "D2";
    981     if (typeV2 == "S1") return "S1";
    982     if (typeV2 == "S2") return "S2";
    983   }
    984 
    985   else if (sys == 'E') {
    986     if (typeV2 == "C1") return "C1";
    987     if (typeV2 == "C5") return "C5";
    988     if (typeV2 == "C6") return "C6";
    989     if (typeV2 == "C7") return "C7";
    990     if (typeV2 == "C8") return "C8";
    991     if (typeV2 == "L1") return "L1";
    992     if (typeV2 == "L5") return "L5";
    993     if (typeV2 == "L6") return "L6";
    994     if (typeV2 == "L7") return "L7";
    995     if (typeV2 == "L8") return "L8";
    996     if (typeV2 == "D1") return "D1";
    997     if (typeV2 == "D5") return "D5";
    998     if (typeV2 == "D6") return "D6";
    999     if (typeV2 == "D7") return "D7";
    1000     if (typeV2 == "D8") return "D8";
    1001     if (typeV2 == "S1") return "S1";
    1002     if (typeV2 == "S5") return "S5";
    1003     if (typeV2 == "S6") return "S6";
    1004     if (typeV2 == "S7") return "S7";
    1005     if (typeV2 == "S8") return "S8";
    1006   }
    1007 
    1008   else if (sys == 'S') {
    1009     if (typeV2 == "C1") return "C1C";
    1010     if (typeV2 == "C5") return "C5C";
    1011     if (typeV2 == "L1") return "L1";
    1012     if (typeV2 == "L5") return "L5";
    1013     if (typeV2 == "D1") return "D1";
    1014     if (typeV2 == "D5") return "D5";
    1015     if (typeV2 == "S1") return "S1";
    1016     if (typeV2 == "S5") return "S5";
    1017   }
    1018 
    1019   return "";
     953QString t_rnxObsFile::type2to3(char /* sys */, const QString& typeV2) {
     954  if      (typeV2 == "P1") {
     955    return "C1P";
     956  }
     957  else if (typeV2 == "P2") {
     958    return "C2P";
     959  }
     960  return typeV2;
    1020961}
    1021962
     
    1029970    return "P2";
    1030971  }
    1031   else {
    1032     return typeV3.left(2);
    1033   }
    1034 
    1035   return "";
     972  return typeV3.left(2);
    1036973}
    1037974
Note: See TracChangeset for help on using the changeset viewer.