Changeset 325 in ntrip
- Timestamp:
- Nov 21, 2006, 9:27:35 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtcm3torinex/rtcm3torinex.c
r318 r325 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1. 9 2006/11/08 17:11:08stoecker Exp $3 $Id: rtcm3torinex.c,v 1.10 2006/11/15 12:31:31 stoecker Exp $ 4 4 Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu> 5 5 … … 51 51 52 52 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1. 9$";53 static char revisionstr[] = "$Revision: 1.10 $"; 54 54 55 55 static uint32_t CRC24(long size, const unsigned char *buf) … … 303 303 } 304 304 GETBITS(l1range, 24); 305 if( l1range!= 0x80000)305 if((l1range&((1<<24)-1)) != 0x80000) 306 306 { 307 307 gnss->dataflags[num] |= c; … … 309 309 } 310 310 GETBITSSIGN(i, 20); 311 if( i!= 0x80000)311 if((i&((1<<20)-1)) != 0x80000) 312 312 { 313 313 gnss->dataflags[num] |= l; … … 356 356 } 357 357 GETBITSSIGN(i,14); 358 if( i!= 0x2000)358 if((i&((1<<14)-1)) != 0x2000) 359 359 { 360 360 gnss->dataflags[num] |= c; … … 363 363 } 364 364 GETBITSSIGN(i,20); 365 if( i!= 0x80000)365 if((i&((1<<20)-1)) != 0x80000) 366 366 { 367 367 gnss->dataflags[num] |= l; … … 446 446 { 447 447 int sv, code, l1range, c,l,s,ce,le,se,amb=0; 448 int freq; 448 449 449 450 GETBITS(sv, 6) 450 if(!sv || sv > 24) 451 { 452 --num; --gnss->numsats; 451 gnss->satellites[num] = sv-1 + PRN_GLONASS_START; 452 /* L1 */ 453 GETBITS(code, 1) 454 GETBITS(freq, 5) 455 if(code) 456 { 457 c = GNSSDF_P1DATA; ce = GNSSENTRY_P1DATA; 458 l = GNSSDF_L1PDATA; le = GNSSENTRY_L1PDATA; 459 s = GNSSDF_S1PDATA; se = GNSSENTRY_S1PDATA; 453 460 } 454 461 else 455 462 { 456 int freq; 457 gnss->satellites[num] = sv-1 + PRN_GLONASS_START; 458 /* L1 */ 459 GETBITS(code, 1) 460 GETBITS(freq, 5) 463 c = GNSSDF_C1DATA; ce = GNSSENTRY_C1DATA; 464 l = GNSSDF_L1CDATA; le = GNSSENTRY_L1CDATA; 465 s = GNSSDF_S1CDATA; se = GNSSENTRY_S1CDATA; 466 } 467 GETBITS(l1range, 25) 468 if((l1range&((1<<25)-1)) != 0x80000) 469 { 470 gnss->dataflags[num] |= c; 471 gnss->measdata[num][ce] = l1range*0.02; 472 } 473 GETBITSSIGN(i, 20) 474 if((i&((1<<20)-1)) != 0x80000) 475 { 476 gnss->dataflags[num] |= l; 477 gnss->measdata[num][le] = l1range*0.02+i*0.0005; 478 } 479 GETBITS(i, 7) 480 lastlockl1[sv] = i; 481 if(handle->lastlockl1[sv] > i) 482 gnss->dataflags[num] |= GNSSDF_LOCKLOSSL1; 483 if(type == 1010 || type == 1012) 484 { 485 GETBITS(amb,7) 486 if(amb && (gnss->dataflags[num] & c)) 487 { 488 gnss->measdata[num][ce] += amb*599584.916; 489 gnss->measdata[num][le] += amb*599584.916; 490 ++wasamb; 491 } 492 GETBITS(i, 8) 493 if(i) 494 { 495 gnss->dataflags[num] |= s; 496 gnss->measdata[num][se] = i*0.25; 497 i /= 4*4; 498 if(i > 9) i = 9; 499 else if(i < 1) i = 1; 500 gnss->snrL1[num] = i; 501 } 502 } 503 gnss->measdata[num][le] /= GLO_WAVELENGTH_L1(freq-7); 504 if(type == 1011 || type == 1012) 505 { 506 /* L2 */ 507 GETBITS(code,2) 461 508 if(code) 462 509 { 463 c = GNSSDF_P 1DATA; ce = GNSSENTRY_P1DATA;464 l = GNSSDF_L 1PDATA; le = GNSSENTRY_L1PDATA;465 s = GNSSDF_S 1PDATA; se = GNSSENTRY_S1PDATA;510 c = GNSSDF_P2DATA; ce = GNSSENTRY_P2DATA; 511 l = GNSSDF_L2PDATA; le = GNSSENTRY_L2PDATA; 512 s = GNSSDF_S2PDATA; se = GNSSENTRY_S2PDATA; 466 513 } 467 514 else 468 515 { 469 c = GNSSDF_C 1DATA; ce = GNSSENTRY_C1DATA;470 l = GNSSDF_L 1CDATA; le = GNSSENTRY_L1CDATA;471 s = GNSSDF_S 1CDATA; se = GNSSENTRY_S1CDATA;472 } 473 GETBITS (l1range, 25)474 if( l1range != 0x80000)516 c = GNSSDF_C2DATA; ce = GNSSENTRY_C2DATA; 517 l = GNSSDF_L2CDATA; le = GNSSENTRY_L2CDATA; 518 s = GNSSDF_S2CDATA; se = GNSSENTRY_S2CDATA; 519 } 520 GETBITSSIGN(i,14) 521 if((i&((1<<14)-1)) != 0x2000) 475 522 { 476 523 gnss->dataflags[num] |= c; 477 gnss->measdata[num][ce] = l1range*0.02; 478 } 479 GETBITSSIGN(i, 20) 480 if(i != 0x80000) 524 gnss->measdata[num][ce] = l1range*0.02+i*0.02 525 +amb*599584.916; 526 } 527 GETBITSSIGN(i,20) 528 if((i&((1<<20)-1)) != 0x80000) 481 529 { 482 530 gnss->dataflags[num] |= l; 483 gnss->measdata[num][le] = l1range*0.02+i*0.0005; 484 } 485 GETBITS(i, 7) 486 lastlockl1[sv] = i; 487 if(handle->lastlockl1[sv] > i) 488 gnss->dataflags[num] |= GNSSDF_LOCKLOSSL1; 489 if(type == 1010 || type == 1012) 490 { 491 GETBITS(amb,7) 492 if(amb && (gnss->dataflags[num] & c)) 493 { 494 gnss->measdata[num][ce] += amb*599584.916; 495 gnss->measdata[num][le] += amb*599584.916; 496 ++wasamb; 497 } 531 gnss->measdata[num][le] = l1range*0.02+i*0.0005 532 +amb*599584.915; 533 } 534 GETBITS(i,7) 535 lastlockl2[sv] = i; 536 if(handle->lastlockl2[sv] > i) 537 gnss->dataflags[num] |= GNSSDF_LOCKLOSSL2; 538 if(type == 1012) 539 { 498 540 GETBITS(i, 8) 499 541 if(i) … … 504 546 if(i > 9) i = 9; 505 547 else if(i < 1) i = 1; 506 gnss->snrL 1[num] = i;548 gnss->snrL2[num] = i; 507 549 } 508 550 } 509 gnss->measdata[num][le] /= GLO_WAVELENGTH_L1(freq-7); 510 if(type == 1011 || type == 1012) 511 { 512 /* L2 */ 513 GETBITS(code,2) 514 if(code) 515 { 516 c = GNSSDF_P2DATA; ce = GNSSENTRY_P2DATA; 517 l = GNSSDF_L2PDATA; le = GNSSENTRY_L2PDATA; 518 s = GNSSDF_S2PDATA; se = GNSSENTRY_S2PDATA; 519 } 520 else 521 { 522 c = GNSSDF_C2DATA; ce = GNSSENTRY_C2DATA; 523 l = GNSSDF_L2CDATA; le = GNSSENTRY_L2CDATA; 524 s = GNSSDF_S2CDATA; se = GNSSENTRY_S2CDATA; 525 } 526 GETBITSSIGN(i,14) 527 if(i != 0x2000) 528 { 529 gnss->dataflags[num] |= c; 530 gnss->measdata[num][ce] = l1range*0.02+i*0.02 531 +amb*599584.916; 532 } 533 GETBITSSIGN(i,20) 534 if(i != 0x80000) 535 { 536 gnss->dataflags[num] |= l; 537 gnss->measdata[num][le] = l1range*0.02+i*0.0005 538 +amb*599584.915; 539 } 540 GETBITS(i,7) 541 lastlockl2[sv] = i; 542 if(handle->lastlockl2[sv] > i) 543 gnss->dataflags[num] |= GNSSDF_LOCKLOSSL2; 544 if(type == 1012) 545 { 546 GETBITS(i, 8) 547 if(i) 548 { 549 gnss->dataflags[num] |= s; 550 gnss->measdata[num][se] = i*0.25; 551 i /= 4*4; 552 if(i > 9) i = 9; 553 else if(i < 1) i = 1; 554 gnss->snrL2[num] = i; 555 } 556 } 557 gnss->measdata[num][le] /= GLO_WAVELENGTH_L2(freq-7); 558 } 551 gnss->measdata[num][le] /= GLO_WAVELENGTH_L2(freq-7); 552 } 553 if(!sv || sv > 24) 554 { 555 --num; --gnss->numsats; 559 556 } 560 557 } … … 992 989 993 990 #ifndef NO_RTCM3_MAIN 994 static char datestr[] = "$Date: 2006/11/ 08 17:11:08$";991 static char datestr[] = "$Date: 2006/11/15 12:31:31 $"; 995 992 996 993 /* The string, which is send as agent in HTTP request */
Note:
See TracChangeset
for help on using the changeset viewer.