Changeset 3956 in ntrip


Ignore:
Timestamp:
Apr 20, 2012, 11:19:03 AM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/rinex
Files:
3 edited

Legend:

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

    r3938 r3956  
    8888    t_rnxObsFile* obsFile = _rnxObsFiles[ii];
    8989    if (ii == 0) {
    90       outObsFile.setHeader(obsFile->header());
     90      outObsFile.setHeader(obsFile->header(), _rnxVersion);
    9191      outObsFile.writeHeader();
    9292    }
  • trunk/BNC/rinex/rnxobsfile.cpp

    r3940 r3956  
    243243  _stream       = 0;
    244244  _flgPowerFail = false;
     245  _trafo        = trafoNone;
    245246  if (_inpOut == input) {
    246247    openRead(fileName);
     
    535536// Set Header Information
    536537////////////////////////////////////////////////////////////////////////////
    537 void t_rnxObsFile::setHeader(const t_rnxObsHeader& header) {
    538   _header._version         = header._version;     
     538void t_rnxObsFile::setHeader(const t_rnxObsHeader& header, double version) {
     539
     540  if      (int(header._version) == int(version)) {
     541    _trafo           = trafoNone;
     542    _header._version = header._version;
     543  }
     544  else if (version >= 3.0) {
     545    _trafo           = trafo2to3;
     546    _header._version = 3.01;
     547  }
     548  else {
     549    _trafo           = trafo3to2;
     550    _header._version = 2.11;
     551  }
     552
    539553  _header._interval        = header._interval;   
    540554  _header._antennaNumber   = header._antennaNumber;
     
    556570    _header._wlFactorsL2[iPrn] =  header._wlFactorsL2[iPrn];
    557571  }
     572
    558573  _header._startTime   =  header._startTime;   
     574
     575  // Copy Observation Types
     576  // ----------------------
    559577  for (unsigned ii = 0; ii < header._obsTypesV2.size(); ii++) {
    560578    _header._obsTypesV2.push_back(header._obsTypesV2[ii]);
     
    567585      _header._obsTypesV3[sys].push_back(typesV3[ii]);
    568586    }
     587  }
     588
     589  static const string systems = "GRES";
     590
     591  // Translate Observation Types v2 --> v3
     592  // -------------------------------------
     593  if      (_trafo == trafo2to3) {
     594    for (unsigned ii = 0; ii < header._obsTypesV2.size(); ii++) {
     595      const QString& typeV2 = header._obsTypesV2[ii];
     596      for (unsigned iSys = 0; iSys < systems.length(); iSys++) {
     597        char sys = systems[iSys];
     598        _header._obsTypesV3[sys].push_back( type2to3(sys, typeV2) );
     599      }
     600    }
     601  }
     602
     603  // Translate Observation Types v3 --> v2
     604  // -------------------------------------
     605  else if (_trafo == trafo3to2) {
     606
    569607  }
    570608}
     
    796834  }
    797835}
     836
     837// Translate Observation Type v2 --> v3
     838////////////////////////////////////////////////////////////////////////////
     839QString t_rnxObsFile::type2to3(char sys, const QString& typeV2) {
     840
     841  if      (sys == 'G') {
     842    if (typeV2 == "C1") return "C1C";
     843    if (typeV2 == "C2") return "C2C";
     844    if (typeV2 == "C5") return "C5C";
     845    if (typeV2 == "P1") return "C1P";
     846    if (typeV2 == "P2") return "C2P";
     847    if (typeV2 == "L1") return "L1";
     848    if (typeV2 == "L2") return "L2";
     849    if (typeV2 == "L5") return "L5";
     850    if (typeV2 == "D1") return "D1";
     851    if (typeV2 == "D2") return "D2";
     852    if (typeV2 == "D5") return "D5";
     853    if (typeV2 == "S1") return "S1";
     854    if (typeV2 == "S2") return "S2";
     855    if (typeV2 == "S5") return "S5";
     856  }
     857
     858  else if (sys == 'R') {
     859    if (typeV2 == "C1") return "C1C";
     860    if (typeV2 == "C2") return "C2C";
     861    if (typeV2 == "P1") return "C1P";
     862    if (typeV2 == "P2") return "C2P";
     863    if (typeV2 == "L1") return "L1";
     864    if (typeV2 == "L2") return "L2";
     865    if (typeV2 == "D1") return "D1";
     866    if (typeV2 == "D2") return "D2";
     867    if (typeV2 == "S1") return "S1";
     868    if (typeV2 == "S2") return "S2";
     869  }
     870
     871  else if (sys == 'E') {
     872    if (typeV2 == "C1") return "C1";
     873    if (typeV2 == "C5") return "C5";
     874    if (typeV2 == "C6") return "C6";
     875    if (typeV2 == "C7") return "C7";
     876    if (typeV2 == "C8") return "C8";
     877    if (typeV2 == "L1") return "L1";
     878    if (typeV2 == "L5") return "L5";
     879    if (typeV2 == "L6") return "L6";
     880    if (typeV2 == "L7") return "L7";
     881    if (typeV2 == "L8") return "L8";
     882    if (typeV2 == "D1") return "D1";
     883    if (typeV2 == "D5") return "D5";
     884    if (typeV2 == "D6") return "D6";
     885    if (typeV2 == "D7") return "D7";
     886    if (typeV2 == "D8") return "D8";
     887    if (typeV2 == "S1") return "S1";
     888    if (typeV2 == "S5") return "S5";
     889    if (typeV2 == "S6") return "S6";
     890    if (typeV2 == "S7") return "S7";
     891    if (typeV2 == "S8") return "S8";
     892  }
     893
     894  else if (sys == 'S') {
     895    if (typeV2 == "C1") return "C1C";
     896    if (typeV2 == "C5") return "C5C";
     897    if (typeV2 == "L1") return "L1";
     898    if (typeV2 == "L5") return "L5";
     899    if (typeV2 == "D1") return "D1";
     900    if (typeV2 == "D5") return "D5";
     901    if (typeV2 == "S1") return "S1";
     902    if (typeV2 == "S5") return "S5";
     903  }
     904
     905  return "";
     906}
  • trunk/BNC/rinex/rnxobsfile.h

    r3930 r3956  
    129129 public:
    130130  const t_rnxObsHeader& header() const {return _header;}
    131   void setHeader(const t_rnxObsHeader& header);
     131  void setHeader(const t_rnxObsHeader& header, double version);
    132132  void writeHeader();
    133133  void writeEpoch(const t_rnxEpo* epo);
    134134
    135135 private:
     136  enum e_trafo {trafoNone, trafo2to3, trafo3to2};
     137
    136138  void writeEpochV2(const t_rnxEpo* epo);
    137139  void writeEpochV3(const t_rnxEpo* epo);
     
    139141  const t_rnxEpo* nextEpochV3();
    140142  void handleEpochFlag(int flag, const QString& line);
     143  QString type2to3(char sys, const QString& typeV2);
    141144
    142145  e_inpOut       _inpOut;
     
    147150  t_rnxEpo       _currEpo;
    148151  bool           _flgPowerFail;
     152  e_trafo        _trafo;
    149153};
    150154
Note: See TracChangeset for help on using the changeset viewer.