Changeset 7474 in ntrip for trunk/BNC/src/rinex/rnxobsfile.cpp
- Timestamp:
- Sep 29, 2015, 9:29:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/rnxobsfile.cpp
r6943 r7474 35 35 * Created: 24-Jan-2012 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 310 310 _obsTypes.clear(); 311 311 if (_version < 3.0) { 312 _obsTypes['G'] << "C1" << "P1" << "L1" << "S1" 312 _obsTypes['G'] << "C1" << "P1" << "L1" << "S1" 313 313 << "C2" << "P2" << "L2" << "S2"; 314 314 _obsTypes['R'] = _obsTypes['G']; … … 319 319 } 320 320 else { 321 _obsTypes['G'] << "C1C" << "L1C" << "S1C" 321 _obsTypes['G'] << "C1C" << "L1C" << "S1C" 322 322 << "C1W" << "L1W" << "S1W" 323 323 << "C2X" << "L2X" << "S2X" 324 << "C2W" << "L2W" << "S2W" 324 << "C2W" << "L2W" << "S2W" 325 325 << "C5X" << "L5X" << "S5X"; 326 326 327 327 _obsTypes['J'] = _obsTypes['G']; 328 329 _obsTypes['R'] << "C1C" << "L1C" << "S1C" 328 329 _obsTypes['R'] << "C1C" << "L1C" << "S1C" 330 330 << "C2P" << "L2P" << "S2P"; 331 331 332 332 _obsTypes['E'] << "C1X" << "L1X" << "SX1" 333 333 << "C5X" << "L5X" << "SX5" 334 334 << "C7X" << "L7X" << "SX7" 335 335 << "C8X" << "L8X" << "SX8"; 336 336 337 337 _obsTypes['S'] << "C1C" << "L1C" << "S1C" 338 338 << "C5I" << "L5I" << "S5I" 339 339 << "C5Q" << "L5Q" << "S5Q"; 340 340 341 341 _obsTypes['C'] << "C2I" << "L2I" << "S2I" 342 342 << "C6I" << "L6I" << "S6I" … … 359 359 _version = t_rnxObsHeader::defaultRnxObsVersion3; 360 360 } 361 _interval = header._interval; 362 _antennaNumber = header._antennaNumber; 363 _antennaName = header._antennaName; 364 _markerName = header._markerName; 365 _markerNumber = header._markerNumber; 361 _interval = header._interval; 362 _antennaNumber = header._antennaNumber; 363 _antennaName = header._antennaName; 364 _markerName = header._markerName; 365 _markerNumber = header._markerNumber; 366 366 _markerType = header._markerType; 367 _antNEU = header._antNEU; 368 _antXYZ = header._antXYZ; 369 _antBSG = header._antBSG; 370 _xyz = header._xyz; 371 _observer = header._observer; 372 _agency = header._agency; 373 _receiverNumber = header._receiverNumber; 374 _receiverType = header._receiverType; 367 _antNEU = header._antNEU; 368 _antXYZ = header._antXYZ; 369 _antBSG = header._antBSG; 370 _xyz = header._xyz; 371 _observer = header._observer; 372 _agency = header._agency; 373 _receiverNumber = header._receiverNumber; 374 _receiverType = header._receiverType; 375 375 _receiverVersion = header._receiverVersion; 376 _startTime = header._startTime; 376 _startTime = header._startTime; 377 377 _comments = header._comments; 378 378 _usedSystems = header._usedSystems; 379 379 380 380 for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) { 381 _wlFactorsL1[iPrn] = header._wlFactorsL1[iPrn]; 382 _wlFactorsL2[iPrn] = header._wlFactorsL2[iPrn]; 381 _wlFactorsL1[iPrn] = header._wlFactorsL1[iPrn]; 382 _wlFactorsL2[iPrn] = header._wlFactorsL2[iPrn]; 383 383 } 384 384 … … 444 444 for (int iSys = 0; iSys < _usedSystems.length(); iSys++) { 445 445 char sys = _usedSystems[iSys].toAscii(); 446 QString type = _version >= 3.0 ? t_rnxObsFile::type2to3(sys, useObsTypes->at(iType)) : 446 QString type = _version >= 3.0 ? t_rnxObsFile::type2to3(sys, useObsTypes->at(iType)) : 447 447 t_rnxObsFile::type3to2(sys, useObsTypes->at(iType)); 448 448 if (!_obsTypes[sys].contains(type)) { … … 523 523 524 524 if (txtMap) { 525 525 QMapIterator<QString, QString> it(*txtMap); 526 526 while (it.hasNext()) { 527 527 it.next(); … … 529 529 runBy = it.value(); 530 530 } 531 else if ( it.key() == "COMMENT") {532 newComments = it.value().split("\\n", QString::SkipEmptyParts);531 else if ((it.key().indexOf("COMMENT")) != -1) { 532 newComments += it.value().split("\\n", QString::SkipEmptyParts); 533 533 } 534 534 } … … 570 570 .leftJustified(60) 571 571 << "MARKER TYPE\n"; 572 572 573 573 *stream << QString("%1%2") 574 574 .arg(_observer, -20) … … 766 766 } 767 767 768 // 768 // 769 769 //////////////////////////////////////////////////////////////////////////// 770 770 char t_rnxObsHeader::system(int iSys) const { … … 781 781 } 782 782 783 // 784 //////////////////////////////////////////////////////////////////////////// 785 QString t_rnxObsHeader::usedSystems(void) const { 786 return _usedSystems; 787 } 788 789 QStringList t_rnxObsHeader::obsTypes(char sys) const { 790 if (_obsTypes.contains(sys)) { 791 return _obsTypes[sys]; 792 } 793 else { 794 return QStringList(); 795 } 796 } 797 783 798 // Number of Observation Types (satellite-system specific) 784 799 //////////////////////////////////////////////////////////////////////////// … … 873 888 QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0].size(), 6); 874 889 for (int ii = 0; ii < _obsTypes[sys0].size(); ii++) { 875 QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0][ii], 6); 890 QTextStream(&hlp) << QString("%1").arg(_obsTypes[sys0][ii], 6); 876 891 if ((ii+1) % 9 == 0 || ii == _obsTypes[sys0].size()-1) { 877 892 strList.append(hlp.leftJustified(60) + "# / TYPES OF OBSERV\n"); … … 887 902 for (int iType = 0; iType < nTypes(sys); iType++) { 888 903 QString type = obsType(sys, iType); 889 QTextStream(&hlp) << QString(" %1").arg(type, -3); 904 QTextStream(&hlp) << QString(" %1").arg(type, -3); 890 905 if ((iType+1) % 13 == 0 || iType == nTypes(sys)-1) { 891 906 strList.append(hlp.leftJustified(60) + "SYS / # / OBS TYPES\n"); … … 985 1000 // Handle Special Epoch Flag 986 1001 //////////////////////////////////////////////////////////////////////////// 987 void t_rnxObsFile::handleEpochFlag(int flag, const QString& line, 1002 void t_rnxObsFile::handleEpochFlag(int flag, const QString& line, 988 1003 bool& headerReRead) { 989 1004 … … 1003 1018 1004 1019 // Re-Read Header 1005 // -------------- 1020 // -------------- 1006 1021 else if (flag == 3 || flag == 4 || flag == 5) { 1007 1022 int numLines = 0; … … 1077 1092 int numSat; 1078 1093 readInt(line, 32, 3, numSat); 1079 1094 1080 1095 _currEpo.rnxSat.resize(numSat); 1081 1096 … … 1090 1105 int pos = 3 + 16*iType; 1091 1106 double obsValue = 0.0; 1092 int lli = 0; 1107 int lli = 0; 1093 1108 int snr = 0; 1094 1109 readDbl(line, pos, 14, obsValue); … … 1154 1169 int numSat; 1155 1170 readInt(line, 29, 3, numSat); 1156 1171 1157 1172 _currEpo.rnxSat.resize(numSat); 1158 1173 … … 1172 1187 int satNum; readInt(line, pos + 1, 2, satNum); 1173 1188 _currEpo.rnxSat[iSat].prn.set(sys, satNum); 1174 1189 1175 1190 pos += 3; 1176 1191 } … … 1206 1221 } 1207 1222 } 1208 1223 1209 1224 _flgPowerFail = false; 1210 1225 1211 1226 return &_currEpo; 1212 1227 } 1213 1228 1214 1229 return 0; 1215 1230 } … … 1226 1241 const t_rnxSat& rnxSat = epo->rnxSat[ii]; 1227 1242 if (_header._obsTypes[rnxSat.prn.system()].size() > 0) { 1228 epoLocal.rnxSat.push_back(rnxSat); 1243 epoLocal.rnxSat.push_back(rnxSat); 1229 1244 } 1230 1245 } … … 1240 1255 // Write Data Epoch (RINEX Version 2) 1241 1256 //////////////////////////////////////////////////////////////////////////// 1242 void t_rnxObsFile::writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header, 1257 void t_rnxObsFile::writeEpochV2(QTextStream* stream, const t_rnxObsHeader& header, 1243 1258 const t_rnxEpo* epo) { 1244 1259 … … 1278 1293 QString typeV2 = header.obsType(sys, iTypeV2); 1279 1294 bool found = false; 1280 1295 1281 1296 QString preferredAttrib = signalPriorities(sys); 1282 1297 for (int iPref = 0; iPref < preferredAttrib.length(); iPref++) { … … 1324 1339 // Write Data Epoch (RINEX Version 3) 1325 1340 //////////////////////////////////////////////////////////////////////////// 1326 void t_rnxObsFile::writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header, 1341 void t_rnxObsFile::writeEpochV3(QTextStream* stream, const t_rnxObsHeader& header, 1327 1342 const t_rnxEpo* epo) { 1328 1343 … … 1431 1446 // Set Observations from RINEX File 1432 1447 //////////////////////////////////////////////////////////////////////////// 1433 void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo, 1448 void t_rnxObsFile::setObsFromRnx(const t_rnxObsFile* rnxObsFile, const t_rnxObsFile::t_rnxEpo* epo, 1434 1449 const t_rnxObsFile::t_rnxSat& rnxSat, t_satObs& obs) { 1435 1450 obs._staID = rnxObsFile->markerName().toAscii().constData(); … … 1461 1476 if (rnxObs.value != 0.0) { 1462 1477 string type2ch(typeV3.mid(1).toAscii().data()); 1463 1478 1464 1479 t_frqObs* frqObs = 0; 1465 1480 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) { … … 1474 1489 obs._obs.push_back(frqObs); 1475 1490 } 1476 1491 1477 1492 switch( typeV3.toAscii().data()[0] ) { 1478 1493 case 'C':
Note:
See TracChangeset
for help on using the changeset viewer.