Changeset 8801 in ntrip for trunk/BNC/src
- Timestamp:
- Sep 20, 2019, 2:46:25 PM (5 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r8783 r8801 243 243 {GPS_WAVELENGTH_L1, "1P"}, 244 244 {GPS_WAVELENGTH_L1, "1W"}, 245 {0.0, 0} /*{GPS_WAVELENGTH_L1,"1Y"}*/,245 {0.0, 0}, 246 246 {0.0, 0}, 247 247 {0.0, 0}, … … 249 249 {GPS_WAVELENGTH_L2, "2P"}, 250 250 {GPS_WAVELENGTH_L2, "2W"}, 251 {0.0, 0} /*{GPS_WAVELENGTH_L2,"2Y"}*/,251 {0.0, 0}, 252 252 {0.0, 0}, 253 253 {0.0, 0}, … … 288 288 {1.0, "2C"}, 289 289 {1.0, "2P"}, 290 { 0.0, 0},291 { 0.0, 0},292 { 0.0, 0},293 { 0.0, 0},294 { 0.0, 0},295 { 0.0, 0},296 { 0.0, 0},297 { 0.0, 0},298 { 0.0, 0},290 {GLO_WAVELENGTH_L1a, "4A"}, 291 {GLO_WAVELENGTH_L1a, "4B"}, 292 {GLO_WAVELENGTH_L1a, "4X"}, 293 {GLO_WAVELENGTH_L2a, "6A"}, 294 {GLO_WAVELENGTH_L2a, "6B"}, 295 {GLO_WAVELENGTH_L2a, "6X"}, 296 {GLO_WAVELENGTH_L3, "3I"}, 297 {GLO_WAVELENGTH_L3, "3Q"}, 298 {GLO_WAVELENGTH_L3, "3X"}, 299 299 {0.0, 0}, 300 300 {0.0, 0}, … … 316 316 static struct CodeData gal[RTCM3_MSM_NUMSIG] = { 317 317 {0.0, 0}, 318 {GAL_WAVELENGTH_E1, "1C"},319 {GAL_WAVELENGTH_E1, "1A"},320 {GAL_WAVELENGTH_E1, "1B"},321 {GAL_WAVELENGTH_E1, "1X"},322 {GAL_WAVELENGTH_E1, "1Z"},323 {0.0, 0}, 324 {GAL_WAVELENGTH_E6, "6C"},325 {GAL_WAVELENGTH_E6, "6A"},326 {GAL_WAVELENGTH_E6, "6B"},327 {GAL_WAVELENGTH_E6, "6X"},328 {GAL_WAVELENGTH_E6, "6Z"},318 {GAL_WAVELENGTH_E1, "1C"}, 319 {GAL_WAVELENGTH_E1, "1A"}, 320 {GAL_WAVELENGTH_E1, "1B"}, 321 {GAL_WAVELENGTH_E1, "1X"}, 322 {GAL_WAVELENGTH_E1, "1Z"}, 323 {0.0, 0}, 324 {GAL_WAVELENGTH_E6, "6C"}, 325 {GAL_WAVELENGTH_E6, "6A"}, 326 {GAL_WAVELENGTH_E6, "6B"}, 327 {GAL_WAVELENGTH_E6, "6X"}, 328 {GAL_WAVELENGTH_E6, "6Z"}, 329 329 {0.0, 0}, 330 330 {GAL_WAVELENGTH_E5B, "7I"}, … … 332 332 {GAL_WAVELENGTH_E5B, "7X"}, 333 333 {0.0, 0}, 334 {GAL_WAVELENGTH_E5AB, 335 {GAL_WAVELENGTH_E5AB, 336 {GAL_WAVELENGTH_E5AB, 334 {GAL_WAVELENGTH_E5AB,"8I"}, 335 {GAL_WAVELENGTH_E5AB,"8Q"}, 336 {GAL_WAVELENGTH_E5AB,"8X"}, 337 337 {0.0, 0}, 338 338 {GAL_WAVELENGTH_E5A, "5I"}, … … 346 346 {0.0, 0}, 347 347 {0.0, 0}, 348 {0.0, 0} ,348 {0.0, 0} 349 349 }; 350 350 … … 406 406 {0.0, 0}, 407 407 {0.0, 0}, 408 { 0.0, 0},409 { 0.0, 0},410 { 0.0, 0},411 {0.0, 0}, 412 {0.0, 0}, 413 {0.0, 0}, 414 { 0.0, 0},415 { 0.0, 0},416 { 0.0, 0},408 {BDS_WAVELENGTH_B1C, "1D"}, 409 {BDS_WAVELENGTH_B1C, "1P"}, 410 {BDS_WAVELENGTH_B1C, "1X"}, 411 {0.0, 0}, 412 {0.0, 0}, 413 {0.0, 0}, 414 {BDS_WAVELENGTH_B2a, "5D"}, 415 {BDS_WAVELENGTH_B2a, "5P"}, 416 {BDS_WAVELENGTH_B2a, "5X"}, 417 417 {0.0, 0}, 418 418 {0.0, 0}, … … 465 465 // 466 466 //////////////////////////////////////////////////////////////////////////// 467 bool RTCM3Decoder::DecodeRTCM3MSM(unsigned char* data, int size) 468 { 467 bool RTCM3Decoder::DecodeRTCM3MSM(unsigned char* data, int size) { 469 468 bool decoded = false; 470 469 int type, syncf, i; … … 525 524 int sigmask, numsat = 0, numsig = 0; 526 525 uint64_t satmask, cellmask, ui; 527 double rrmod[RTCM3_MSM_NUMSAT]; 528 int rrint[RTCM3_MSM_NUMSAT], rdop[RTCM3_MSM_NUMSAT], 529 extsat[RTCM3_MSM_NUMSAT]; 530 int ll[RTCM3_MSM_NUMCELLS]/*, hc[RTCM3_MSM_NUMCELLS]*/; 531 double cnr[RTCM3_MSM_NUMCELLS]; 532 double cp[RTCM3_MSM_NUMCELLS], psr[RTCM3_MSM_NUMCELLS], 533 dop[RTCM3_MSM_NUMCELLS]; 526 // satellite data 527 double rrmod[RTCM3_MSM_NUMSAT]; // GNSS sat rough ranges modulo 1 millisecond 528 int rrint[RTCM3_MSM_NUMSAT]; // number of integer msecs in GNSS sat rough ranges 529 int rdop[RTCM3_MSM_NUMSAT]; // GNSS sat rough phase range rates 530 int extsat[RTCM3_MSM_NUMSAT];// extended sat info 531 // signal data 532 int ll[RTCM3_MSM_NUMCELLS]; // lock time indicator 533 /*int hc[RTCM3_MSM_NUMCELLS];*/ // half cycle ambiguity indicator 534 double cnr[RTCM3_MSM_NUMCELLS]; // signal cnr 535 double cp[RTCM3_MSM_NUMCELLS]; // fine phase range data 536 double psr[RTCM3_MSM_NUMCELLS]; // fine psr 537 double dop[RTCM3_MSM_NUMCELLS]; // fine phase range rates 534 538 535 539 SKIPBITS(3 + 7 + 2 + 2 + 1 + 3) … … 547 551 i = numsat * numsig; 548 552 GETBITS64(cellmask, (unsigned )i) 549 553 // satellite data 550 554 switch (type % 10) { 551 555 case 1: … … 575 579 break; 576 580 } 577 581 // signal data 578 582 int numcells = numsat * numsig; 579 583 /** Drop anything which exceeds our cell limit. Increase limit definition … … 726 730 { 727 731 int k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1]; 728 if (extsat[numsat] < 14) { 729 k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1] = 100 + extsat[numsat] 730 - 7; 732 if (extsat[numsat] < 14) { // channel number is available as extended info for MSM5/7 733 k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1] = 100 + extsat[numsat] - 7; 731 734 } 732 if (k) 733 cd.wl = ( 734 cd.wl == 0.0 ? 735 GLO_WAVELENGTH_L1(k - 100) : 736 GLO_WAVELENGTH_L2(k - 100)); 737 else 735 if (k) { 736 if (cd.wl == 0.0) { 737 cd.wl = GLO_WAVELENGTH_L1(k - 100); 738 } 739 else if (cd.wl == 1.0) { 740 cd.wl = GLO_WAVELENGTH_L2(k - 100); 741 } 742 } 743 else if (!k && cd.wl <= 1) { 738 744 cd.code = 0; 745 } 739 746 } 740 747 break; … … 754 761 if (psr[count] > -1.0 / (1 << 10)) { 755 762 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 756 + (rrmod[numsat]) * LIGHTSPEED / 1000.0;763 + (rrmod[numsat]) * LIGHTSPEED / 1000.0; 757 764 frqObs->_codeValid = true; 758 765 } … … 761 768 if (cp[count] > -1.0 / (1 << 8)) { 762 769 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 763 + (rrmod[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;770 + (rrmod[numsat]) * LIGHTSPEED / 1000.0 / cd.wl; 764 771 frqObs->_phaseValid = true; 765 772 frqObs->_lockTime = lti2sec(type,ll[count]); … … 771 778 if (psr[count] > -1.0 / (1 << 10)) { 772 779 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 773 + (rrmod[numsat]) * LIGHTSPEED / 1000.0;780 + (rrmod[numsat]) * LIGHTSPEED / 1000.0; 774 781 frqObs->_codeValid = true; 775 782 } 776 777 783 if (cp[count] > -1.0 / (1 << 8)) { 778 784 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 779 + rrmod[numsat] * LIGHTSPEED / 1000.0 / cd.wl;785 + rrmod[numsat] * LIGHTSPEED / 1000.0 / cd.wl; 780 786 frqObs->_phaseValid = true; 781 787 frqObs->_lockTime = lti2sec(type,ll[count]); … … 787 793 if (psr[count] > -1.0 / (1 << 10)) { 788 794 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 789 + (rrmod[numsat] +rrint[numsat]) * LIGHTSPEED / 1000.0;795 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0; 790 796 frqObs->_codeValid = true; 791 797 } 792 793 798 if (cp[count] > -1.0 / (1 << 8)) { 794 799 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 795 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 796 / cd.wl; 800 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl; 797 801 frqObs->_phaseValid = true; 798 802 frqObs->_lockTime = lti2sec(type,ll[count]); … … 800 804 frqObs->_slipCounter = ll[count]; 801 805 } 802 803 806 frqObs->_snr = cnr[count]; 804 807 frqObs->_snrValid = true; … … 807 810 if (psr[count] > -1.0 / (1 << 10)) { 808 811 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 809 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;812 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0; 810 813 frqObs->_codeValid = true; 811 814 } 812 813 815 if (cp[count] > -1.0 / (1 << 8)) { 814 816 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 815 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 816 / cd.wl; 817 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl; 817 818 frqObs->_phaseValid = true; 818 819 frqObs->_lockTime = lti2sec(type,ll[count]); … … 820 821 frqObs->_slipCounter = ll[count]; 821 822 } 822 823 823 frqObs->_snr = cnr[count]; 824 824 frqObs->_snrValid = true; 825 826 825 if (dop[count] > -1.6384) { 827 826 frqObs->_doppler = -(dop[count] + rdop[numsat]) / cd.wl; … … 832 831 if (psr[count] > -1.0 / (1 << 10)) { 833 832 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 834 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;833 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0; 835 834 frqObs->_codeValid = true; 836 835 } 837 838 836 if (cp[count] > -1.0 / (1 << 8)) { 839 837 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 840 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 841 / cd.wl; 838 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl; 842 839 frqObs->_phaseValid = true; 843 840 frqObs->_lockTime = lti2sec(type,ll[count]); … … 852 849 if (psr[count] > -1.0 / (1 << 10)) { 853 850 frqObs->_code = psr[count] * LIGHTSPEED / 1000.0 854 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;851 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0; 855 852 frqObs->_codeValid = true; 856 853 } 857 858 854 if (cp[count] > -1.0 / (1 << 8)) { 859 855 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl 860 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 861 / cd.wl; 856 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl; 862 857 frqObs->_phaseValid = true; 863 858 frqObs->_lockTime = lti2sec(type,ll[count]); … … 879 874 } 880 875 } 881 if (CurrentObs._obs.size() > 0) 876 if (CurrentObs._obs.size() > 0) { 882 877 _CurrentObsList.push_back(CurrentObs); 878 } 883 879 } 884 880 } … … 1118 1114 GETBITS(i, 1) 1119 1115 tk += i * 30; 1120 eph._tki = tk < 3 * 60 * 60 ? tk - 3 * 60 * 60 + 86400 : tk - 3 * 60 * 60; 1116 eph._tki = tk - 3*60*60; 1117 if(eph._tki < 0.0) { 1118 eph._tki += 86400.0; 1119 } 1121 1120 GETBITS(eph._health, 1) /* MSB of Bn*/ 1122 1121 GETBITS(eph._P2, 1) /* P2 */ -
trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h
r8760 r8801 108 108 CLOCKORBIT_NUMQZSS=10, 109 109 CLOCKORBIT_NUMSBAS=38, 110 CLOCKORBIT_NUMBDS= 37,110 CLOCKORBIT_NUMBDS=63, 111 111 CLOCKORBIT_NUMBIAS=100, 112 112 CLOCKORBIT_NUMIONOLAYERS=4, … … 236 236 CODETYPE_BDS_B2a_D = 12, 237 237 CODETYPE_BDS_B2a_P = 13, 238 CODETYPE_BDS_B2a_DP = 14 238 CODETYPE_BDS_B2a_DP = 14, 239 240 CODETYPE_IRNSS_S_SPS = 8, 241 CODETYPE_IRNSS_L5_SPS = 22 239 242 }; 240 243 … … 372 375 373 376 /* return size of resulting data or 0 in case of an error */ 374 size_t MakeClockOrbit( conststruct ClockOrbit *co, enum ClockOrbitType type,377 size_t MakeClockOrbit(/*const*/ struct ClockOrbit *co, enum ClockOrbitType type, 375 378 int moremessagesfollow, char *buffer, size_t size); 376 379 size_t MakeCodeBias(const struct CodeBias *b, enum CodeBiasType type, -
trunk/BNC/src/RTCM3/gnss.h
r8783 r8801 26 26 #define GNSS_H 27 27 28 #define LIGHTSPEED 2.99792458e8 /* m/sec */29 #define GPS_FREQU_L1 1575420000.0 /* Hz */30 #define GPS_FREQU_L2 1227600000.0 /* Hz */31 #define GPS_FREQU_L5 1176450000.0 /* Hz */32 #define GPS_WAVELENGTH_L1 (LIGHTSPEED / GPS_FREQU_L1) /* m */33 #define GPS_WAVELENGTH_L2 (LIGHTSPEED / GPS_FREQU_L2) /* m */34 #define GPS_WAVELENGTH_L5 (LIGHTSPEED / GPS_FREQU_L5) /* m */28 #define LIGHTSPEED 2.99792458e8 /* m/sec */ 29 #define GPS_FREQU_L1 1575420000.0 /* Hz */ 30 #define GPS_FREQU_L2 1227600000.0 /* Hz */ 31 #define GPS_FREQU_L5 1176450000.0 /* Hz */ 32 #define GPS_WAVELENGTH_L1 (LIGHTSPEED / GPS_FREQU_L1) /* m */ 33 #define GPS_WAVELENGTH_L2 (LIGHTSPEED / GPS_FREQU_L2) /* m */ 34 #define GPS_WAVELENGTH_L5 (LIGHTSPEED / GPS_FREQU_L5) /* m */ 35 35 36 #define GLO_FREQU_L1_BASE 1602000000.0 /* Hz */ 37 #define GLO_FREQU_L2_BASE 1246000000.0 /* Hz */ 38 #define GLO_FREQU_L1_STEP 562500.0 /* Hz */ 39 #define GLO_FREQU_L2_STEP 437500.0 /* Hz */ 40 #define GLO_FREQU_L1(a) (GLO_FREQU_L1_BASE+(a)*GLO_FREQU_L1_STEP) 41 #define GLO_FREQU_L2(a) (GLO_FREQU_L2_BASE+(a)*GLO_FREQU_L2_STEP) 36 #define GLO_FREQU_L1_BASE 1602000000.0 /* Hz */ 37 #define GLO_FREQU_L2_BASE 1246000000.0 /* Hz */ 38 #define GLO_FREQU_L1_STEP 562500.0 /* Hz */ 39 #define GLO_FREQU_L2_STEP 437500.0 /* Hz */ 40 #define GLO_FREQU_L1(a) (GLO_FREQU_L1_BASE+(a)*GLO_FREQU_L1_STEP) 41 #define GLO_FREQU_L2(a) (GLO_FREQU_L2_BASE+(a)*GLO_FREQU_L2_STEP) 42 #define GLO_FREQU_L1a 1600995000.0 /* Hz */ 43 #define GLO_FREQU_L2a 1248060000.0 /* Hz */ 44 #define GLO_FREQU_L3 1202025000.0 /* Hz */ 42 45 #define GLO_WAVELENGTH_L1(a) (LIGHTSPEED / GLO_FREQU_L1(a)) /* m */ 43 46 #define GLO_WAVELENGTH_L2(a) (LIGHTSPEED / GLO_FREQU_L2(a)) /* m */ 47 #define GLO_WAVELENGTH_L1a (LIGHTSPEED / GLO_FREQU_L1a) /* m */ 48 #define GLO_WAVELENGTH_L2a (LIGHTSPEED / GLO_FREQU_L2a) /* m */ 49 #define GLO_WAVELENGTH_L3 (LIGHTSPEED / GLO_FREQU_L3) /* m */ 44 50 45 #define GAL_FREQU_E1 1575420000.0 /* Hz */46 #define GAL_FREQU_E5A 1176450000.0 /* Hz */47 #define GAL_FREQU_E5AB 1191795000.0 /* Hz */48 #define GAL_FREQU_E5B 1207140000.0 /* Hz */49 #define GAL_FREQU_E6 1278750000.0 /* Hz */50 #define GAL_WAVELENGTH_E1 (LIGHTSPEED / GAL_FREQU_E1)/* m */51 #define GAL_WAVELENGTH_E5A 52 #define GAL_WAVELENGTH_E5AB (LIGHTSPEED / GAL_FREQU_E5AB)/* m */53 #define GAL_WAVELENGTH_E5B 54 #define GAL_WAVELENGTH_E6 (LIGHTSPEED / GAL_FREQU_E6)/* m */51 #define GAL_FREQU_E1 1575420000.0 /* Hz */ 52 #define GAL_FREQU_E5A 1176450000.0 /* Hz */ 53 #define GAL_FREQU_E5AB 1191795000.0 /* Hz */ 54 #define GAL_FREQU_E5B 1207140000.0 /* Hz */ 55 #define GAL_FREQU_E6 1278750000.0 /* Hz */ 56 #define GAL_WAVELENGTH_E1 (LIGHTSPEED / GAL_FREQU_E1) /* m */ 57 #define GAL_WAVELENGTH_E5A (LIGHTSPEED / GAL_FREQU_E5A) /* m */ 58 #define GAL_WAVELENGTH_E5AB (LIGHTSPEED / GAL_FREQU_E5AB)/* m */ 59 #define GAL_WAVELENGTH_E5B (LIGHTSPEED / GAL_FREQU_E5B) /* m */ 60 #define GAL_WAVELENGTH_E6 (LIGHTSPEED / GAL_FREQU_E6) /* m */ 55 61 56 #define QZSS_FREQU_L1 1575420000.0 57 #define QZSS_FREQU_L2 1227600000.0 58 #define QZSS_FREQU_L5 1176450000.0 59 #define QZSS_FREQU_L6 1278750000.0 /* Hz */62 #define QZSS_FREQU_L1 1575420000.0 /* Hz */ 63 #define QZSS_FREQU_L2 1227600000.0 /* Hz */ 64 #define QZSS_FREQU_L5 1176450000.0 /* Hz */ 65 #define QZSS_FREQU_L6 1278750000.0 /* Hz */ 60 66 #define QZSS_WAVELENGTH_L1 (LIGHTSPEED / QZSS_FREQU_L1) /* m */ 61 67 #define QZSS_WAVELENGTH_L2 (LIGHTSPEED / QZSS_FREQU_L2) /* m */ … … 63 69 #define QZSS_WAVELENGTH_L6 (LIGHTSPEED / QZSS_FREQU_L6) /* m */ 64 70 65 #define BDS_FREQU_B1 1561098000.0 /* Hz */ 66 #define BDS_FREQU_B2 1207140000.0 /* Hz */ 67 #define BDS_FREQU_B3 1268520000.0 /* Hz */ 68 #define BDS_WAVELENGTH_B1 (LIGHTSPEED / BDS_FREQU_B1) /* m */ 69 #define BDS_WAVELENGTH_B2 (LIGHTSPEED / BDS_FREQU_B2) /* m */ 70 #define BDS_WAVELENGTH_B3 (LIGHTSPEED / BDS_FREQU_B3) /* m */ 71 #define BDS_FREQU_B1 1561098000.0 /* Hz */ 72 #define BDS_FREQU_B2 1207140000.0 /* Hz */ 73 #define BDS_FREQU_B3 1268520000.0 /* Hz */ 74 #define BDS_FREQU_B1C 1575420000.0 /* Hz */ 75 #define BDS_FREQU_B2a 1176450000.0 /* Hz */ 76 #define BDS_WAVELENGTH_B1 (LIGHTSPEED / BDS_FREQU_B1) /* m */ 77 #define BDS_WAVELENGTH_B2 (LIGHTSPEED / BDS_FREQU_B2) /* m */ 78 #define BDS_WAVELENGTH_B3 (LIGHTSPEED / BDS_FREQU_B3) /* m */ 79 #define BDS_WAVELENGTH_B1C (LIGHTSPEED / BDS_FREQU_B1C) /* m */ 80 #define BDS_WAVELENGTH_B2a (LIGHTSPEED / BDS_FREQU_B2a) /* m */ 71 81 72 #define IRNSS_FREQU_L5 1176450000.0 /* Hz */73 #define IRNSS_FREQU_S 2492028000.0 /* Hz */82 #define IRNSS_FREQU_L5 1176450000.0 /* Hz */ 83 #define IRNSS_FREQU_S 2492028000.0 /* Hz */ 74 84 #define IRNSS_WAVELENGTH_L5 (LIGHTSPEED / IRNSS_FREQU_L5) /* m */ 75 85 #define IRNSS_WAVELENGTH_S (LIGHTSPEED / IRNSS_FREQU_S) /* m */ -
trunk/BNC/src/bncutils.cpp
r8790 r8801 173 173 } 174 174 } 175 176 175 } 177 176 … … 810 809 811 810 double accuracyFromIndex(int index, t_eph::e_type type) { 811 double accuracy = -1.0; 812 812 813 813 if (type == t_eph::GPS || … … 817 817 if ((index >= 0) && (index <= 6)) { 818 818 if (index == 3) { 819 returnceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;819 accuracy = ceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 820 820 } 821 821 else { 822 returnfloor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;822 accuracy = floor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 823 823 } 824 824 } 825 825 else if ((index > 6) && (index <= 15)) { 826 return(10.0 * pow(2.0, (double(index) - 2.0))) / 10.0;826 accuracy = (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0; 827 827 } 828 828 else { 829 return8192.0;829 accuracy = 8192.0; 830 830 } 831 831 } 832 832 else if (type == t_eph::Galileo) { 833 834 833 if ((index >= 0) && (index <= 49)) { 835 return(double(index) / 100.0);834 accuracy = (double(index) / 100.0); 836 835 } 837 836 else if ((index > 49) && (index <= 74)) { 838 return(50.0 + (double(index) - 50.0) * 2.0) / 100.0;837 accuracy = (50.0 + (double(index) - 50.0) * 2.0) / 100.0; 839 838 } 840 839 else if ((index > 74) && (index <= 99)) { 841 return1.0 + (double(index) - 75.0) * 0.04;840 accuracy = 1.0 + (double(index) - 75.0) * 0.04; 842 841 } 843 842 else if ((index > 99) && (index <= 125)) { 844 return2.0 + (double(index) - 100.0) * 0.16;843 accuracy = 2.0 + (double(index) - 100.0) * 0.16; 845 844 } 846 845 else { 847 return-1.0;846 accuracy = -1.0; 848 847 } 849 848 } … … 851 850 if ((index >= 0) && (index <= 6)) { 852 851 if (index == 1) { 853 return2.8;852 accuracy = 2.8; 854 853 } 855 854 else if (index == 3) { 856 return5.7;855 accuracy = 5.7; 857 856 } 858 857 else if (index == 5) { 859 return11.3;858 accuracy = 11.3; 860 859 } 861 860 else { 862 returnpow(2, 1 + index / 2);861 accuracy = pow(2, 1 + index / 2); 863 862 } 864 863 } 865 864 else if ((index > 6) && (index <= 15)) { 866 return pow(2, index - 1); 867 } 868 } 869 870 return double(index); 865 accuracy = pow(2, index - 2); 866 } 867 } 868 return accuracy; 871 869 } 872 870
Note:
See TracChangeset
for help on using the changeset viewer.