- Timestamp:
- May 6, 2015, 2:15:11 PM (10 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/rnxobsfile.cpp
r6719 r6815 75 75 _comments.clear(); 76 76 int numLines = 0; 77 77 78 while ( stream->status() == QTextStream::Ok && !stream->atEnd() ) { 78 79 QString line = stream->readLine(); ++ numLines; … … 199 200 QString hlp; 200 201 *in >> hlp; 201 if (sys == 'C' ){202 if (sys == 'C' && _version == 3.02){ 202 203 hlp.replace('2', '1'); 203 204 } … … 214 215 } 215 216 else if (key == "SYS / PHASE SHIFT"){ 216 QTextStream in(value.toAscii(), QIODevice::ReadOnly); 217 char sys; 218 QString obstype; 219 double shift; 220 in >> sys >> obstype >> shift; 221 if (obstype.size()) 222 _phaseShifts.insert(sys, QPair<QString, double>(obstype, shift)); 217 QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly); 218 char sys; 219 QString obstype; 220 double shift; 221 int satnum = 0; 222 QStringList satList; 223 QString sat; 224 *in >> sys >> obstype >> shift >> satnum; 225 if (obstype.size()) { 226 for (int ii = 0; ii < satnum; ii++) { 227 if (ii > 0 && ii % 10 == 0) { 228 line = stream->readLine(); ++numLines; 229 delete in; 230 in = new QTextStream(line.left(60).toAscii(), QIODevice::ReadOnly); 231 } 232 *in >> sat; 233 satList.append(sat); 234 } 235 _phaseShifts.insert(sys+obstype, QPair<double, QStringList>(shift, satList)); 236 delete in; 237 } 223 238 } 224 239 else if (key == "GLONASS COD/PHS/BIS"){ … … 302 317 else { 303 318 _obsTypes['G'] << "C1C" << "L1C" << "S1C" 319 << "C1W" << "L1W" << "S1W" 320 << "C2X" << "L2X" << "S2X" 304 321 << "C2W" << "L2W" << "S2W" 305 << "C5 " << "L5" << "S5";306 322 << "C5X" << "L5X" << "S5X"; 323 307 324 _obsTypes['J'] = _obsTypes['G']; 308 325 … … 310 327 << "C2P" << "L2P" << "S2P"; 311 328 312 _obsTypes['E'] << "C1 " << "L1" << "S1"313 << "C5 " << "L5" << "S5"314 << "C7 " << "L7" << "S7"315 << "C8 " << "L8" << "S8";329 _obsTypes['E'] << "C1X" << "L1X" << "SX1" 330 << "C5X" << "L5X" << "SX5" 331 << "C7X" << "L7X" << "SX7" 332 << "C8X" << "L8X" << "SX8"; 316 333 317 _obsTypes['S'] << "C1" << "L1" << "S1" 318 << "C5" << "L5" << "S5"; 334 _obsTypes['S'] << "C1C" << "L1C" << "S1C" 335 << "C5I" << "L5I" << "S5I" 336 << "C5Q" << "L5Q" << "S5Q"; 319 337 320 _obsTypes['C'] << "C 1" << "L1" << "S1"321 << "C6 " << "L6" << "S6"322 << "C7 " << "L7" << "S7";338 _obsTypes['C'] << "C2I" << "L2I" << "S2I" 339 << "C6I" << "L6I" << "S6I" 340 << "C7I" << "L7I" << "S7I"; 323 341 } 324 342 } … … 353 371 _usedSystems = header._usedSystems; 354 372 if (_version >= 3.0) { 355 _phaseShifts = header._phaseShifts;373 _phaseShifts = header._phaseShifts; 356 374 _gloPhaseBiases = header._gloPhaseBiases; 357 375 _gloSlots = header._gloSlots; … … 561 579 if (_version >= 3.0) { 562 580 if (_phaseShifts.empty()) { 563 QString sys = _usedSystems; 564 for (int ii = 0; ii < sys.size(); ii++) { 565 *stream << QString("%1") 566 .arg(sys[ii], 0) 581 QMap<char, QStringList>::const_iterator it; 582 for (it = _obsTypes.begin(); it != _obsTypes.end(); ++it) { 583 char sys = it.key(); 584 double shift = 0.0; 585 foreach (const QString &obstype, it.value()) { 586 if (obstype.left(1).contains('L')) { 587 *stream << QString("%1 %2 %3") 588 .arg(sys, 0) 589 .arg(obstype, 0) 590 .arg(shift, 9, 'f', 5) 591 .leftJustified(60) 592 << "SYS / PHASE SHIFT\n"; 593 } 594 } 595 } 596 } else { 597 QMap<QString, QPair<double, QStringList> >::const_iterator it; 598 QString emptyFillStr; 599 for(it = _phaseShifts.begin(); it!= _phaseShifts.end(); ++it) { 600 QString sys = it.key().left(1); 601 QString obstype = it.key().mid(1); 602 double shift = it.value().first; 603 QStringList satList = it.value().second; 604 QString hlp = QString("%1 %2 %3 ") 605 .arg(sys.toStdString().c_str(), 0) 606 .arg(obstype, 4) 607 .arg(shift, 9, 'f', 5); 608 if (!satList.empty()) { 609 hlp += QString("%1 ").arg(satList.size(), 2); 610 } 611 else { 612 *stream << QString("%1") 613 .arg(hlp, 0) 614 .leftJustified(60) 615 << "SYS / PHASE SHIFT\n"; 616 hlp = ""; 617 } 618 int ii = 0; 619 QStringList::const_iterator it_s; 620 for (it_s = satList.begin(); it_s != satList.end(); ++it_s) { 621 (hlp.contains(obstype)) ? 622 emptyFillStr = "": 623 emptyFillStr = " "; 624 hlp += QString("%1 ").arg(*it_s); 625 ii++; 626 if (ii % 10 == 0) { 627 *stream << QString("%1%2") 628 .arg(emptyFillStr, 0) 629 .arg(hlp, 0) 630 .leftJustified(60) 631 << "SYS / PHASE SHIFT\n"; 632 hlp = ""; 633 } 634 } 635 if (hlp.size()) { 636 *stream << QString("%1%2") 637 .arg(emptyFillStr, 0) 638 .arg(hlp, 0) 567 639 .leftJustified(60) 568 << "SYS / PHASE SHIFT\n"; 569 } 570 } else { 571 QMultiHash<char, QPair<QString, double> >::const_iterator it = _phaseShifts.begin(); 572 while(it != _phaseShifts.end()) { 573 *stream << QString("%1%2%3") 574 .arg(it.key(), 0) 575 .arg(it.value().first, 4) 576 .arg(it.value().second, 9, 'f', 5) 577 .leftJustified(60) 578 << "SYS / PHASE SHIFT\n"; 579 it++; 640 << "SYS / PHASE SHIFT\n"; 641 } 580 642 } 581 643 } … … 623 685 } 624 686 } 625 626 687 627 688 *stream << QString() -
trunk/BNC/src/rinex/rnxobsfile.h
r6795 r6815 44 44 public: 45 45 static const double defaultRnxObsVersion2 = 2.11; 46 static const double defaultRnxObsVersion3 = 3.0 2;46 static const double defaultRnxObsVersion3 = 3.03; 47 47 static const QString defaultSystems; 48 48 … … 87 87 int _wlFactorsL2[t_prn::MAXPRN_GPS+1]; 88 88 bncTime _startTime; 89 QM ultiHash<char, QPair<QString, double> > _phaseShifts;89 QMap<QString, QPair<double, QStringList> > _phaseShifts; 90 90 }; 91 91
Note:
See TracChangeset
for help on using the changeset viewer.