Changeset 2676 in ntrip for trunk/BNC/RTCM3
- Timestamp:
- Nov 13, 2010, 10:32:55 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r2674 r2676 126 126 if (_rawFile) { 127 127 _staID_corrections = _rawFile->staID(); 128 129 128 } 129 else { 130 130 _mode = corrections; 131 131 } 132 132 } 133 133 } … … 153 153 // ----------------------- 154 154 if (newParser) { 155 memset(&parser, 0, sizeof(parser)); 155 156 parser.rinex3 = 0; 156 memset(&parser, 0, sizeof(parser));157 157 double secGPS; 158 158 currentGPSWeeks(parser.GPSWeek, secGPS); … … 162 162 // Remaining part decodes the Observations 163 163 // --------------------------------------- 164 if (_mode == unknown || _mode == observations || _checkMountPoint == _staID || _checkMountPoint == "ALL") { 164 if (_mode == unknown || _mode == observations || 165 _checkMountPoint == _staID || _checkMountPoint == "ALL") { 165 166 166 167 for (int ii = 0; ii < bufLen; ii++) { … … 169 170 if (parser.MessageSize >= parser.NeedBytes) { 170 171 171 while (int rr = RTCM3Parser(&parser)) {172 while (int rr = RTCM3Parser(&parser)) { 172 173 173 174 // RTCMv3 message types … … 177 178 // RTCMv3 antenna descriptor 178 179 // ------------------------- 179 if(rr == 1007 || rr == 1008 || rr == 1033) 180 { 181 _antType.push_back(parser.antenna); /* correct ? */ 180 if (rr == 1007 || rr == 1008 || rr == 1033) { 181 _antType.push_back(parser.antenna); 182 182 } 183 183 184 184 // RTCMv3 antenna XYZ 185 185 // ------------------ 186 else if(rr == 1005) 187 { 188 _antList.push_back(t_antInfo()); 189 _antList.back().type = t_antInfo::ARP; 190 _antList.back().xx = parser.antX * 1e-4; 191 _antList.back().yy = parser.antY * 1e-4; 192 _antList.back().zz = parser.antZ * 1e-4; 193 _antList.back().message = rr; 194 195 // Remember station position for 1003 message decoding 196 _antXYZ[0] = parser.antX * 1e-4; 197 _antXYZ[1] = parser.antY * 1e-4; 198 _antXYZ[2] = parser.antZ * 1e-4; 186 else if (rr == 1005) { 187 _antList.push_back(t_antInfo()); 188 _antList.back().type = t_antInfo::ARP; 189 _antList.back().xx = parser.antX * 1e-4; 190 _antList.back().yy = parser.antY * 1e-4; 191 _antList.back().zz = parser.antZ * 1e-4; 192 _antList.back().message = rr; 193 194 // Remember station position for 1003 message decoding 195 _antXYZ[0] = parser.antX * 1e-4; 196 _antXYZ[1] = parser.antY * 1e-4; 197 _antXYZ[2] = parser.antZ * 1e-4; 199 198 } 200 199 201 200 // RTCMv3 antenna XYZ-H 202 201 // -------------------- 203 else if(rr == 1006) 204 { 205 _antList.push_back(t_antInfo()); 206 _antList.back().type = t_antInfo::ARP; 207 _antList.back().xx = parser.antX * 1e-4; 208 _antList.back().yy = parser.antY * 1e-4; 209 _antList.back().zz = parser.antZ * 1e-4; 210 _antList.back().height = parser.antH * 1e-4; 211 _antList.back().height_f = true; 212 _antList.back().message = rr; 213 214 // Remember station position for 1003 message decoding 215 _antXYZ[0] = parser.antX * 1e-4; 216 _antXYZ[1] = parser.antY * 1e-4; 217 _antXYZ[2] = parser.antZ * 1e-4; 202 else if(rr == 1006) { 203 _antList.push_back(t_antInfo()); 204 _antList.back().type = t_antInfo::ARP; 205 _antList.back().xx = parser.antX * 1e-4; 206 _antList.back().yy = parser.antY * 1e-4; 207 _antList.back().zz = parser.antZ * 1e-4; 208 _antList.back().height = parser.antH * 1e-4; 209 _antList.back().height_f = true; 210 _antList.back().message = rr; 211 212 // Remember station position for 1003 message decoding 213 _antXYZ[0] = parser.antX * 1e-4; 214 _antXYZ[1] = parser.antY * 1e-4; 215 _antXYZ[2] = parser.antZ * 1e-4; 218 216 } 219 217 … … 228 226 } 229 227 230 // apply "GPS Integer L1 Pseudorange Modulus Ambiguity"231 bool applyModulusAmb = false;232 ///if (rr == 2) {233 /// applyModulusAmb = true;234 ///}235 236 228 if (rr == 2) { 237 emit(newMessage( (_staID + ": No valid RINEX! All values are modulo 299792.458!").toAscii(), true)); 229 emit(newMessage( (_staID + 230 ": No valid RINEX! All values are modulo 299792.458!").toAscii(), 231 true)); 238 232 } 239 233 … … 269 263 obs->_o.satSys = 'E'; 270 264 obs->_o.satNum = satID - PRN_GALILEO_START + 1; 271 265 } 272 266 273 267 // WAAS … … 282 276 else if (satID >= PRN_GIOVE_START && satID <= PRN_GIOVE_END) { 283 277 obs->_o.satSys = 'E'; 284 285 278 obs->_o.satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET; 279 } 286 280 287 281 // Unknown System … … 290 284 delete obs; 291 285 obs = 0; 292 286 } 293 287 294 288 if (obs) { … … 302 296 obs->_o.GPSWeeks = parser.Data.timeofweek / 1000.0; 303 297 304 // Estimate "GPS Integer L1 Pseudorange Modulus Ambiguity" 305 // ------------------------------------------------------- 306 double modulusAmb = 0; 307 if (applyModulusAmb) { 308 // Missing antenna coordinates: skip all data 309 if ( !_antXYZ[0] && !_antXYZ[1] && !_antXYZ[2] ) { 310 continue; 311 } 312 313 ostringstream prns; 314 prns << obs->_o.satSys << setfill('0') << setw(2) << obs->_o.satNum; 315 316 string prn = prns.str(); 317 318 // Missing ephemerides, skip satellite 319 if (_ephList.find(prn) == _ephList.end()) { 320 continue; 321 } 322 323 const t_eph* eph = &(_ephList.find(prn)->second); 324 325 double rho, xSat, ySat, zSat, clkSat, GPSWeeks_tot; 326 int GPSWeek_tot; 327 cmpRho(eph, _antXYZ[0], _antXYZ[1], _antXYZ[2], 328 obs->_o.GPSWeek, obs->_o.GPSWeeks, 329 rho, GPSWeek_tot, GPSWeeks_tot, 330 xSat, ySat, zSat, clkSat); 331 332 const double CC = 299792458.0; 333 334 int nn = static_cast<int>(rho / (CC * 0.001)); 335 336 modulusAmb = nn * CC * 0.001; 337 } 338 339 // Loop over all data types 340 // ------------------------ 298 // Loop over all data types 299 // ------------------------ 341 300 for (int jj = 0; jj < parser.numdatatypesGPS; jj++) { 342 301 int v = 0; … … 371 330 // variables df and pos are used consequently. Perlt 372 331 if (df & GNSSDF_C1DATA) { 373 obs->_o.C1 = parser.Data.measdata[ii][pos] + modulusAmb;332 obs->_o.C1 = parser.Data.measdata[ii][pos]; 374 333 } 375 334 else if (df & GNSSDF_C2DATA) { 376 obs->_o.C2 = parser.Data.measdata[ii][pos] + modulusAmb;335 obs->_o.C2 = parser.Data.measdata[ii][pos]; 377 336 } 378 337 else if (df & GNSSDF_P1DATA) { 379 obs->_o.P1 = parser.Data.measdata[ii][pos] + modulusAmb;338 obs->_o.P1 = parser.Data.measdata[ii][pos]; 380 339 } 381 340 else if (df & GNSSDF_P2DATA) { 382 obs->_o.P2 = parser.Data.measdata[ii][pos] + modulusAmb;341 obs->_o.P2 = parser.Data.measdata[ii][pos]; 383 342 } 384 343 else if (df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) { 385 obs->_o.L1 = parser.Data.measdata[ii][pos] + modulusAmb;344 obs->_o.L1 = parser.Data.measdata[ii][pos]; 386 345 obs->_o.SNR1 = parser.Data.snrL1[ii]; 387 346 obs->_o.lock_timei_L1 = parser.lastlockGPSl1[isat]; 388 347 } 389 348 else if (df & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) { 390 obs->_o.L2 = parser.Data.measdata[ii][pos] + modulusAmb;349 obs->_o.L2 = parser.Data.measdata[ii][pos]; 391 350 obs->_o.SNR2 = parser.Data.snrL2[ii]; 392 351 obs->_o.lock_timei_L2 = parser.lastlockGPSl2[isat]; … … 407 366 else if (rr == 1019) { 408 367 decoded = true; 409 gpsephemeris* ep = new gpsephemeris(parser.ephemerisGPS); 410 emit newGPSEph(ep); 368 emit newGPSEph(new gpsephemeris(parser.ephemerisGPS)); 411 369 } 412 370 … … 415 373 else if (rr == 1020) { 416 374 decoded = true; 417 glonassephemeris* ep = new glonassephemeris(parser.ephemerisGLONASS); 418 emit newGlonassEph(ep); 375 emit newGlonassEph(new glonassephemeris(parser.ephemerisGLONASS)); 419 376 } 420 377 } … … 436 393 437 394 // Store ephemerides 438 ////////////////////////////////////////////////////////////////////////////// //////////395 ////////////////////////////////////////////////////////////////////////////// 439 396 bool RTCM3Decoder::storeEph(const gpsephemeris& gpseph) { 440 397 t_ephGPS eph; eph.set(&gpseph);
Note:
See TracChangeset
for help on using the changeset viewer.