Changeset 4053 in ntrip for trunk/BNC/rinex/rnxobsfile.cpp
- Timestamp:
- Apr 26, 2012, 12:36:25 PM (13 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.