Changeset 3659 in ntrip for trunk/BNC/rnxnavfile.cpp
- Timestamp:
- Feb 3, 2012, 5:34:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/rnxnavfile.cpp
r3658 r3659 42 42 #include "rnxnavfile.h" 43 43 #include "bncutils.h" 44 #include "RTCM3/ephemeris.h" 44 45 45 46 using namespace std; … … 49 50 t_rnxNavFile::t_rnxNavHeader::t_rnxNavHeader() { 50 51 _version = 0.0; 52 _glonass = false; 51 53 } 52 54 … … 72 74 QTextStream in(value.toAscii(), QIODevice::ReadOnly); 73 75 in >> _version; 76 if (value.indexOf("GLONASS") != -1) { 77 _glonass = true; 78 } 74 79 } 75 80 } … … 96 101 } 97 102 103 // Read Next Ephemeris 104 //////////////////////////////////////////////////////////////////////////// 105 t_irc t_rnxNavFile::getNextEph(t_eph* eph) { 106 107 while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) { 108 QString line = _stream->readLine(); 109 if (line.isEmpty()) { 110 continue; 111 } 112 QStringList hlp = line.split(QRegExp("\\s+"), QString::SkipEmptyParts); 113 QString prn; 114 if (version() >= 3.0) { 115 prn = hlp.at(0); 116 } 117 else { 118 if (glonass()) { 119 prn = 'R' + QString("%1").arg(hlp.at(0).toInt(), 2, QChar('0')); 120 } 121 else { 122 prn = 'G' + QString("%1").arg(hlp.at(0).toInt(), 2, QChar('0')); 123 } 124 } 125 QStringList lines; lines << line; 126 if (prn[0] == 'G') { 127 for (int ii = 1; ii < 8; ii++) { 128 lines << _stream->readLine(); 129 } 130 eph = new t_ephGPS(version(), lines); 131 } 132 else if (prn[0] == 'R') { 133 for (int ii = 1; ii < 4; ii++) { 134 lines << _stream->readLine(); 135 } 136 eph = new t_ephGlo(version(), lines); 137 } 138 else if (prn[0] == 'E') { 139 for (int ii = 1; ii < 8; ii++) { 140 lines << _stream->readLine(); 141 } 142 eph = new t_ephGal(version(), lines); 143 } 144 else { 145 return failure; 146 } 147 if (!eph->ok()) { 148 delete eph; 149 eph = 0; 150 return failure; 151 } 152 } 153 154 return success; 155 }
Note:
See TracChangeset
for help on using the changeset viewer.