Changeset 3967 in ntrip


Ignore:
Timestamp:
Apr 20, 2012, 1:31:32 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/rinex/rnxobsfile.cpp

    r3966 r3967  
    594594  // -------------------------------------
    595595  else if (_trafo == trafo2to3) {
    596     for (unsigned ii = 0; ii < header._obsTypesV2.size(); ii++) {
    597       const QString& typeV2 = header._obsTypesV2[ii];
     596    for (unsigned i2 = 0; i2 < header._obsTypesV2.size(); i2++) {
     597      const QString& typeV2 = header._obsTypesV2[i2];
    598598      for (unsigned iSys = 0; iSys < systems.length(); iSys++) {
    599599        char    sys    = systems[iSys];
    600         QString typeV3 =  type2to3(sys, typeV2);
    601         if (typeV3.isEmpty()) {
    602           _indexMap2to3[sys][ii] = -1;
    603         }
    604         else {
     600        QString typeV3 = type2to3(sys, typeV2);
     601        if (!typeV3.isEmpty()) {
    605602          _header._obsTypesV3[sys].push_back(typeV3);
    606           _indexMap2to3[sys][ii] = _header._obsTypesV3[sys].size() - 1;
     603          int i3 = _header._obsTypesV3[sys].size() - 1;
     604          _indexMap3to2[sys][i3] = i2;
    607605        }
    608606      }
     
    618616      if (it != header._obsTypesV3.end()) {
    619617        const vector<QString>& typesV3 = it->second;
    620         for (unsigned ii = 0; ii < typesV3.size(); ii++) {
    621           const QString& typeV3 = typesV3[ii];
     618        for (unsigned i3 = 0; i3 < typesV3.size(); i3++) {
     619          const QString& typeV3 = typesV3[i3];
    622620          QString        typeV2 = type3to2(typeV3);
    623           if (typeV2.isEmpty()) {
    624             _indexMap3to2[sys][ii] = -1;
     621          bool found = false;
     622          for (unsigned i2 = 0; i2 < _header._obsTypesV2.size(); i2++) {
     623            if (_header._obsTypesV2[i2] == typeV2) {
     624              found = true;
     625              _indexMap2to3[sys][i2] = i3;
     626              break;
     627            }
    625628          }
    626           else {
    627             bool found = false;
    628             for (unsigned i2 = 0; i2 < _header._obsTypesV2.size(); i2++) {
    629               if (_header._obsTypesV2[i2] == typeV2) {
    630                 found = true;
    631                 _indexMap3to2[sys][ii] = i2;
    632                 break;
    633               }
    634             }
    635             if (!found) {
    636               _header._obsTypesV2.push_back(typeV2);
    637               _indexMap3to2[sys][ii] = _header._obsTypesV2.size() - 1;
    638             }
     629          if (!found) {
     630            _header._obsTypesV2.push_back(typeV2);
     631            int i2 = _header._obsTypesV2.size() - 1;
     632            _indexMap2to3[sys][i2] = i3;
    639633          }
    640634        }
     
    811805  *_stream << endl;
    812806  for (unsigned iSat = 0; iSat < epo->rnxSat.size(); iSat++) {
     807
    813808    const t_rnxSat& rnxSat = epo->rnxSat[iSat];
    814     for (unsigned iTypeOld = 0; iTypeOld < rnxSat.obs.size(); iTypeOld++) {
    815 
    816       int iTypeNew;
     809
     810    for (int iTypeV2 = 0; iTypeV2 < nTypes(rnxSat.satSys); iTypeV2++) {
     811
     812      if (iTypeV2 > 0 && iTypeV2 % 5 == 0) {
     813        *_stream << endl;
     814      }
     815
     816      int iType;
    817817      if   (_trafo == trafoNone) {
    818         iTypeNew = iTypeOld;
     818        iType = iTypeV2;
    819819      }
    820820      else {
    821         iTypeNew = _indexMap3to2[rnxSat.satSys][iTypeOld];
    822         if (iTypeNew == -1) {
    823           continue;
    824         }
    825       }
    826 
    827       if (iTypeNew > 0 && iTypeNew % 5 == 0) {
    828         *_stream << endl;
    829       }
    830       if (rnxSat.obs[iTypeNew] == 0.0) {
     821        iType = _indexMap2to3[rnxSat.satSys][iTypeV2];
     822      }
     823
     824      if (rnxSat.obs[iType] == 0.0) {
    831825        *_stream << QString().leftJustified(16);
    832826      }
    833827      else {
    834828        *_stream << QString("%1%2%3")
    835           .arg(rnxSat.obs[iTypeNew], 14, 'f', 3)
    836           .arg(rnxSat.lli[iTypeNew],1)
    837           .arg(rnxSat.snr[iTypeNew],1);
     829          .arg(rnxSat.obs[iType], 14, 'f', 3)
     830          .arg(rnxSat.lli[iType],1)
     831          .arg(rnxSat.snr[iType],1);
    838832      }
    839833    }
     
    869863             << QString("%1").arg(rnxSat.satNum, 2, 10, QChar('0'));
    870864
    871     for (unsigned iTypeOld = 0; iTypeOld < rnxSat.obs.size(); iTypeOld++) {
    872 
    873       int iTypeNew;
     865    for (int iTypeV3 = 0; iTypeV3 < nTypes(rnxSat.satSys); iTypeV3++) {
     866
     867      int iType;
    874868      if   (_trafo == trafoNone) {
    875         iTypeNew = iTypeOld;
     869        iType = iTypeV3;
    876870      }
    877871      else {
    878         iTypeNew = _indexMap2to3[rnxSat.satSys][iTypeOld];
    879         if (iTypeNew == -1) {
    880           continue;
    881         }
    882       }
    883 
    884       if (rnxSat.obs[iTypeNew] == 0.0) {
     872        iType = _indexMap3to2[rnxSat.satSys][iTypeV3];
     873      }
     874
     875      if (rnxSat.obs[iType] == 0.0) {
    885876        *_stream << QString().leftJustified(16);
    886877      }
    887878      else {
    888879        *_stream << QString("%1%2%3")
    889           .arg(rnxSat.obs[iTypeNew], 14, 'f', 3)
    890           .arg(rnxSat.lli[iTypeNew],1)
    891           .arg(rnxSat.snr[iTypeNew],1);
     880          .arg(rnxSat.obs[iType], 14, 'f', 3)
     881          .arg(rnxSat.lli[iType],1)
     882          .arg(rnxSat.snr[iType],1);
    892883      }
    893884    }
Note: See TracChangeset for help on using the changeset viewer.