Changeset 8805 in ntrip for branches/BNC_2.12/src/bncutils.cpp
- Timestamp:
- Sep 20, 2019, 2:51:58 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/bncutils.cpp
r8691 r8805 173 173 } 174 174 } 175 176 175 } 177 176 … … 463 462 // 464 463 //////////////////////////////////////////////////////////////////////////// 465 intfactorial(int n) {464 double factorial(int n) { 466 465 if (n == 0) { 467 466 return 1; … … 809 808 810 809 double accuracyFromIndex(int index, t_eph::e_type type) { 811 812 if (type == t_eph::GPS || type == t_eph::BDS || type == t_eph::SBAS 813 || type == t_eph::QZSS) { 814 810 double accuracy = -1.0; 811 812 if (type == t_eph::GPS || 813 type == t_eph::BDS || 814 type == t_eph::SBAS|| 815 type == t_eph::QZSS) { 815 816 if ((index >= 0) && (index <= 6)) { 816 817 if (index == 3) { 817 returnceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;818 accuracy = ceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 818 819 } 819 820 else { 820 returnfloor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;821 accuracy = floor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0; 821 822 } 822 823 } 823 824 else if ((index > 6) && (index <= 15)) { 824 return(10.0 * pow(2.0, (double(index) - 2.0))) / 10.0;825 accuracy = (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0; 825 826 } 826 827 else { 827 return 8192.0; 828 } 829 } 830 831 if (type == t_eph::Galileo) { 832 828 accuracy = 8192.0; 829 } 830 } 831 else if (type == t_eph::Galileo) { 833 832 if ((index >= 0) && (index <= 49)) { 834 return(double(index) / 100.0);833 accuracy = (double(index) / 100.0); 835 834 } 836 835 else if ((index > 49) && (index <= 74)) { 837 return(50.0 + (double(index) - 50.0) * 2.0) / 100.0;836 accuracy = (50.0 + (double(index) - 50.0) * 2.0) / 100.0; 838 837 } 839 838 else if ((index > 74) && (index <= 99)) { 840 return1.0 + (double(index) - 75.0) * 0.04;839 accuracy = 1.0 + (double(index) - 75.0) * 0.04; 841 840 } 842 841 else if ((index > 99) && (index <= 125)) { 843 return2.0 + (double(index) - 100.0) * 0.16;842 accuracy = 2.0 + (double(index) - 100.0) * 0.16; 844 843 } 845 844 else { 846 return -1.0; 847 } 848 } 849 850 return double(index); 851 } 845 accuracy = -1.0; 846 } 847 } 848 else if (type == t_eph::IRNSS) { 849 if ((index >= 0) && (index <= 6)) { 850 if (index == 1) { 851 accuracy = 2.8; 852 } 853 else if (index == 3) { 854 accuracy = 5.7; 855 } 856 else if (index == 5) { 857 accuracy = 11.3; 858 } 859 else { 860 accuracy = pow(2, 1 + index / 2); 861 } 862 } 863 else if ((index > 6) && (index <= 15)) { 864 accuracy = pow(2, index - 2); 865 } 866 } 867 return accuracy; 868 } 869 852 870 853 871 int indexFromAccuracy(double accuracy, t_eph::e_type type) {
Note:
See TracChangeset
for help on using the changeset viewer.