Changeset 9770 in ntrip for trunk/BNC/src/rinex/rnxobsfile.cpp


Ignore:
Timestamp:
Jun 22, 2022, 3:18:32 PM (7 weeks ago)
Author:
stuerze
Message:

minor changes to handle RINEX 2,3,4

File:
1 edited

Legend:

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

    r9760 r9770  
    6565  bncSettings settings;
    6666  _writeRinexOnlyWithSklObsTypes = settings.value("rnxOnlyWithSKL").toBool();
     67
    6768}
    6869
     
    7172t_rnxObsHeader::~t_rnxObsHeader() {
    7273}
     74
     75double t_rnxObsHeader::versionFromInt(int version) {
     76  switch (version) {
     77    case 2:
     78      return defaultRnxObsVersion2;
     79    case 3:
     80      return defaultRnxObsVersion3;
     81    case 4:
     82      return defaultRnxObsVersion4;
     83    default:
     84      return defaultRnxObsVersion3;
     85  }
     86}
     87
    7388
    7489// Read Header
     
    175190    else if (key == "# / TYPES OF OBSERV") {
    176191      if (_version == 0.0) {
    177         _version = defaultRnxObsVersion3;
     192        _version = defaultRnxObsVersion2;
    178193      }
    179194      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
     
    199214    else if (key == "SYS / # / OBS TYPES") {
    200215      if (_version == 0.0) {
    201         _version = defaultRnxObsVersion3;
     216        bncSettings settings;
     217        _version = versionFromInt(settings.value("rnxVersion").toInt());
    202218      }
    203219      QTextStream* in = new QTextStream(value.toLatin1(), QIODevice::ReadOnly);
     
    315331  _markerName = markerName;
    316332
    317   if (version == 2) {
    318     _version = defaultRnxObsVersion2;
    319   }
    320   else if (version == 3) {
    321     _version = defaultRnxObsVersion3;
    322   }
    323   else if (version == 4) {
    324     _version = defaultRnxObsVersion4;
    325   }
     333  _version = versionFromInt(version);
    326334
    327335  _comments << "Default set of observation types used";
Note: See TracChangeset for help on using the changeset viewer.