Changeset 6126 in ntrip


Ignore:
Timestamp:
Sep 11, 2014, 3:40:38 PM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src/rinex
Files:
2 edited

Legend:

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

    r6125 r6126  
    355355// Observation Type (satellite-system specific)
    356356////////////////////////////////////////////////////////////////////////////
    357 QString t_rnxObsHeader::obsType(char sys, int index) const {
     357QString t_rnxObsHeader::obsType(char sys, int index, double version) const {
     358
     359  if (version == 0.0) {
     360    version = _version;
     361  }
    358362  if (_obsTypes.contains(sys)) {
    359     return _obsTypes[sys].at(index);
    360   }
    361   else {
    362     return "";
    363   }
     363    QString origType = _obsTypes[sys].at(index);
     364    if      (int(version) == int(_version)) {
     365      return origType;
     366    }
     367    else if (int(version) == 2) {
     368      return t_rnxObsFile::type3to2(origType);
     369    }
     370    else if (int(version) == 3) {
     371      return t_rnxObsFile::type2to3(sys, origType);
     372    }
     373  }
     374  return "";
    364375}
    365376
     
    583594 
    584595    _currEpo.rnxSat.resize(numSat);
     596    _currEpo.version = _header._version;
    585597
    586598    // Observations
     
    660672 
    661673    _currEpo.rnxSat.resize(numSat);
     674    _currEpo.version = _header._version;
    662675
    663676    // Read Satellite Numbers
     
    834847        *_stream << endl;
    835848      }
    836       QString type = obsType(sys, iType);
     849      QString type = obsType(sys, iType, epo->version);
    837850      if (!rnxSat.obs.contains(type)) {
    838851        *_stream << QString().leftJustified(16);
     
    886899    *_stream << rnxSat.prn.toString().c_str();
    887900    for (int iType = 0; iType < nTypes(sys); iType++) {
    888       QString type = obsType(sys, iType);
     901      QString type = obsType(sys, iType, epo->version);
    889902      if (!rnxSat.obs.contains(type)) {
    890903        *_stream << QString().leftJustified(16);
     
    10681081}
    10691082
    1070 // Set Observations from RINEX File
    1071 ////////////////////////////////////////////////////////////////////////////
    1072 bool t_rnxObsFile::useType(const QStringList& useObsTypes, const QString& type) {
    1073 
    1074   if (useObsTypes.size() == 0) {
    1075     return true;
    1076   }
    1077   for (int ii = 0; ii < useObsTypes.size(); ii++) {
    1078     if (type.left(2) == useObsTypes[ii].left(2)) {
    1079       return true;
    1080     }
    1081   }
    1082   return false;
    1083 }
  • trunk/BNC/src/rinex/rnxobsfile.h

    r6120 r6126  
    5454  int         numSys() const;
    5555  int         nTypes(char sys) const;
    56   QString     obsType(char sys, int index) const;
     56  QString     obsType(char sys, int index, double version = 0.0) const;
    5757  QStringList obsTypesStrings() const;
    5858  void        write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const;
     
    103103  class t_rnxEpo {
    104104   public:
     105    t_rnxEpo() {clear();}
    105106    void clear() {
    106107      tt.reset();
    107108      rnxSat.clear();
     109      version = 0.0;
    108110    }
    109111    bncTime               tt;
    110112    std::vector<t_rnxSat> rnxSat;
     113    double                version;
    111114  };
    112115
     
    121124  int            nTypes(char sys) const {return _header.nTypes(sys);}
    122125  const QString& fileName() const {return _fileName;}
    123   QString        obsType(char sys, int index) const {return _header.obsType(sys, index);}
     126  QString obsType(char sys, int index, double version = 0.0) const {
     127    return _header.obsType(sys, index, version);
     128  }
    124129  const QString& antennaName() const {return _header._antennaName;}
    125130  const QString& markerName() const {return _header._markerName;}
     
    172177  t_rnxEpo* nextEpochV3();
    173178  void handleEpochFlag(int flag, const QString& line, bool& headerReRead);
    174   bool useType(const QStringList& useObsTypes, const QString& type);
    175179
    176180  QMap<int, int>              _indexMap2to2;
Note: See TracChangeset for help on using the changeset viewer.