Changeset 4053 in ntrip
- Timestamp:
- Apr 26, 2012, 12:36:25 PM (13 years ago)
- Location:
- trunk/BNC/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/rinex/rnxobsfile.cpp
r3994 r4053 167 167 QString hlp; 168 168 *in >> hlp; 169 _obsTypesV2. push_back(hlp);169 _obsTypesV2.append(hlp); 170 170 } 171 171 } … … 210 210 } 211 211 else { 212 map<char, vector<QString> >::const_iterator it = _obsTypesV3.find(sys); 213 if (it != _obsTypesV3.end()) { 214 return it->second.size(); 212 if (_obsTypesV3.contains(sys)) { 213 return _obsTypesV3[sys].size(); 215 214 } 216 215 else { … … 227 226 } 228 227 else { 229 map<char, vector<QString> >::const_iterator it = _obsTypesV3.find(sys); 230 if (it != _obsTypesV3.end()) { 231 return it->second.at(index); 228 if (_obsTypesV3.contains(sys)) { 229 return _obsTypesV3[sys].at(index); 232 230 } 233 231 else { … … 575 573 static const string systems = "GRES"; 576 574 575 _header._obsTypesV2.clear(); 576 _header._obsTypesV3.clear(); 577 577 578 // Copy Observation Types 578 579 // ---------------------- 579 580 if (_trafo == trafoNone) { 580 for (unsigned ii = 0; ii < header._obsTypesV2.size(); ii++) { 581 _header._obsTypesV2.push_back(header._obsTypesV2[ii]); 582 } 583 map<char, vector<QString> >::const_iterator it; 584 for (it = header._obsTypesV3.begin(); it != header._obsTypesV3.end(); it++) { 585 char sys = it->first; 586 const vector<QString>& typesV3 = it->second; 587 for (unsigned ii = 0; ii < typesV3.size(); ii++) { 581 for (int ii = 0; ii < header._obsTypesV2.size(); ii++) { 582 _header._obsTypesV2.append(header._obsTypesV2[ii]); 583 } 584 QMapIterator<char, QVector<QString> > it(header._obsTypesV3); 585 while (it.hasNext()) { 586 it.next(); 587 char sys = it.key(); 588 const QVector<QString>& typesV3 = it.value(); 589 for (int ii = 0; ii < typesV3.size(); ii++) { 588 590 _header._obsTypesV3[sys].push_back(typesV3[ii]); 589 591 } … … 594 596 // ------------------------------------- 595 597 else if (_trafo == trafo2to3) { 596 for ( unsignedi2 = 0; i2 < header._obsTypesV2.size(); i2++) {598 for (int i2 = 0; i2 < header._obsTypesV2.size(); i2++) { 597 599 const QString& typeV2 = header._obsTypesV2[i2]; 598 600 for (unsigned iSys = 0; iSys < systems.length(); iSys++) { … … 613 615 for (unsigned iSys = 0; iSys < systems.length(); iSys++) { 614 616 char sys = systems[iSys]; 615 map<char, vector<QString> >::const_iterator it = header._obsTypesV3.find(sys); 616 if (it != header._obsTypesV3.end()) { 617 const vector<QString>& typesV3 = it->second; 618 for (unsigned i3 = 0; i3 < typesV3.size(); i3++) { 617 if (header._obsTypesV3.contains(sys)) { 618 const QVector<QString>& typesV3 = header._obsTypesV3[sys]; 619 for (int i3 = 0; i3 < typesV3.size(); i3++) { 619 620 const QString& typeV3 = typesV3[i3]; 620 621 QString typeV2 = type3to2(typeV3); 621 622 if (!typeV2.isEmpty()) { 622 623 bool found = false; 623 for ( unsignedi2 = 0; i2 < _header._obsTypesV2.size(); i2++) {624 for (int i2 = 0; i2 < _header._obsTypesV2.size(); i2++) { 624 625 if (_header._obsTypesV2[i2] == typeV2) { 625 626 found = true; … … 631 632 } 632 633 if (!found) { 633 _header._obsTypesV2. push_back(typeV2);634 _header._obsTypesV2.append(typeV2); 634 635 int i2 = _header._obsTypesV2.size() - 1; 635 636 _indexMap2to3[sys][i2] = i3; … … 718 719 QString hlp; 719 720 QTextStream(&hlp) << QString("%1").arg(_header._obsTypesV2.size(), 6); 720 for ( unsignedii = 0; ii < _header._obsTypesV2.size(); ii++) {721 for (int ii = 0; ii < _header._obsTypesV2.size(); ii++) { 721 722 QTextStream(&hlp) << QString("%1").arg(_header._obsTypesV2[ii], 6); 722 723 if (ii > 0 && (ii % 8 == 0 || ii == _header._obsTypesV2.size()-1)) { … … 727 728 } 728 729 else { 729 map<char, vector<QString> >::const_iterator it; 730 for (it = _header._obsTypesV3.begin(); it != _header._obsTypesV3.end(); it++) { 731 char sys = it->first; 732 const vector<QString>& types = it->second; 730 QMapIterator<char, QVector<QString> > it(_header._obsTypesV3); 731 while (it.hasNext()) { 732 it.next(); 733 char sys = it.key(); 734 const QVector<QString>& types = it.value(); 733 735 QString hlp; 734 736 QTextStream(&hlp) << QString("%1 %2").arg(sys).arg(types.size(), 3); 735 for ( unsignedii = 0; ii < types.size(); ii++) {737 for (int ii = 0; ii < types.size(); ii++) { 736 738 QTextStream(&hlp) << QString(" %1").arg(types[ii], -3); 737 739 if (ii > 0 && (ii % 12 == 0 || ii == types.size()-1)) { … … 1001 1003 return ""; 1002 1004 } 1005 1006 // Check for Changes in Header 1007 //////////////////////////////////////////////////////////////////////////// 1008 void t_rnxObsFile::checkNewHeader(const t_rnxObsHeader& header) { 1009 1010 t_rnxObsHeader oldHeader(_header); 1011 setHeader(header, oldHeader._version); 1012 1013 if (header._obsTypesV2 != oldHeader._obsTypesV2 || 1014 header._obsTypesV3 != oldHeader._obsTypesV3) { 1015 1016 writeHeader(); 1017 } 1018 } -
trunk/BNC/rinex/rnxobsfile.h
r3994 r4053 114 114 const QString& obsType(char sys, int index) const; 115 115 116 static const QString 117 float 118 double 119 QString 120 QString 121 QString 122 QString 123 QString 124 QString 125 QString 126 QString 127 QString 128 ColumnVector 129 ColumnVector 130 ColumnVector 131 ColumnVector 132 std::vector<QString>_obsTypesV2;133 std::map<char, std::vector<QString> > _obsTypesV3;134 int 135 int 136 bncTime 116 static const QString _emptyStr; 117 float _version; 118 double _interval; 119 QString _antennaNumber; 120 QString _antennaName; 121 QString _markerName; 122 QString _markerNumber; 123 QString _observer; 124 QString _agency; 125 QString _receiverNumber; 126 QString _receiverType; 127 QString _receiverVersion; 128 ColumnVector _antNEU; 129 ColumnVector _antXYZ; 130 ColumnVector _antBSG; 131 ColumnVector _xyz; 132 QVector<QString> _obsTypesV2; 133 QMap<char, QVector<QString> > _obsTypesV3; 134 int _wlFactorsL1[MAXPRN_GPS+1]; 135 int _wlFactorsL2[MAXPRN_GPS+1]; 136 bncTime _startTime; 137 137 }; 138 138 … … 140 140 const t_rnxObsHeader& header() const {return _header;} 141 141 void setHeader(const t_rnxObsHeader& header, double version); 142 void checkNewHeader(const t_rnxObsHeader& header); 142 143 void writeHeader(); 143 144 void writeEpoch(const t_rnxEpo* epo); … … 155 156 QString type3to2(const QString& typeV3); 156 157 157 std::map<char, std::map<int, int> > _indexMap2to3;158 std::map<char, std::map<int, int> > _indexMap3to2;158 QMap<char, QMap<int, int> > _indexMap2to3; 159 QMap<char, QMap<int, int> > _indexMap3to2; 159 160 160 161 e_inpOut _inpOut;
Note:
See TracChangeset
for help on using the changeset viewer.