Changeset 6137 in ntrip for trunk/BNC/src/RTCM
- Timestamp:
- Sep 13, 2014, 12:19:37 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM/RTCM2Decoder.cpp
r4403 r6137 46 46 #include "../bncutils.h" 47 47 #include "rtcm_utils.h" 48 #include "GPSDecoder.h"49 48 #include "RTCM2Decoder.h" 50 49 … … 137 136 138 137 for (int iSat=0; iSat < _ObsBlock.nSat; iSat++) { 139 t_ obs obs;138 t_satObs obs; 140 139 if (_ObsBlock.PRN[iSat] > 100) { 141 obs.satNum = _ObsBlock.PRN[iSat] % 100; 142 obs.satSys = 'R'; 140 obs._prn.set('R', _ObsBlock.PRN[iSat] % 100); 143 141 } 144 else { 145 obs.satNum = _ObsBlock.PRN[iSat]; 146 obs.satSys = 'G'; 142 else { 143 obs._prn.set('R', _ObsBlock.PRN[iSat]); 147 144 } 148 obs.GPSWeek = epochWeek; 149 obs.GPSWeeks = epochSecs; 150 obs.setMeasdata("C1", 2.0, _ObsBlock.rng_C1[iSat]); 151 obs.setMeasdata("P1", 2.0, _ObsBlock.rng_P1[iSat]); 152 obs.setMeasdata("P2", 2.0, _ObsBlock.rng_P2[iSat]); 153 obs.setMeasdata("L1", 2.0, _ObsBlock.resolvedPhase_L1(iSat)); 154 obs.setMeasdata("L2", 2.0, _ObsBlock.resolvedPhase_L2(iSat)); 155 obs.slip_cnt_L1 = _ObsBlock.slip_L1[iSat]; 156 obs.slip_cnt_L2 = _ObsBlock.slip_L2[iSat]; 145 obs._time.set(epochWeek, epochSecs); 146 t_frqObs* frqObs1C = new t_frqObs; 147 frqObs1C->_rnxType2ch = "1C"; 148 frqObs1C->_codeValid = true; 149 frqObs1C->_code = _ObsBlock.rng_C1[iSat]; 150 obs._obs.push_back(frqObs1C); 151 152 t_frqObs* frqObs1P = new t_frqObs; 153 frqObs1P->_rnxType2ch = "1P"; 154 frqObs1P->_codeValid = true; 155 frqObs1P->_code = _ObsBlock.rng_P1[iSat]; 156 obs._obs.push_back(frqObs1P); 157 frqObs1P->_phaseValid = true; 158 frqObs1P->_phase = _ObsBlock.resolvedPhase_L1(iSat); 159 frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat]; 160 obs._obs.push_back(frqObs1P); 161 162 t_frqObs* frqObs2P = new t_frqObs; 163 frqObs2P->_rnxType2ch = "2P"; 164 frqObs2P->_codeValid = true; 165 frqObs2P->_code = _ObsBlock.rng_P2[iSat]; 166 obs._obs.push_back(frqObs2P); 167 frqObs2P->_phaseValid = true; 168 frqObs2P->_phase = _ObsBlock.resolvedPhase_L2(iSat); 169 frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat]; 170 obs._obs.push_back(frqObs2P); 157 171 158 172 _obsList.push_back(obs); … … 283 297 284 298 // new observation 285 t_obs* new_obs = 0; 299 t_satObs* new_obs = 0; 300 301 t_frqObs* frqObs1C = new t_frqObs; 302 frqObs1C->_rnxType2ch = "1C"; 303 new_obs->_obs.push_back(frqObs1C); 304 305 t_frqObs* frqObs1P = new t_frqObs; 306 frqObs1P->_rnxType2ch = "1P"; 307 new_obs->_obs.push_back(frqObs1P); 308 309 t_frqObs* frqObs2P = new t_frqObs; 310 frqObs2P->_rnxType2ch = "2P"; 311 new_obs->_obs.push_back(frqObs2P); 286 312 287 313 // missing IOD … … 354 380 // ------------------- 355 381 if ( !new_obs ) { 356 new_obs = new t_ obs();357 358 new_obs->StatID[0] = '\x0';359 new_obs->satSys = (corr->PRN < 200 ? 'G' : 'R'); 360 new_obs->satNum = (corr->PRN < 200 ? corr->PRN : corr->PRN - 200); 361 362 new_obs->GPSWeek = GPSWeek_rcv; 363 new_obs-> GPSWeeks = GPSWeeks_rcv;382 new_obs = new t_satObs(); 383 if (corr->PRN < 200) { 384 new_obs->_prn.set('G', corr->PRN); 385 } 386 else { 387 new_obs->_prn.set('R', corr->PRN-200); 388 } 389 new_obs->_time.set(GPSWeek_rcv, GPSWeeks_rcv); 364 390 } 365 391 … … 368 394 switch (ii) { 369 395 case 0: // --- L1 --- 370 new_obs->setMeasdata("L1", 2.0, *obsVal / LAMBDA_1); 371 new_obs->slip_cnt_L1 = corr->lock1; 396 frqObs1P->_phaseValid = true; 397 frqObs1P->_phase = *obsVal / LAMBDA_1; 398 frqObs1P->_slipCounter = corr->lock1; 372 399 break; 373 400 case 1: // --- L2 --- 374 new_obs->setMeasdata("L2", 2.0, *obsVal / LAMBDA_2); 375 new_obs->slip_cnt_L2 = corr->lock2; 401 frqObs2P->_phaseValid = true; 402 frqObs2P->_phase = *obsVal / LAMBDA_2; 403 frqObs2P->_slipCounter = corr->lock2; 376 404 break; 377 405 case 2: // --- C1 / P1 --- 378 if ( corr->Pind1 ) 379 new_obs->setMeasdata("P1", 2.0, *obsVal); 380 else 381 new_obs->setMeasdata("C1", 2.0, *obsVal); 406 if ( corr->Pind1 ) { 407 frqObs1P->_codeValid = true; 408 frqObs1P->_code = *obsVal; 409 } 410 else { 411 frqObs1C->_codeValid = true; 412 frqObs1C->_code = *obsVal; 413 } 382 414 break; 383 415 case 3: // --- C2 / P2 --- 384 if ( corr->Pind2 ) 385 new_obs->setMeasdata("P2", 2.0, *obsVal);386 else 387 new_obs->setMeasdata("C2", 2.0, *obsVal);416 if ( corr->Pind2 ) { 417 frqObs2P->_codeValid = true; 418 frqObs2P->_code = *obsVal; 419 } 388 420 break; 389 421 default:
Note:
See TracChangeset
for help on using the changeset viewer.