- Timestamp:
- Apr 20, 2012, 11:19:03 AM (13 years ago)
- Location:
- trunk/BNC/rinex
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/rinex/reqcedit.cpp
r3938 r3956 88 88 t_rnxObsFile* obsFile = _rnxObsFiles[ii]; 89 89 if (ii == 0) { 90 outObsFile.setHeader(obsFile->header() );90 outObsFile.setHeader(obsFile->header(), _rnxVersion); 91 91 outObsFile.writeHeader(); 92 92 } -
trunk/BNC/rinex/rnxobsfile.cpp
r3940 r3956 243 243 _stream = 0; 244 244 _flgPowerFail = false; 245 _trafo = trafoNone; 245 246 if (_inpOut == input) { 246 247 openRead(fileName); … … 535 536 // Set Header Information 536 537 //////////////////////////////////////////////////////////////////////////// 537 void t_rnxObsFile::setHeader(const t_rnxObsHeader& header) { 538 _header._version = header._version; 538 void 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 539 553 _header._interval = header._interval; 540 554 _header._antennaNumber = header._antennaNumber; … … 556 570 _header._wlFactorsL2[iPrn] = header._wlFactorsL2[iPrn]; 557 571 } 572 558 573 _header._startTime = header._startTime; 574 575 // Copy Observation Types 576 // ---------------------- 559 577 for (unsigned ii = 0; ii < header._obsTypesV2.size(); ii++) { 560 578 _header._obsTypesV2.push_back(header._obsTypesV2[ii]); … … 567 585 _header._obsTypesV3[sys].push_back(typesV3[ii]); 568 586 } 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 569 607 } 570 608 } … … 796 834 } 797 835 } 836 837 // Translate Observation Type v2 --> v3 838 //////////////////////////////////////////////////////////////////////////// 839 QString 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 129 129 public: 130 130 const t_rnxObsHeader& header() const {return _header;} 131 void setHeader(const t_rnxObsHeader& header );131 void setHeader(const t_rnxObsHeader& header, double version); 132 132 void writeHeader(); 133 133 void writeEpoch(const t_rnxEpo* epo); 134 134 135 135 private: 136 enum e_trafo {trafoNone, trafo2to3, trafo3to2}; 137 136 138 void writeEpochV2(const t_rnxEpo* epo); 137 139 void writeEpochV3(const t_rnxEpo* epo); … … 139 141 const t_rnxEpo* nextEpochV3(); 140 142 void handleEpochFlag(int flag, const QString& line); 143 QString type2to3(char sys, const QString& typeV2); 141 144 142 145 e_inpOut _inpOut; … … 147 150 t_rnxEpo _currEpo; 148 151 bool _flgPowerFail; 152 e_trafo _trafo; 149 153 }; 150 154
Note:
See TracChangeset
for help on using the changeset viewer.