Changeset 6137 in ntrip for trunk/BNC/src/RTCM3
- Timestamp:
- Sep 13, 2014, 12:19:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r5545 r6137 228 228 for (int iSat = 0; iSat < gnssData.numsats; iSat++) { 229 229 230 t_ obs obs;230 t_satObs obs; 231 231 int satID = gnssData.satellites[iSat]; 232 232 … … 234 234 // --- 235 235 if (satID >= PRN_GPS_START && satID <= PRN_GPS_END) { 236 obs.satSys = 'G'; 237 obs.satNum = satID; 236 obs._prn.set('G', satID); 238 237 } 239 238 … … 241 240 // ------- 242 241 else if (satID >= PRN_GLONASS_START && satID <= PRN_GLONASS_END) { 243 obs.satSys = 'R'; 244 obs.satNum = satID - PRN_GLONASS_START + 1; 245 if (obs.satNum <= PRN_GLONASS_NUM && 246 parser.GLOFreq[obs.satNum-1] != 0) { 247 obs.slotNum = parser.GLOFreq[obs.satNum-1] - 100; 248 } 249 else { 250 continue; 251 } 242 obs._prn.set('R', satID - PRN_GLONASS_START + 1); 252 243 } 253 244 … … 255 246 // ------- 256 247 else if (satID >= PRN_GALILEO_START && satID <= PRN_GALILEO_END) { 257 obs.satSys = 'E'; 258 obs.satNum = satID - PRN_GALILEO_START + 1; 248 obs._prn.set('E', satID - PRN_GALILEO_START + 1); 259 249 } 260 250 … … 262 252 // ---- 263 253 else if (satID >= PRN_SBAS_START && satID <= PRN_SBAS_END) { 264 obs.satSys = 'S'; 265 obs.satNum = satID - PRN_SBAS_START + 20; 254 obs._prn.set('S', satID - PRN_SBAS_START + 20); 266 255 } 267 256 … … 269 258 // ------------- 270 259 else if (satID >= PRN_GIOVE_START && satID <= PRN_GIOVE_END) { 271 obs.satSys = 'E'; 272 obs.satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET; 260 obs._prn.set('E', satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET); 273 261 } 274 262 … … 276 264 // ------------- 277 265 else if (satID >= PRN_QZSS_START && satID <= PRN_QZSS_END) { 278 obs.satSys = 'J'; 279 obs.satNum = satID - PRN_QZSS_START + 1; 266 obs._prn.set('J', satID - PRN_QZSS_START + 1); 280 267 } 281 268 … … 283 270 // ------------- 284 271 else if (satID >= PRN_COMPASS_START && satID <= PRN_COMPASS_END) { 285 obs.satSys = 'C'; 286 obs.satNum = satID - PRN_COMPASS_START + 1; 272 obs._prn.set('C', satID - PRN_COMPASS_START + 1); 287 273 } 288 274 … … 293 279 } 294 280 295 obs.GPSWeek = gnssData.week; 296 obs.GPSWeeks = gnssData.timeofweek / 1000.0; 297 298 QString prn = QString("%1%2").arg(obs.satSys) 299 .arg(obs.satNum, 2, 10, QChar('0')); 281 obs._time.set(gnssData.week, gnssData.timeofweek / 1000.0); 282 283 QString prn(obs._prn.toString().c_str()); 284 285 int obs_slip_cnt_L1 = 0; 286 int obs_slip_cnt_L2 = 0; 287 int obs_slip_cnt_L5 = 0; 300 288 301 289 // Handle loss-of-lock flags … … 314 302 _slip_cnt_L1[prn] = 1; 315 303 } 316 obs .slip_cnt_L1 = _slip_cnt_L1[prn];304 obs_slip_cnt_L1 = _slip_cnt_L1[prn]; 317 305 } 318 306 if (GNSSDF2_LOCKLOSSL2 & gnssData.dataflags2[iSat]) { … … 323 311 _slip_cnt_L2[prn] = 1; 324 312 } 325 obs .slip_cnt_L2 = _slip_cnt_L2[prn];313 obs_slip_cnt_L2 = _slip_cnt_L2[prn]; 326 314 } 327 315 if (GNSSDF2_LOCKLOSSL5 & gnssData.dataflags2[iSat]) { … … 332 320 _slip_cnt_L5[prn] = 1; 333 321 } 334 obs.slip_cnt_L5 = _slip_cnt_L5[prn]; 335 } 336 337 obs._dataflags = gnssData.dataflags[iSat]; 338 obs._dataflags2 = gnssData.dataflags2[iSat]; 322 obs_slip_cnt_L5 = _slip_cnt_L5[prn]; 323 } 339 324 340 325 // Loop over all data types 341 326 // ------------------------ 342 327 for (int iEntry = 0; iEntry < GNSSENTRY_NUMBER; ++iEntry) { 343 obs._measdata[iEntry] = gnssData.measdata[iSat][iEntry]; 344 obs._codetype[iEntry] = gnssData.codetype[iSat][iEntry]; 328 if (gnssData.codetype[iSat][iEntry] == 0) { 329 continue; 330 } 331 string rnxType(gnssData.codetype[iSat][iEntry]); 332 cout << "rnxType " << rnxType << endl; 333 334 t_frqObs* frqObs = 0; 335 for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) { 336 if (obs._obs[iFrq]->_rnxType2ch == rnxType) { 337 frqObs = obs._obs[iFrq]; 338 break; 339 } 340 } 341 if (frqObs == 0) { 342 frqObs = new t_frqObs; 343 frqObs->_rnxType2ch = rnxType; 344 obs._obs.push_back(frqObs); 345 } 346 347 switch(iEntry & 3) { 348 case GNSSENTRY_CODE: 349 frqObs->_codeValid = true; 350 frqObs->_code = gnssData.measdata[iSat][iEntry]; 351 break; 352 case GNSSENTRY_PHASE: 353 frqObs->_phaseValid = true; 354 frqObs->_phase = gnssData.measdata[iSat][iEntry]; 355 if (rnxType[0] == '1') { 356 frqObs->_slipCounter = obs_slip_cnt_L1; 357 } 358 else if (rnxType[0] == '2') { 359 frqObs->_slipCounter = obs_slip_cnt_L2; 360 } 361 else if (rnxType[0] == '5') { 362 frqObs->_slipCounter = obs_slip_cnt_L5; 363 } 364 break; 365 case GNSSENTRY_DOPPLER: 366 frqObs->_dopplerValid = true; 367 frqObs->_doppler = gnssData.measdata[iSat][iEntry]; 368 break; 369 case GNSSENTRY_SNR: 370 frqObs->_snrValid = true; 371 frqObs->_snr = gnssData.measdata[iSat][iEntry]; 372 break; 373 } 345 374 } 346 375 _obsList.push_back(obs);
Note:
See TracChangeset
for help on using the changeset viewer.