- Timestamp:
- Apr 20, 2012, 1:31:32 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/rinex/rnxobsfile.cpp
r3966 r3967 594 594 // ------------------------------------- 595 595 else if (_trafo == trafo2to3) { 596 for (unsigned i i = 0; ii < header._obsTypesV2.size(); ii++) {597 const QString& typeV2 = header._obsTypesV2[i i];596 for (unsigned i2 = 0; i2 < header._obsTypesV2.size(); i2++) { 597 const QString& typeV2 = header._obsTypesV2[i2]; 598 598 for (unsigned iSys = 0; iSys < systems.length(); iSys++) { 599 599 char sys = systems[iSys]; 600 QString typeV3 = type2to3(sys, typeV2); 601 if (typeV3.isEmpty()) { 602 _indexMap2to3[sys][ii] = -1; 603 } 604 else { 600 QString typeV3 = type2to3(sys, typeV2); 601 if (!typeV3.isEmpty()) { 605 602 _header._obsTypesV3[sys].push_back(typeV3); 606 _indexMap2to3[sys][ii] = _header._obsTypesV3[sys].size() - 1; 603 int i3 = _header._obsTypesV3[sys].size() - 1; 604 _indexMap3to2[sys][i3] = i2; 607 605 } 608 606 } … … 618 616 if (it != header._obsTypesV3.end()) { 619 617 const vector<QString>& typesV3 = it->second; 620 for (unsigned i i = 0; ii < typesV3.size(); ii++) {621 const QString& typeV3 = typesV3[i i];618 for (unsigned i3 = 0; i3 < typesV3.size(); i3++) { 619 const QString& typeV3 = typesV3[i3]; 622 620 QString typeV2 = type3to2(typeV3); 623 if (typeV2.isEmpty()) { 624 _indexMap3to2[sys][ii] = -1; 621 bool found = false; 622 for (unsigned i2 = 0; i2 < _header._obsTypesV2.size(); i2++) { 623 if (_header._obsTypesV2[i2] == typeV2) { 624 found = true; 625 _indexMap2to3[sys][i2] = i3; 626 break; 627 } 625 628 } 626 else { 627 bool found = false; 628 for (unsigned i2 = 0; i2 < _header._obsTypesV2.size(); i2++) { 629 if (_header._obsTypesV2[i2] == typeV2) { 630 found = true; 631 _indexMap3to2[sys][ii] = i2; 632 break; 633 } 634 } 635 if (!found) { 636 _header._obsTypesV2.push_back(typeV2); 637 _indexMap3to2[sys][ii] = _header._obsTypesV2.size() - 1; 638 } 629 if (!found) { 630 _header._obsTypesV2.push_back(typeV2); 631 int i2 = _header._obsTypesV2.size() - 1; 632 _indexMap2to3[sys][i2] = i3; 639 633 } 640 634 } … … 811 805 *_stream << endl; 812 806 for (unsigned iSat = 0; iSat < epo->rnxSat.size(); iSat++) { 807 813 808 const t_rnxSat& rnxSat = epo->rnxSat[iSat]; 814 for (unsigned iTypeOld = 0; iTypeOld < rnxSat.obs.size(); iTypeOld++) { 815 816 int iTypeNew; 809 810 for (int iTypeV2 = 0; iTypeV2 < nTypes(rnxSat.satSys); iTypeV2++) { 811 812 if (iTypeV2 > 0 && iTypeV2 % 5 == 0) { 813 *_stream << endl; 814 } 815 816 int iType; 817 817 if (_trafo == trafoNone) { 818 iType New = iTypeOld;818 iType = iTypeV2; 819 819 } 820 820 else { 821 iTypeNew = _indexMap3to2[rnxSat.satSys][iTypeOld]; 822 if (iTypeNew == -1) { 823 continue; 824 } 825 } 826 827 if (iTypeNew > 0 && iTypeNew % 5 == 0) { 828 *_stream << endl; 829 } 830 if (rnxSat.obs[iTypeNew] == 0.0) { 821 iType = _indexMap2to3[rnxSat.satSys][iTypeV2]; 822 } 823 824 if (rnxSat.obs[iType] == 0.0) { 831 825 *_stream << QString().leftJustified(16); 832 826 } 833 827 else { 834 828 *_stream << QString("%1%2%3") 835 .arg(rnxSat.obs[iType New], 14, 'f', 3)836 .arg(rnxSat.lli[iType New],1)837 .arg(rnxSat.snr[iType New],1);829 .arg(rnxSat.obs[iType], 14, 'f', 3) 830 .arg(rnxSat.lli[iType],1) 831 .arg(rnxSat.snr[iType],1); 838 832 } 839 833 } … … 869 863 << QString("%1").arg(rnxSat.satNum, 2, 10, QChar('0')); 870 864 871 for ( unsigned iTypeOld = 0; iTypeOld < rnxSat.obs.size(); iTypeOld++) {872 873 int iType New;865 for (int iTypeV3 = 0; iTypeV3 < nTypes(rnxSat.satSys); iTypeV3++) { 866 867 int iType; 874 868 if (_trafo == trafoNone) { 875 iType New = iTypeOld;869 iType = iTypeV3; 876 870 } 877 871 else { 878 iTypeNew = _indexMap2to3[rnxSat.satSys][iTypeOld]; 879 if (iTypeNew == -1) { 880 continue; 881 } 882 } 883 884 if (rnxSat.obs[iTypeNew] == 0.0) { 872 iType = _indexMap3to2[rnxSat.satSys][iTypeV3]; 873 } 874 875 if (rnxSat.obs[iType] == 0.0) { 885 876 *_stream << QString().leftJustified(16); 886 877 } 887 878 else { 888 879 *_stream << QString("%1%2%3") 889 .arg(rnxSat.obs[iType New], 14, 'f', 3)890 .arg(rnxSat.lli[iType New],1)891 .arg(rnxSat.snr[iType New],1);880 .arg(rnxSat.obs[iType], 14, 'f', 3) 881 .arg(rnxSat.lli[iType],1) 882 .arg(rnxSat.snr[iType],1); 892 883 } 893 884 }
Note:
See TracChangeset
for help on using the changeset viewer.