Changeset 6799 in ntrip
- Timestamp:
- Apr 28, 2015, 4:17:15 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/ephEncoder.cpp
r6635 r6799 45 45 int numbits = 0; 46 46 unsigned long long bitbuffer = 0; 47 if (eph._ura <= 2.40){ 48 eph._ura = 0; 49 } 50 else if (eph._ura <= 3.40){ 51 eph._ura = 1; 52 } 53 else if (eph._ura <= 6.85){ 54 eph._ura = 2; 55 } 56 else if (eph._ura <= 9.65){ 57 eph._ura = 3; 58 } 59 else if (eph._ura <= 13.65){ 60 eph._ura = 4; 61 } 62 else if (eph._ura <= 24.00){ 63 eph._ura = 5; 64 } 65 else if (eph._ura <= 48.00){ 66 eph._ura = 6; 67 } 68 else if (eph._ura <= 96.00){ 69 eph._ura = 7; 70 } 71 else if (eph._ura <= 192.00){ 72 eph._ura = 8; 73 } 74 else if (eph._ura <= 384.00){ 75 eph._ura = 9; 76 } 77 else if (eph._ura <= 768.00){ 78 eph._ura = 10; 79 } 80 else if (eph._ura <= 1536.00){ 81 eph._ura = 11; 82 } 83 else if (eph._ura <= 1536.00){ 84 eph._ura = 12; 85 } 86 else if (eph._ura <= 2072.00){ 87 eph._ura = 13; 88 } 89 else if (eph._ura <= 6144.00){ 90 eph._ura = 14; 91 } 92 else{ 93 eph._ura = 15; 94 } 95 47 eph._ura = indexFromAccuracy(eph._ura, eph.type()); 96 48 GPSADDBITS(12, 1019) 97 49 if (eph._prn.system() == 'J') { … … 256 208 buffer= buffer+3; 257 209 210 eph._SISA = indexFromAccuracy(eph._SISA, eph.type()); 211 258 212 bool inav = ( (eph._flags & GALEPHF_INAV) == GALEPHF_INAV ); 259 260 213 GALILEOADDBITS(12, inav ? 1046 : 1045) 261 214 GALILEOADDBITS(6, eph._prn.number()) … … 340 293 buffer= buffer+3; 341 294 295 eph._ura = indexFromAccuracy(eph._ura, eph.type()); 342 296 SBASADDBITS(12, 1043) 343 297 SBASADDBITS(6, eph._prn.number()-20) … … 388 342 buffer= buffer+3; 389 343 344 eph._URA = indexFromAccuracy(eph._URA, eph.type()); 390 345 BDSADDBITS(12, RTCM3ID_BDS) 391 346 BDSADDBITS(6, eph._prn.number()) 392 347 BDSADDBITS(13, eph._TOC_bdt.gpsw() - 1356.0) 393 BDSADDBITS(4, eph._URA I);348 BDSADDBITS(4, eph._URA); 394 349 BDSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13)) 395 350 BDSADDBITS(5, eph._AODE) -
trunk/BNC/src/RTCM3/ephEncoder.h
r6600 r6799 3 3 4 4 #include "ephemeris.h" 5 #include "bncutils.h" 5 6 6 7 class t_ephEncoder { -
trunk/BNC/src/bncutils.cpp
r6786 r6799 644 644 } 645 645 646 double accuracyFromIndex(int index, t_eph::e_type type) { 647 648 if (type == t_eph::GPS || type == t_eph::BDS || type == t_eph::SBAS 649 || type == t_eph::QZSS) { 650 651 if ((index >= 0) && (index <= 6)) { 652 if (index == 3) { 653 return ceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 654 } 655 else { 656 return floor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 657 } 658 } 659 else if ((index > 6) && (index <= 15)) { 660 return (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0; 661 } 662 else { 663 return 8192.0; 664 } 665 } 666 667 if (type == t_eph::Galileo) { 668 669 if ((index >= 0) && (index <= 49)) { 670 return (double(index) / 100.0); 671 } 672 else if ((index > 49) && (index <= 74)) { 673 return (50.0 + (double(index) - 50.0) * 2.0) / 100.0; 674 } 675 else if ((index > 74) && (index <= 99)) { 676 return 1.0 + (double(index) - 75.0) * 0.04; 677 } 678 else if ((index > 99) && (index <= 125)) { 679 return 2.0 + (double(index) - 100.0) * 0.16; 680 } 681 else { 682 return -1.0; 683 } 684 } 685 686 return double(index); 687 } 688 689 int indexFromAccuracy(double accuracy, t_eph::e_type type) { 690 691 if (type == t_eph::GPS || type == t_eph::BDS || type == t_eph::SBAS 692 || type == t_eph::QZSS) { 693 694 if (accuracy <= 2.40) { 695 return 0; 696 } 697 else if (accuracy <= 3.40) { 698 return 1; 699 } 700 else if (accuracy <= 4.85) { 701 return 2; 702 } 703 else if (accuracy <= 6.85) { 704 return 3; 705 } 706 else if (accuracy <= 9.65) { 707 return 4; 708 } 709 else if (accuracy <= 13.65) { 710 return 5; 711 } 712 else if (accuracy <= 24.00) { 713 return 6; 714 } 715 else if (accuracy <= 48.00) { 716 return 7; 717 } 718 else if (accuracy <= 96.00) { 719 return 8; 720 } 721 else if (accuracy <= 192.00) { 722 return 9; 723 } 724 else if (accuracy <= 384.00) { 725 return 10; 726 } 727 else if (accuracy <= 768.00) { 728 return 11; 729 } 730 else if (accuracy <= 1536.00) { 731 return 12; 732 } 733 else if (accuracy <= 3072.00) { 734 return 13; 735 } 736 else if (accuracy <= 6144.00) { 737 return 14; 738 } 739 else { 740 return 15; 741 } 742 } 743 744 if (type == t_eph::Galileo) { 745 //TODO: implement conversion 746 } 747 748 return (type == t_eph::Galileo) ? 255 : 15; 749 } -
trunk/BNC/src/bncutils.h
r6786 r6799 33 33 #include <newmat.h> 34 34 #include <bncconst.h> 35 #include <ephemeris.h> 35 36 36 37 void expandEnvVar(QString& str); … … 109 110 void stripWhiteSpace(std::string& str); 110 111 112 double accuracyFromIndex(int index, t_eph::e_type type); 113 114 int indexFromAccuracy(double accuracy, t_eph::e_type type); 115 111 116 #endif -
trunk/BNC/src/ephemeris.cpp
r6798 r6799 135 135 _L2PFlag = 0.0; 136 136 137 if (ee->URAindex <= 6) { 138 _ura = ceil(10.0*pow(2.0, 1.0+((double)ee->URAindex)/2.0))/10.0; 139 } 140 else { 141 _ura = ceil(10.0*pow(2.0, ((double)ee->URAindex)/2.0))/10.0; 142 } 137 _ura = accuracyFromIndex(ee->URAindex, type()); 138 143 139 _health = ee->SVhealth; 144 140 _TGD = ee->TGD; … … 461 457 _TOEweek = ee->Week; 462 458 463 if ((ee->SISA >= 0) && (ee->SISA <= 49)) { 464 _SISA = ee->SISA / 100.0; 465 } 466 else if((ee->SISA >= 50) && (ee->SISA <= 74)) { 467 _SISA = (50 + (ee->SISA - 50.0) * 2.0) / 100.0; 468 } 469 else if((ee->SISA >= 75) && (ee->SISA <= 99)) { 470 _SISA = 1.0 + (ee->SISA - 75.0) * 0.04; 471 } 472 else if((ee->SISA >= 100) && (ee->SISA <= 125)) { 473 _SISA = 2.0 + (ee->SISA - 100.0) * 0.16; 474 } 475 else if (ee->SISA >= 126 ) { 476 _SISA = -1.0; 477 } 459 _SISA = accuracyFromIndex(ee->SISA, type()); 478 460 _E5aHS = ee->E5aHS; 479 461 _E5bHS = ee->E5bHS; … … 1352 1334 _z_acceleration = ee->z_acceleration; 1353 1335 1354 _ura = ee->URA;1336 _ura = accuracyFromIndex(ee->URA, type()); 1355 1337 1356 1338 _health = 0; … … 1608 1590 _omega = ee->omega; 1609 1591 _OMEGADOT = ee->OMEGADOT; 1592 1610 1593 _IDOT = ee->IDOT; 1611 1594 1595 _URA = accuracyFromIndex(ee->URAI, type()); 1596 _SatH1 = (ee->flags & BDSEPHF_SATH1) ? 1: 0; 1612 1597 _TGD1 = ee->TGD_B1_B3; 1613 1598 _TGD2 = ee->TGD_B2_B3; 1614 1599 1615 if ((ee->URAI < 6) && (ee->URAI >= 0)) {1616 _URA = ceil(10.0 * pow(2.0, ((double)ee->URAI/2.0) + 1.0)) / 10.0;1617 }1618 if ((ee->URAI >= 6) && (ee->URAI < 15)) {1619 _URA = ceil(10.0 * pow(2.0, ((double)ee->URAI/2.0) )) / 10.0;1620 }1621 _SatH1 = (ee->flags & BDSEPHF_SATH1) ? 1: 0;1622 1600 1623 1601 }
Note:
See TracChangeset
for help on using the changeset viewer.