Changeset 6841 in ntrip for trunk/BNC/src/rinex
- Timestamp:
- May 19, 2015, 11:24:19 AM (10 years ago)
- Location:
- trunk/BNC/src/rinex
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/rinex/reqcedit.cpp
r6809 r6841 244 244 } 245 245 246 // Put together all phase shifts 247 // ----------------------------- 248 QStringList phaseShifts; 249 if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) { 250 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) { 251 t_rnxObsFile* obsFile = _rnxObsFiles[ii]; 252 phaseShifts << obsFile->phaseShifts(); 253 } 254 phaseShifts.removeDuplicates(); 255 } 256 257 // Put together all GLONASS biases 258 // ------------------------------- 259 QStringList gloBiases; 260 if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) { 261 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) { 262 t_rnxObsFile* obsFile = _rnxObsFiles[ii]; 263 if (ii == 0 && obsFile->numGloBiases() == 4) { 264 break; 265 } 266 else { 267 gloBiases << obsFile->gloBiases(); 268 } 269 } 270 gloBiases.removeDuplicates(); 271 } 272 273 // Put together all GLONASS slots 274 // ----------------------------- 275 QStringList gloSlots; 276 if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) { 277 for (int ii = 0; ii < _rnxObsFiles.size(); ii++) { 278 t_rnxObsFile* obsFile = _rnxObsFiles[ii]; 279 if (ii == 0 && 280 obsFile->numGloSlots() == signed(t_prn::MAXPRN_GLONASS)) { 281 break; 282 } 283 else { 284 gloSlots << obsFile->gloSlots(); 285 } 286 } 287 gloSlots.removeDuplicates(); 288 } 289 246 290 // Loop over all input observation files 247 291 // ------------------------------------- … … 254 298 } 255 299 if (ii == 0) { 256 outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes); 300 outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes, 301 &phaseShifts, &gloBiases, &gloSlots); 257 302 if (_begTime.valid() && _begTime > outObsFile.startTime()) { 258 303 outObsFile.setStartTime(_begTime); -
trunk/BNC/src/rinex/rnxobsfile.cpp
r6817 r6841 244 244 in >> type >> value; 245 245 if (type.size()) 246 _glo PhaseBiases[type] = value;246 _gloBiases[type] = value; 247 247 } 248 248 } … … 345 345 //////////////////////////////////////////////////////////////////////////// 346 346 void t_rnxObsHeader::set(const t_rnxObsHeader& header, int version, 347 const QStringList* useObsTypes) { 347 const QStringList* useObsTypes, 348 const QStringList* phaseShifts, 349 const QStringList* gloBiases, 350 const QStringList* gloSlots) { 348 351 349 352 if (version <= 2) { … … 370 373 _comments = header._comments; 371 374 _usedSystems = header._usedSystems; 372 if (_version >= 3.0) { 373 _phaseShifts = header._phaseShifts; 374 _gloPhaseBiases = header._gloPhaseBiases; 375 _gloSlots = header._gloSlots; 376 } 375 377 376 for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) { 378 377 _wlFactorsL1[iPrn] = header._wlFactorsL1[iPrn]; … … 456 455 } 457 456 } 457 458 if (_version >= 3.0) { 459 // set phase shifts 460 if (!phaseShifts || phaseShifts->empty()) { 461 _phaseShifts = header._phaseShifts; 462 } 463 else { 464 foreach (const QString &str, *phaseShifts) { 465 QStringList hlp = str.split("_", QString::SkipEmptyParts); 466 QStringList hlp1 = hlp.last().split(":", QString::SkipEmptyParts); 467 QString type = hlp.first(); 468 double shift = hlp1.first().toDouble(); 469 hlp1.removeFirst(); 470 QStringList &satList = hlp1; 471 QMap<QString, QPair<double, QStringList> >::iterator it = _phaseShifts.find(type); 472 if ( it != _phaseShifts.end()) { 473 it.value().second.append(satList); 474 it.value().second.removeDuplicates(); 475 } 476 else { 477 _phaseShifts.insert(type, QPair<double, QStringList>(shift, satList)); 478 } 479 } 480 } 481 // set GLONASS biases 482 if (!gloBiases || gloBiases->empty()) { 483 _gloBiases = header._gloBiases; 484 } 485 else { 486 foreach (const QString &str, *gloBiases) { 487 QStringList hlp = str.split(":", QString::SkipEmptyParts); 488 QString type = hlp.first();; 489 double value = hlp.last().toDouble(); 490 if (type.size()) 491 _gloBiases[type] = value; 492 } 493 } 494 // set GLONASS slots 495 if (!gloSlots || gloSlots->empty()) { 496 _gloSlots = header._gloSlots; 497 } 498 else { 499 foreach (const QString &str, *gloSlots) { 500 QStringList hlp = str.split(":", QString::SkipEmptyParts); 501 QString sat = hlp.first(); 502 int slot = hlp.last().toInt(); 503 t_prn prn; 504 prn.set(sat.toStdString()); 505 if(sat.size()) 506 _gloSlots[prn] = slot; 507 } 508 } 509 } 458 510 } 459 511 … … 646 698 if (_version >= 3.0) { 647 699 QString hlp = ""; 648 QMap<QString, double>::const_iterator it = _glo PhaseBiases.begin();649 while (it != _glo PhaseBiases.end()){700 QMap<QString, double>::const_iterator it = _gloBiases.begin(); 701 while (it != _gloBiases.end()){ 650 702 hlp += QString("%1%2").arg(it.key(), 4).arg(it.value(), 9, 'f', 3); 651 703 it++; … … 723 775 } 724 776 777 // Number of GLONASS biases 778 //////////////////////////////////////////////////////////////////////////// 779 int t_rnxObsHeader::numGloBiases() const { 780 return _gloBiases.size(); 781 } 782 783 // Number of GLONASS biases 784 //////////////////////////////////////////////////////////////////////////// 785 int t_rnxObsHeader::numGloSlots() const { 786 return _gloSlots.size(); 787 } 788 725 789 // Observation Type (satellite-system specific) 726 790 //////////////////////////////////////////////////////////////////////////// … … 743 807 } 744 808 return ""; 809 } 810 811 // 812 //////////////////////////////////////////////////////////////////////////// 813 QStringList t_rnxObsHeader::phaseShifts() const { 814 QStringList strList; 815 QMap<QString, QPair<double, QStringList> >::const_iterator it = _phaseShifts.begin(); 816 while (it != _phaseShifts.end()) { 817 strList.append(QString("%1_%2:%3").arg(it.key(), 3).arg(it.value().first, 9, 'f', 3).arg(it.value().second.join(""))); 818 it++; 819 } 820 return strList; 821 } 822 823 // 824 //////////////////////////////////////////////////////////////////////////// 825 QStringList t_rnxObsHeader::gloBiases() const { 826 QStringList strList; 827 QMap<QString, double>::const_iterator it = _gloBiases.begin(); 828 while (it != _gloBiases.end()) { 829 strList.append(QString("%1:%2").arg(it.key(), 3).arg(it.value(), 9, 'f', 3)); 830 it++; 831 } 832 return strList; 833 } 834 835 // 836 //////////////////////////////////////////////////////////////////////////// 837 QStringList t_rnxObsHeader::gloSlots() const { 838 QStringList strList; 839 QMap<t_prn, int>::const_iterator it = _gloSlots.begin(); 840 while (it != _gloSlots.end()){ 841 QString prn(it.key().toString().c_str()); 842 strList.append(QString("%1:%2").arg(prn, 3).arg(it.value())); 843 it++; 844 } 845 return strList; 745 846 } 746 847 -
trunk/BNC/src/rinex/rnxobsfile.h
r6815 r6841 53 53 t_irc read(QTextStream* stream, int maxLines = 0); 54 54 void setDefault(const QString& markerName, int version); 55 void set(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0); 55 void set(const t_rnxObsHeader& header, int version, 56 const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0, 57 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0); 56 58 int numSys() const; 57 59 char system(int iSys) const; 58 60 int nTypes(char sys) const; 61 int numGloBiases() const; 62 int numGloSlots() const; 59 63 QString obsType(char sys, int index, double version = 0.0) const; 64 QStringList phaseShifts() const; 65 QStringList gloBiases() const; 66 QStringList gloSlots() const; 60 67 void write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const; 61 68 bncTime startTime() const {return _startTime;} … … 83 90 QMap<char, QStringList> _obsTypes; 84 91 QMap<t_prn, int> _gloSlots; 85 QMap<QString, double> _glo PhaseBiases;92 QMap<QString, double> _gloBiases; 86 93 int _wlFactorsL1[t_prn::MAXPRN_GPS+1]; 87 94 int _wlFactorsL2[t_prn::MAXPRN_GPS+1]; … … 134 141 char system(int iSys) const {return _header.system(iSys);} 135 142 int nTypes(char sys) const {return _header.nTypes(sys);} 143 int numGloBiases() const {return _header.numGloBiases();} 144 int numGloSlots() const {return _header.numGloSlots();} 136 145 const QString& fileName() const {return _fileName;} 137 146 QString obsType(char sys, int index, double version = 0.0) const { 138 147 return _header.obsType(sys, index, version); 139 148 } 149 QStringList phaseShifts() const {return _header.phaseShifts();} 150 QStringList gloBiases() const {return _header.gloBiases();} 151 QStringList gloSlots() const {return _header.gloSlots();} 140 152 const QString& antennaName() const {return _header._antennaName;} 141 153 const QString& antennaNumber() const {return _header._antennaNumber;} … … 175 187 const t_rnxObsHeader& header() const {return _header;} 176 188 177 void setHeader(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0) { 178 _header.set(header, version, useObsTypes); 189 void setHeader(const t_rnxObsHeader& header, int version, 190 const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0, 191 const QStringList* gloBiases = 0, const QStringList* gloSlots = 0) { 192 _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots); 179 193 } 180 194
Note:
See TracChangeset
for help on using the changeset viewer.