- Timestamp:
- Jul 20, 2020, 3:54:44 PM (4 years ago)
- Location:
- branches/BNC_2.12/src
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp
r8938 r8987 1429 1429 GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1)) 1430 1430 GETFLOATSIGN(eph._OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13)) 1431 GETFLOATSIGN(eph._BGD_1_5A, 10, 1432 1.0 / (double )(1 << 30) / (double )(1 << 2)) 1431 GETFLOATSIGN(eph._BGD_1_5A, 10, 1.0 / (double )(1 << 30) / (double )(1 << 2)) 1433 1432 if (eph._inav) { 1434 1433 /* set unused F/NAV values */ … … 1624 1623 * extracted data block. That does no harm, as it anyway skip everything 1625 1624 * else. */ 1626 if ((id >= 1057 && id <= 1068) || (id >= 1240 && id <= 1270)) { 1625 if ((id >= 1057 && id <= 1068) || 1626 (id >= 1240 && id <= 1270) || 1627 (id == 4076)) { 1627 1628 if (!_coDecoders.contains(_staID.toAscii())) 1628 1629 _coDecoders[_staID.toAscii()] = new RTCM3coDecoder(_staID); -
branches/BNC_2.12/src/RTCM3/RTCM3coDecoder.cpp
r8943 r8987 647 647 } 648 648 else if (epoSecGlo != -1) { 649 #ifdef USE_SSR_RTCM 649 650 QDate date = dateAndTimeFromGPSweek(currentTime.gpsw(), currentTime.gpssec()).date(); 650 651 epoSecGlo = epoSecGlo - 3 * 3600 + gnumleap(date.year(), date.month(), date.day()); 652 #endif 651 653 _lastTime.set(currentWeek, epoSecGlo); 652 654 } … … 661 663 } 662 664 else if (epoSecBds != -1) { 665 #ifdef USE_SSR_RTCM 663 666 epoSecBds += 14.0; 664 667 if (epoSecBds > 604800.0) { 665 668 epoSecBds -= 7.0*24.0*60.0*60.0; 666 669 } 670 #endif 667 671 _lastTime.set(currentWeek, epoSecBds); 668 672 } … … 687 691 case CODETYPEGPS_L1_P: return "1P"; 688 692 case CODETYPEGPS_L1_Z: return "1W"; 689 //case CODETYPEGPS_L1_Y: return "1Y"; 690 //case CODETYPEGPS_L1_M: return "1M"; 693 691 694 case CODETYPEGPS_SEMI_CODELESS: return "2D"; 692 695 case CODETYPEGPS_L2_CA: return "2C"; … … 696 699 case CODETYPEGPS_L2C_M: return "2S"; 697 700 case CODETYPEGPS_L2C_L: return "2L"; 701 #ifdef USE_SSR_RTCM 698 702 case CODETYPEGPS_L2C_ML: return "2X"; 699 700 //case CODETYPEGPS_L2_Y: return "2Y"; 701 //case CODETYPEGPS_L2_M: return "2M"; 703 #endif 702 704 703 705 case CODETYPEGPS_L5_I: return "5I"; 704 706 case CODETYPEGPS_L5_Q: return "5Q"; 707 #ifdef USE_SSR_RTCM 705 708 case CODETYPEGPS_L5_IQ: return "5X"; 706 709 #endif 707 710 case CODETYPEGPS_L1C_D: return "1S"; 708 711 case CODETYPEGPS_L1C_P: return "1L"; 712 #ifdef USE_SSR_RTCM 709 713 case CODETYPEGPS_L1C_DP: return "1X"; 714 #endif 710 715 default: return ""; 711 716 } … … 715 720 case CODETYPEGLONASS_L1_CA: return "1C"; 716 721 case CODETYPEGLONASS_L1_P: return "1P"; 717 718 722 case CODETYPEGLONASS_L2_CA: return "2C"; 719 723 case CODETYPEGLONASS_L2_P: return "2P"; 720 721 724 case CODETYPEGLONASS_L1a_OCd: return "4A"; 722 725 case CODETYPEGLONASS_L1a_OCp: return "4B"; 726 #ifdef USE_SSR_RTCM 723 727 case CODETYPEGLONASS_L1a_OCdp: return "4X"; 724 728 #endif 725 729 case CODETYPEGLONASS_L2a_CSI: return "6A"; 726 730 case CODETYPEGLONASS_L2a_OCp: return "6B"; 731 #ifdef USE_SSR_RTCM 727 732 case CODETYPEGLONASS_L2a_CSIOCp:return "6X"; 728 733 #endif 729 734 case CODETYPEGLONASS_L3_I: return "3I"; 730 735 case CODETYPEGLONASS_L3_Q: return "3Q"; 736 #ifdef USE_SSR_RTCM 731 737 case CODETYPEGLONASS_L3_IQ: return "3X"; 738 #endif 732 739 default: return ""; 733 740 } … … 735 742 else if (system == 'E') { 736 743 switch (type) { 737 case CODETYPEGALILEO_E1_A: return "1A"; 738 case CODETYPEGALILEO_E1_B: return "1B"; 739 case CODETYPEGALILEO_E1_C: return "1C"; 740 case CODETYPEGALILEO_E1_BC: return "1X"; 741 case CODETYPEGALILEO_E1_ABC: return "1Z"; 742 743 case CODETYPEGALILEO_E5A_I: return "5I"; 744 case CODETYPEGALILEO_E5A_Q: return "5Q"; 745 case CODETYPEGALILEO_E5A_IQ: return "5X"; 746 747 case CODETYPEGALILEO_E5B_I: return "7I"; 748 case CODETYPEGALILEO_E5B_Q: return "7Q"; 749 case CODETYPEGALILEO_E5B_IQ: return "7X"; 750 751 case CODETYPEGALILEO_E5_I: return "8I"; 752 case CODETYPEGALILEO_E5_Q: return "8Q"; 753 case CODETYPEGALILEO_E5_IQ: return "8X"; 754 755 case CODETYPEGALILEO_E6_A: return "6A"; 756 case CODETYPEGALILEO_E6_B: return "6B"; 757 case CODETYPEGALILEO_E6_C: return "6C"; 758 case CODETYPEGALILEO_E6_BC: return "6X"; 759 case CODETYPEGALILEO_E6_ABC: return "6Z"; 744 case CODETYPEGALILEO_E1_A: return "1A"; 745 case CODETYPEGALILEO_E1_B: return "1B"; 746 case CODETYPEGALILEO_E1_C: return "1C"; 747 #ifdef USE_SSR_RTCM 748 case CODETYPEGALILEO_E1_BC: return "1X"; 749 case CODETYPEGALILEO_E1_ABC: return "1Z"; 750 #endif 751 case CODETYPEGALILEO_E5A_I: return "5I"; 752 case CODETYPEGALILEO_E5A_Q: return "5Q"; 753 #ifdef USE_SSR_RTCM 754 case CODETYPEGALILEO_E5A_IQ: return "5X"; 755 #endif 756 case CODETYPEGALILEO_E5B_I: return "7I"; 757 case CODETYPEGALILEO_E5B_Q: return "7Q"; 758 #ifdef USE_SSR_RTCM 759 case CODETYPEGALILEO_E5B_IQ: return "7X"; 760 761 case CODETYPEGALILEO_E5_I: return "8I"; 762 case CODETYPEGALILEO_E5_Q: return "8Q"; 763 case CODETYPEGALILEO_E5_IQ: return "8X"; 764 #endif 765 case CODETYPEGALILEO_E6_A: return "6A"; 766 case CODETYPEGALILEO_E6_B: return "6B"; 767 case CODETYPEGALILEO_E6_C: return "6C"; 768 #ifdef USE_SSR_RTCM 769 case CODETYPEGALILEO_E6_BC: return "6X"; 770 case CODETYPEGALILEO_E6_ABC: return "6Z"; 771 #endif 760 772 default: return ""; 761 773 } 762 774 } 763 else if (system == 'J') {775 else if (system == 'J') { 764 776 switch (type) { 765 777 case CODETYPEQZSS_L1_CA: return "1C"; … … 769 781 case CODETYPEQZSS_L2C_M: return "2S"; 770 782 case CODETYPEQZSS_L2C_L: return "2L"; 783 #ifdef USE_SSR_RTCM 771 784 case CODETYPEQZSS_L2C_ML: return "2X"; 772 785 #endif 773 786 case CODETYPEQZSS_L5_I: return "5I"; 774 787 case CODETYPEQZSS_L5_Q: return "5Q"; 788 #ifdef USE_SSR_RTCM 775 789 case CODETYPEQZSS_L5_IQ: return "5X"; 776 790 #endif 777 791 case CODETYPEQZSS_L6_D: return "6S"; 778 792 case CODETYPEQZSS_L6_P: return "6L"; 793 #ifdef USE_SSR_RTCM 779 794 case CODETYPEQZSS_L6_DP: return "6X"; 780 795 … … 785 800 case CODETYPEQZSS_L5_P: return "5P"; 786 801 case CODETYPEQZSS_L5_DP: return "5Z"; 802 #endif 787 803 788 804 case CODETYPEQZSS_L6_E: return "6E"; 805 #ifdef USE_SSR_RTCM 789 806 case CODETYPEQZSS_L6_DE: return "6Z"; 790 default: return ""; 791 } 792 } 793 else if (system == 'S') { 794 switch (type) { 795 case CODETYPE_SBAS_L1_CA: return "1C"; 796 797 case CODETYPE_SBAS_L5_I: return "5I"; 798 case CODETYPE_SBAS_L5_Q: return "5Q"; 799 case CODETYPE_SBAS_L5_IQ: return "5X"; 807 #endif 800 808 default: return ""; 801 809 } … … 805 813 case CODETYPE_BDS_B1_I: return "2I"; 806 814 case CODETYPE_BDS_B1_Q: return "2Q"; 815 #ifdef USE_SSR_RTCM 807 816 case CODETYPE_BDS_B1_IQ: return "2X"; 808 817 #endif 809 818 case CODETYPE_BDS_B3_I: return "6I"; 810 819 case CODETYPE_BDS_B3_Q: return "6Q"; 820 #ifdef USE_SSR_RTCM 811 821 case CODETYPE_BDS_B3_IQ: return "6X"; 812 822 #endif 813 823 case CODETYPE_BDS_B2_I: return "7I"; 814 824 case CODETYPE_BDS_B2_Q: return "7Q"; 825 #ifdef USE_SSR_RTCM 815 826 case CODETYPE_BDS_B2_IQ: return "7X"; 816 827 #endif 817 828 case CODETYPE_BDS_B1a_D: return "1D"; 818 829 case CODETYPE_BDS_B1a_P: return "1P"; 830 #ifdef USE_SSR_RTCM 819 831 case CODETYPE_BDS_B1a_DP: return "1X"; 820 832 #endif 821 833 case CODETYPE_BDS_B2a_D: return "5D"; 822 834 case CODETYPE_BDS_B2a_P: return "5P"; 835 #ifdef USE_SSR_RTCM 823 836 case CODETYPE_BDS_B2a_DP: return "5X"; 837 #elif USE_SSR_IGS 838 case CODETYPE_BDS_B1_A: return "1A"; 839 case CODETYPE_BDS_B3_A: return "6A"; 840 #endif 841 default: return ""; 842 } 843 } 844 else if (system == 'S') { 845 switch (type) { 846 case CODETYPE_SBAS_L1_CA: return "1C"; 847 848 case CODETYPE_SBAS_L5_I: return "5I"; 849 case CODETYPE_SBAS_L5_Q: return "5Q"; 850 #ifdef USE_SSR_RTCM 851 case CODETYPE_SBAS_L5_IQ: return "5X"; 852 #endif 824 853 default: return ""; 825 854 } -
branches/BNC_2.12/src/RTCM3/RTCM3coDecoder.h
r7169 r8987 32 32 33 33 extern "C" { 34 # include "clock_orbit_rtcm.h" 34 #ifdef USE_SSR_RTCM 35 #include "../RTCM3/clock_and_orbit/clock_orbit_rtcm.h" 36 #elif USE_SSR_IGS 37 #include "../RTCM3/clock_and_orbit/clock_orbit_igs.h" 38 #endif 35 39 } 36 40 -
branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.c
r8942 r8987 18 18 #include "clock_orbit_rtcm.h" 19 19 20 static uint32_t CRC24(long size, const unsigned char *buf) 21 { 20 static uint32_t CRC24(long size, const unsigned char *buf) { 22 21 uint32_t crc = 0; 23 22 int i; 24 23 25 while(size--) 26 { 24 while (size--) { 27 25 crc ^= (*buf++) << (16); 28 for (i = 0; i < 8; i++)29 {26 for (i = 0; i < 8; i++) 27 { 30 28 crc <<= 1; 31 if (crc & 0x1000000)29 if (crc & 0x1000000) 32 30 crc ^= 0x01864cfb; 33 31 } … … 37 35 38 36 /* NOTE: These defines are interlinked with below functions and directly modify 39 the values. This may not be optimized in terms of final program code size but40 should be optimized in terms of speed.41 42 modified variables are:43 - everything defined in STARTDATA (only use ressize outside of the defines,44 45 - buffer46 - size47 */37 the values. This may not be optimized in terms of final program code size but 38 should be optimized in terms of speed. 39 40 modified variables are: 41 - everything defined in STARTDATA (only use ressize outside of the defines, 42 others are private) 43 - buffer 44 - size 45 */ 48 46 49 47 #ifndef NOENCODE 50 48 #define STOREBITS \ 51 while(numbits >= 8) \ 52 { \ 49 while(numbits >= 8) { \ 53 50 if(!size) return 0; \ 54 51 *(buffer++) = bitbuffer>>(numbits-8); \ … … 58 55 } 59 56 60 #define ADDBITS(a, b) \ 61 { \ 57 #define ADDBITS(a, b) { \ 62 58 bitbuffer = (bitbuffer<<(a))|((b)&((1<<a)-1)); \ 63 59 numbits += (a); \ … … 79 75 80 76 #define ENDBLOCK \ 81 if(numbits) { ADDBITS((8-numbits), 0) } \ 82 { \ 77 if(numbits) { ADDBITS((8-numbits), 0) } { \ 83 78 int len = buffer-blockstart-3; \ 84 79 blockstart[1] |= len>>8; \ … … 95 90 96 91 /* GPS macros also used for other systems when matching! */ 97 #define T_ MESSAGE_NUMBER(a) ADDBITS(12, a)/* DF002 */98 #define T_GPS_SATELLITE_ID(a) ADDBITS( 6, a) /* DF068 */99 #define T_QZSS_SATELLITE_ID(a) ADDBITS( 4, a) /* DF249 */100 #define T_GLONASS_SATELLITE_ID(a) ADDBITS( 5, a)101 102 #define T_GPS_IODE(a) ADDBITS( 8, a) /* DF071 */103 #define T_GLONASS_IOD(a) ADDBITS( 8, a) /* DF239 */104 #define T_GALILEO_IOD(a) ADDBITS(10, a) /* DF459 */105 #define T_SBAS_T0MOD(a) ADDBITS( 9, (a/16)) /* DF468 */106 #define T_SBAS_IODCRC(a) ADDBITS(24, a) /* DF469 */107 #define T_BDS_TOEMOD(a) ADDBITS(10, (a/8)) /* DF470 */108 #define T_BDS_IOD(a) ADDBITS( 8, a) /* DF471 */92 #define T_RTCM_MESSAGE_NUMBER(a) ADDBITS(12, a) /* DF002 */ 93 #define T_GPS_SATELLITE_ID(a) ADDBITS( 6, a) /* DF068 */ 94 #define T_QZSS_SATELLITE_ID(a) ADDBITS( 4, a) /* DF249 */ 95 #define T_GLONASS_SATELLITE_ID(a) ADDBITS( 5, a) 96 97 #define T_GPS_IODE(a) ADDBITS( 8, a) /* DF071 */ 98 #define T_GLONASS_IOD(a) ADDBITS( 8, a) /* DF239 */ 99 #define T_GALILEO_IOD(a) ADDBITS(10, a) /* DF459 */ 100 #define T_SBAS_T0MOD(a) ADDBITS( 9, (a/16)) /* DF468 */ 101 #define T_SBAS_IODCRC(a) ADDBITS(24, a) /* DF469 */ 102 #define T_BDS_TOEMOD(a) ADDBITS(10, (a/8)) /* DF470 */ 103 #define T_BDS_IOD(a) ADDBITS( 8, a) /* DF471 */ 109 104 110 105 #define T_DELTA_RADIAL(a) SCALEADDBITS(22, 10000.0, a) … … 119 114 #define T_DELTA_CLOCK_C1(a) SCALEADDBITS(21, 1000000.0, a) 120 115 #define T_DELTA_CLOCK_C2(a) SCALEADDBITS(27, 50000000.0, a) 121 #define T_NO_OF_CODE_BIASES(a) ADDBITS( 5, a)122 #define T_NO_OF_PHASE_BIASES(a) ADDBITS( 5, a)123 #define T_SIGNAL_IDENTIFIER(a) ADDBITS( 5, a)116 #define T_NO_OF_CODE_BIASES(a) ADDBITS( 5, a) 117 #define T_NO_OF_PHASE_BIASES(a) ADDBITS( 5, a) 118 #define T_SIGNAL_IDENTIFIER(a) ADDBITS( 5, a) 124 119 #define T_CODE_BIAS(a) SCALEADDBITS(14, 100.0, a) 125 #define T_YAW_ANGLE(a) SCALEADDBITS( 9,256.0/MPI, a)126 #define T_YAW_RATE(a) SCALEADDBITS( 8,8192.0/MPI, a)120 #define T_YAW_ANGLE(a) SCALEADDBITS( 9, 256.0/MPI, a) 121 #define T_YAW_RATE(a) SCALEADDBITS( 8, 8192.0/MPI, a) 127 122 #define T_PHASE_BIAS(a) SCALEADDBITS(20, 10000.0, a) 128 123 129 124 #define T_GPS_EPOCH_TIME(a) ADDBITS(20, a) 130 125 #define T_GLONASS_EPOCH_TIME(a) ADDBITS(17, a) 131 #define T_NO_OF_SATELLITES(a) ADDBITS( 6, a)132 #define T_MULTIPLE_MESSAGE_INDICATOR(a) ADDBITS( 1, a)133 #define T_DISPERSIVE_BIAS_INDICATOR(a) ADDBITS( 1, a)134 #define T_MW_CONSISTENCY_INDICATOR(a) ADDBITS( 1, a)135 #define T_INTEGER_INDICATOR(a) ADDBITS( 1, a)136 #define T_WIDE_LANE_INDICATOR(a) ADDBITS( 2, a)137 #define T_DISCONTINUITY_COUNTER(a) ADDBITS( 4, a)138 #define T_SSR_URA(a) ADDBITS( 6, a)126 #define T_NO_OF_SATELLITES(a) ADDBITS( 6, a) 127 #define T_MULTIPLE_MESSAGE_INDICATOR(a) ADDBITS( 1, a) 128 #define T_DISPERSIVE_BIAS_INDICATOR(a) ADDBITS( 1, a) 129 #define T_MW_CONSISTENCY_INDICATOR(a) ADDBITS( 1, a) 130 #define T_INTEGER_INDICATOR(a) ADDBITS( 1, a) 131 #define T_WIDE_LANE_INDICATOR(a) ADDBITS( 2, a) 132 #define T_DISCONTINUITY_COUNTER(a) ADDBITS( 4, a) 133 #define T_SSR_URA(a) ADDBITS( 6, a) 139 134 #define T_HR_CLOCK_CORRECTION(a) SCALEADDBITS(22, 10000.0, a) 140 #define T_SSR_UPDATE_INTERVAL(a) ADDBITS( 4, a)141 142 #define T_SSR_IOD(a) ADDBITS( 4, a)135 #define T_SSR_UPDATE_INTERVAL(a) ADDBITS( 4, a) 136 137 #define T_SSR_IOD(a) ADDBITS( 4, a) 143 138 #define T_SSR_PROVIDER_ID(a) ADDBITS(16, a) 144 #define T_SSR_SOLUTION_ID(a) ADDBITS( 4, a)145 146 #define T_NO_IONO_LAYERS(a) ADDBITS( 2, a-1)147 #define T_VTEC_QUALITY_INDICATOR(a) SCALEADDBITS( 9,20.0, a)139 #define T_SSR_SOLUTION_ID(a) ADDBITS( 4, a) 140 141 #define T_NO_IONO_LAYERS(a) ADDBITS( 2, a-1) 142 #define T_VTEC_QUALITY_INDICATOR(a) SCALEADDBITS( 9, 20.0, a) 148 143 #define T_IONO_COEFF(a) SCALEADDBITS(16, 200.0, a) 149 #define T_IONO_DEGREE(a) ADDBITS(4, a-1) 150 #define T_IONO_ORDER(a) ADDBITS(4, a-1) 151 #define T_IONO_HEIGHT(a) SCALEADDBITS(8, 1/10000.0, a) 152 153 static double URAToValue(int ura) 154 { 144 #define T_IONO_DEGREE(a) ADDBITS( 4, a-1) 145 #define T_IONO_ORDER(a) ADDBITS( 4, a-1) 146 #define T_IONO_HEIGHT(a) SCALEADDBITS( 8, 1/10000.0, a) 147 148 static double URAToValue(int ura) { 155 149 int urac, urav; 156 150 urac = ura >> 3; 157 151 urav = ura & 7; 158 if (!ura)152 if (!ura) 159 153 return 0; 160 else if (ura == 63)154 else if (ura == 63) 161 155 return SSR_MAXURA; 162 return (pow(3, urac)*(1.0+urav/4.0)-1.0)/1000.0;156 return (pow(3, urac) * (1.0 + urav / 4.0) - 1.0) / 1000.0; 163 157 } 164 158 165 static int ValueToURA(double val) 166 { 159 static int ValueToURA(double val) { 167 160 int ura; 168 if (!val)161 if (!val) 169 162 return 0; 170 else if (val > 5.4665)163 else if (val > 5.4665) 171 164 return 63; 172 for (ura = 1; ura < 63 && val > URAToValue(ura); ++ura)165 for (ura = 1; ura < 63 && val > URAToValue(ura); ++ura) 173 166 ; 174 167 return ura; 175 168 } 176 169 177 static const enum ClockOrbitType corbase[CLOCKORBIT_SATNUM] = 178 { 179 (int) COBBASE_GPS, (int) COBBASE_GLONASS, (int) COBBASE_GALILEO, 180 (int) COBBASE_QZSS, (int) COBBASE_SBAS, (int) COBBASE_BDS 170 static const enum ClockOrbitType corbase[CLOCKORBIT_SATNUM] = { 171 (int) COBBASE_GPS, 172 (int) COBBASE_GLONASS, 173 (int) COBBASE_GALILEO, 174 (int) COBBASE_QZSS, 175 (int) COBBASE_SBAS, 176 (int) COBBASE_BDS 181 177 }; 182 static const enum COR_OFFSETS satoffset[CLOCKORBIT_SATNUM+1] = 183 { 184 CLOCKORBIT_OFFSETGPS, CLOCKORBIT_OFFSETGLONASS, CLOCKORBIT_OFFSETGALILEO, 185 CLOCKORBIT_OFFSETQZSS, CLOCKORBIT_OFFSETSBAS, CLOCKORBIT_OFFSETBDS, 178 179 static const enum COR_OFFSETS satoffset[CLOCKORBIT_SATNUM + 1] = { 180 CLOCKORBIT_OFFSETGPS, 181 CLOCKORBIT_OFFSETGLONASS, 182 CLOCKORBIT_OFFSETGALILEO, 183 CLOCKORBIT_OFFSETQZSS, 184 CLOCKORBIT_OFFSETSBAS, 185 CLOCKORBIT_OFFSETBDS, 186 186 CLOCKORBIT_COUNTSAT 187 187 }; 188 188 189 189 size_t MakeClockOrbit(const struct ClockOrbit *co, enum ClockOrbitType type, 190 int moremessagesfollow, char *buffer, size_t size) 191 { 190 int moremessagesfollow, char *buffer, size_t size) { 192 191 unsigned int status[CLOCKORBIT_SATNUM][COBOFS_NUM], i, s; 193 192 194 193 memset(status, 0, sizeof(status)); 194 195 195 STARTDATA 196 196 197 for(s = 0; s < CLOCKORBIT_SATNUM; ++s) 198 { 199 for(i = 0; i < COBOFS_NUM; ++i) 200 { 201 if(co->NumberOfSat[s] && (type == COTYPE_AUTO 202 || type == corbase[s]+i) && (co->Supplied[i] || (i <= COBOFS_CLOCK 203 && co->Supplied[COBOFS_COMBINED]) || (i == COBOFS_COMBINED 204 && co->Supplied[COBOFS_ORBIT] && co->Supplied[COBOFS_CLOCK]))) 205 { 197 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) { 198 for (i = 0; i < COBOFS_NUM; ++i) { 199 if (co->NumberOfSat[s] && (type == COTYPE_AUTO || type == corbase[s] + i) && 200 (co->Supplied[i] || (i <= COBOFS_CLOCK && co->Supplied[COBOFS_COMBINED]) || 201 (i == COBOFS_COMBINED && co->Supplied[COBOFS_ORBIT] && co->Supplied[COBOFS_CLOCK]))) { 206 202 status[s][i] = 1; 207 if(i == COBOFS_COMBINED) 208 { 203 if (i == COBOFS_COMBINED) { 209 204 status[s][COBOFS_ORBIT] = status[s][COBOFS_CLOCK] = 0; 210 205 } /* disable single blocks for combined type */ … … 213 208 } /* iterate over satellite systems */ 214 209 215 for(s = 0; s < CLOCKORBIT_SATNUM; ++s) 216 { 217 if(status[s][COBOFS_ORBIT]) 218 { 210 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) { 211 if (status[s][COBOFS_ORBIT]) { 219 212 INITBLOCK 220 T_MESSAGE_NUMBER(corbase[s]+COBOFS_ORBIT) 221 switch(s) 222 { 223 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 224 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 225 case CLOCKORBIT_SATBDS: 226 T_GPS_EPOCH_TIME(co->EpochTime[s]) 227 break; 228 case CLOCKORBIT_SATGLONASS: 229 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 230 break; 213 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_ORBIT) 214 switch (s) { 215 case CLOCKORBIT_SATGPS: 216 case CLOCKORBIT_SATGALILEO: 217 case CLOCKORBIT_SATQZSS: 218 case CLOCKORBIT_SATSBAS: 219 case CLOCKORBIT_SATBDS: 220 T_GPS_EPOCH_TIME(co->EpochTime[s]) 221 break; 222 case CLOCKORBIT_SATGLONASS: 223 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 224 break; 231 225 } 232 226 T_SSR_UPDATE_INTERVAL(co->UpdateInterval) … … 237 231 T_SSR_SOLUTION_ID(co->SSRSolutionID) 238 232 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 239 for(i = satoffset[s]; i < satoffset[s]+co->NumberOfSat[s]; ++i) 240 { 241 switch(s) 242 { 243 case CLOCKORBIT_SATGPS: 244 T_GPS_SATELLITE_ID(co->Sat[i].ID) 245 T_GPS_IODE(co->Sat[i].IOD) 246 break; 247 case CLOCKORBIT_SATGLONASS: 248 T_GLONASS_SATELLITE_ID(co->Sat[i].ID) 249 T_GLONASS_IOD(co->Sat[i].IOD) 250 break; 251 case CLOCKORBIT_SATGALILEO: 252 T_GPS_SATELLITE_ID(co->Sat[i].ID) 253 T_GALILEO_IOD(co->Sat[i].IOD) 254 break; 255 case CLOCKORBIT_SATQZSS: 256 T_QZSS_SATELLITE_ID(co->Sat[i].ID) 257 T_GPS_IODE(co->Sat[i].IOD) 258 break; 259 case CLOCKORBIT_SATSBAS: 260 T_GPS_SATELLITE_ID(co->Sat[i].ID) 261 T_SBAS_T0MOD(co->Sat[i].toe) 262 T_SBAS_IODCRC(co->Sat[i].IOD) 263 break; 264 case CLOCKORBIT_SATBDS: 265 T_GPS_SATELLITE_ID(co->Sat[i].ID) 266 T_BDS_TOEMOD(co->Sat[i].toe) 267 T_BDS_IOD(co->Sat[i].IOD) 268 break; 233 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) { 234 switch (s) { 235 case CLOCKORBIT_SATGPS: 236 T_GPS_SATELLITE_ID(co->Sat[i].ID) 237 T_GPS_IODE(co->Sat[i].IOD) 238 break; 239 case CLOCKORBIT_SATGLONASS: 240 T_GLONASS_SATELLITE_ID(co->Sat[i].ID) 241 T_GLONASS_IOD(co->Sat[i].IOD) 242 break; 243 case CLOCKORBIT_SATGALILEO: 244 T_GPS_SATELLITE_ID(co->Sat[i].ID) 245 T_GALILEO_IOD(co->Sat[i].IOD) 246 break; 247 case CLOCKORBIT_SATQZSS: 248 T_QZSS_SATELLITE_ID(co->Sat[i].ID) 249 T_GPS_IODE(co->Sat[i].IOD) 250 break; 251 case CLOCKORBIT_SATSBAS: 252 T_GPS_SATELLITE_ID(co->Sat[i].ID) 253 T_SBAS_T0MOD(co->Sat[i].toe) 254 T_SBAS_IODCRC(co->Sat[i].IOD) 255 break; 256 case CLOCKORBIT_SATBDS: 257 T_GPS_SATELLITE_ID(co->Sat[i].ID) 258 T_BDS_TOEMOD(co->Sat[i].toe) 259 T_BDS_IOD(co->Sat[i].IOD) 260 break; 269 261 } 270 262 T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial) … … 277 269 ENDBLOCK 278 270 } 279 if(status[s][COBOFS_CLOCK]) 280 { 271 if (status[s][COBOFS_CLOCK]) { 281 272 INITBLOCK 282 T_MESSAGE_NUMBER(corbase[s]+COBOFS_CLOCK) 283 switch(s) 284 { 285 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 286 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 287 case CLOCKORBIT_SATBDS: 288 T_GPS_EPOCH_TIME(co->EpochTime[s]) 289 break; 290 case CLOCKORBIT_SATGLONASS: 291 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 292 break; 273 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_CLOCK) 274 switch (s) { 275 case CLOCKORBIT_SATGPS: 276 case CLOCKORBIT_SATGALILEO: 277 case CLOCKORBIT_SATQZSS: 278 case CLOCKORBIT_SATSBAS: 279 case CLOCKORBIT_SATBDS: 280 T_GPS_EPOCH_TIME(co->EpochTime[s]) 281 break; 282 case CLOCKORBIT_SATGLONASS: 283 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 284 break; 293 285 } 294 286 T_SSR_UPDATE_INTERVAL(co->UpdateInterval) … … 298 290 T_SSR_SOLUTION_ID(co->SSRSolutionID) 299 291 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 300 for (i = satoffset[s]; i < satoffset[s]+co->NumberOfSat[s]; ++i)301 {302 switch(s)303 {304 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO:305 case CLOCKORBIT_SATSBAS:case CLOCKORBIT_SATBDS:306 T_GPS_SATELLITE_ID(co->Sat[i].ID)307 break;308 case CLOCKORBIT_SATQZSS:309 T_QZSS_SATELLITE_ID(co->Sat[i].ID)310 break;311 case CLOCKORBIT_SATGLONASS:312 T_GLONASS_SATELLITE_ID(co->Sat[i].ID)313 break;292 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) { 293 switch (s) { 294 case CLOCKORBIT_SATGPS: 295 case CLOCKORBIT_SATGALILEO: 296 case CLOCKORBIT_SATSBAS: 297 case CLOCKORBIT_SATBDS: 298 T_GPS_SATELLITE_ID(co->Sat[i].ID) 299 break; 300 case CLOCKORBIT_SATQZSS: 301 T_QZSS_SATELLITE_ID(co->Sat[i].ID) 302 break; 303 case CLOCKORBIT_SATGLONASS: 304 T_GLONASS_SATELLITE_ID(co->Sat[i].ID) 305 break; 314 306 } 315 307 T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0) … … 319 311 ENDBLOCK 320 312 } 321 if(status[s][COBOFS_COMBINED]) 322 { 313 if (status[s][COBOFS_COMBINED]) { 323 314 #ifdef SPLITBLOCK 324 315 int nums = co->NumberOfSat[s]; 325 316 int left, start = satoffset[s]; 326 if(nums > 28) /* split block when more than 28 sats */ 327 { 317 if(nums > 28) {/* split block when more than 28 sats */ 328 318 left = nums - 28; 329 319 nums = 28; 330 320 } 331 else 332 { 321 else { 333 322 left = 0; 334 323 } 335 while(nums) 336 { 337 #endif 338 INITBLOCK339 T_MESSAGE_NUMBER(corbase[s]+COBOFS_COMBINED)340 switch(s)341 {342 case CLOCKORBIT_SAT GPS: case CLOCKORBIT_SATGALILEO:343 case CLOCKORBIT_SAT QZSS: case CLOCKORBIT_SATSBAS:324 while(nums) { 325 #endif 326 INITBLOCK 327 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_COMBINED) 328 switch (s) { 329 case CLOCKORBIT_SATGPS: 330 case CLOCKORBIT_SATGALILEO: 331 case CLOCKORBIT_SATQZSS: 332 case CLOCKORBIT_SATSBAS: 344 333 case CLOCKORBIT_SATBDS: 345 334 T_GPS_EPOCH_TIME(co->EpochTime[s]) … … 348 337 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 349 338 break; 350 351 339 } 340 T_SSR_UPDATE_INTERVAL(co->UpdateInterval) 352 341 #ifdef SPLITBLOCK 353 342 T_MULTIPLE_MESSAGE_INDICATOR((moremessagesfollow || left) ? 1 : 0) 354 343 #else 355 356 #endif 357 358 359 360 344 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0) 345 #endif 346 T_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 347 T_SSR_IOD(co->SSRIOD) 348 T_SSR_PROVIDER_ID(co->SSRProviderID) 349 T_SSR_SOLUTION_ID(co->SSRSolutionID) 361 350 #ifdef SPLITBLOCK 362 363 351 T_NO_OF_SATELLITES(nums) 352 for(i = start; i < start+nums; ++i) 364 353 #else 365 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 366 for(i = satoffset[s]; i < satoffset[s]+co->NumberOfSat[s]; ++i) 367 #endif 368 { 369 switch(s) 370 { 354 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 355 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) 356 #endif 357 { 358 switch (s) { 371 359 case CLOCKORBIT_SATGPS: 372 360 T_GPS_SATELLITE_ID(co->Sat[i].ID) … … 395 383 T_BDS_IOD(co->Sat[i].IOD) 396 384 break; 397 }398 T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)399 T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)400 T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)401 T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)402 T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)403 T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)404 T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)405 T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)406 T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)407 385 } 408 ENDBLOCK 386 T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial) 387 T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack) 388 T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack) 389 T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial) 390 T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack) 391 T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack) 392 T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0) 393 T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1) 394 T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2) 395 } 396 ENDBLOCK 409 397 #ifdef SPLITBLOCK 410 start += nums; 411 nums = left; 412 left = 0; 413 } 414 #endif 398 start += nums; 399 nums = left; 400 left = 0; 415 401 } 416 if(status[s][COBOFS_HR]) 417 { 402 #endif 403 } 404 if (status[s][COBOFS_HR]) { 418 405 INITBLOCK 419 T_MESSAGE_NUMBER(corbase[s]+COBOFS_HR) 420 switch(s) 421 { 422 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 423 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 424 case CLOCKORBIT_SATBDS: 425 T_GPS_EPOCH_TIME(co->EpochTime[s]) 426 break; 427 case CLOCKORBIT_SATGLONASS: 428 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 429 break; 406 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_HR) 407 switch (s) { 408 case CLOCKORBIT_SATGPS: 409 case CLOCKORBIT_SATGALILEO: 410 case CLOCKORBIT_SATQZSS: 411 case CLOCKORBIT_SATSBAS: 412 case CLOCKORBIT_SATBDS: 413 T_GPS_EPOCH_TIME(co->EpochTime[s]) 414 break; 415 case CLOCKORBIT_SATGLONASS: 416 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 417 break; 430 418 } 431 419 T_SSR_UPDATE_INTERVAL(co->UpdateInterval) … … 435 423 T_SSR_SOLUTION_ID(co->SSRSolutionID) 436 424 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 437 for (i = satoffset[s]; i < satoffset[s]+co->NumberOfSat[s]; ++i)438 {439 switch(s)440 {441 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO:442 case CLOCKORBIT_SATSBAS:case CLOCKORBIT_SATBDS:443 T_GPS_SATELLITE_ID(co->Sat[i].ID)444 break;445 case CLOCKORBIT_SATQZSS:446 T_QZSS_SATELLITE_ID(co->Sat[i].ID)447 break;448 case CLOCKORBIT_SATGLONASS:449 T_GLONASS_SATELLITE_ID(co->Sat[i].ID)450 break;425 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) { 426 switch (s) { 427 case CLOCKORBIT_SATGPS: 428 case CLOCKORBIT_SATGALILEO: 429 case CLOCKORBIT_SATSBAS: 430 case CLOCKORBIT_SATBDS: 431 T_GPS_SATELLITE_ID(co->Sat[i].ID) 432 break; 433 case CLOCKORBIT_SATQZSS: 434 T_QZSS_SATELLITE_ID(co->Sat[i].ID) 435 break; 436 case CLOCKORBIT_SATGLONASS: 437 T_GLONASS_SATELLITE_ID(co->Sat[i].ID) 438 break; 451 439 } 452 440 T_HR_CLOCK_CORRECTION(co->Sat[i].hrclock) … … 454 442 ENDBLOCK 455 443 } 456 if(status[s][COBOFS_URA]) 457 { 444 if (status[s][COBOFS_URA]) { 458 445 INITBLOCK 459 T_MESSAGE_NUMBER(corbase[s]+COBOFS_URA) 460 switch(s) 461 { 462 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 463 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 464 case CLOCKORBIT_SATBDS: 465 T_GPS_EPOCH_TIME(co->EpochTime[s]) 466 break; 467 case CLOCKORBIT_SATGLONASS: 468 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 469 break; 446 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_URA) 447 switch (s) { 448 case CLOCKORBIT_SATGPS: 449 case CLOCKORBIT_SATGALILEO: 450 case CLOCKORBIT_SATQZSS: 451 case CLOCKORBIT_SATSBAS: 452 case CLOCKORBIT_SATBDS: 453 T_GPS_EPOCH_TIME(co->EpochTime[s]) 454 break; 455 case CLOCKORBIT_SATGLONASS: 456 T_GLONASS_EPOCH_TIME(co->EpochTime[s]) 457 break; 470 458 } 471 459 T_SSR_UPDATE_INTERVAL(co->UpdateInterval) … … 475 463 T_SSR_SOLUTION_ID(co->SSRSolutionID) 476 464 T_NO_OF_SATELLITES(co->NumberOfSat[s]) 477 for (i = satoffset[s]; i < satoffset[s]+co->NumberOfSat[s]; ++i)478 {479 switch(s)480 {481 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO:482 case CLOCKORBIT_SATSBAS:case CLOCKORBIT_SATBDS:483 T_GPS_SATELLITE_ID(co->Sat[i].ID)484 break;485 case CLOCKORBIT_SATQZSS:486 T_QZSS_SATELLITE_ID(co->Sat[i].ID)487 break;488 case CLOCKORBIT_SATGLONASS:489 T_GLONASS_SATELLITE_ID(co->Sat[i].ID)490 break;465 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) { 466 switch (s) { 467 case CLOCKORBIT_SATGPS: 468 case CLOCKORBIT_SATGALILEO: 469 case CLOCKORBIT_SATSBAS: 470 case CLOCKORBIT_SATBDS: 471 T_GPS_SATELLITE_ID(co->Sat[i].ID) 472 break; 473 case CLOCKORBIT_SATQZSS: 474 T_QZSS_SATELLITE_ID(co->Sat[i].ID) 475 break; 476 case CLOCKORBIT_SATGLONASS: 477 T_GLONASS_SATELLITE_ID(co->Sat[i].ID) 478 break; 491 479 } 492 480 T_SSR_URA(ValueToURA(co->Sat[i].UserRangeAccuracy)) … … 499 487 500 488 size_t MakeCodeBias(const struct CodeBias *b, enum CodeBiasType type, 501 int moremessagesfollow, char *buffer, size_t size) 502 { 489 int moremessagesfollow, char *buffer, size_t size) { 503 490 unsigned int s, i, j; 504 491 505 492 STARTDATA 506 493 507 for(s = 0; s < CLOCKORBIT_SATNUM; ++s) 508 { 509 if(b->NumberOfSat[s] && (type == BTYPE_AUTO || type == corbase[s]+COBOFS_BIAS)) 510 { 494 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) { 495 if (b->NumberOfSat[s] && (type == CBTYPE_AUTO || type == corbase[s] + COBOFS_CBIAS)) { 511 496 INITBLOCK 512 T_MESSAGE_NUMBER(corbase[s]+COBOFS_BIAS) 513 switch(s) 514 { 515 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 516 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 517 case CLOCKORBIT_SATBDS: 518 T_GPS_EPOCH_TIME(b->EpochTime[s]) 519 break; 520 case CLOCKORBIT_SATGLONASS: 521 T_GLONASS_EPOCH_TIME(b->EpochTime[s]) 522 break; 497 T_RTCM_MESSAGE_NUMBER(corbase[s] + COBOFS_CBIAS) 498 switch (s) { 499 case CLOCKORBIT_SATGPS: 500 case CLOCKORBIT_SATGALILEO: 501 case CLOCKORBIT_SATQZSS: 502 case CLOCKORBIT_SATSBAS: 503 case CLOCKORBIT_SATBDS: 504 T_GPS_EPOCH_TIME(b->EpochTime[s]) 505 break; 506 case CLOCKORBIT_SATGLONASS: 507 T_GLONASS_EPOCH_TIME(b->EpochTime[s]) 508 break; 523 509 } 524 510 T_SSR_UPDATE_INTERVAL(b->UpdateInterval) … … 528 514 T_SSR_SOLUTION_ID(b->SSRSolutionID) 529 515 T_NO_OF_SATELLITES(b->NumberOfSat[s]) 530 for (i = satoffset[s]; i < satoffset[s]+b->NumberOfSat[s]; ++i)531 {532 switch(s)533 {534 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO:535 case CLOCKORBIT_SATSBAS:case CLOCKORBIT_SATBDS:536 T_GPS_SATELLITE_ID(b->Sat[i].ID)537 break;538 case CLOCKORBIT_SATQZSS:539 T_QZSS_SATELLITE_ID(b->Sat[i].ID)540 break;541 case CLOCKORBIT_SATGLONASS:542 T_GLONASS_SATELLITE_ID(b->Sat[i].ID)543 break;516 for (i = satoffset[s]; i < satoffset[s] + b->NumberOfSat[s]; ++i) { 517 switch (s) { 518 case CLOCKORBIT_SATGPS: 519 case CLOCKORBIT_SATGALILEO: 520 case CLOCKORBIT_SATSBAS: 521 case CLOCKORBIT_SATBDS: 522 T_GPS_SATELLITE_ID(b->Sat[i].ID) 523 break; 524 case CLOCKORBIT_SATQZSS: 525 T_QZSS_SATELLITE_ID(b->Sat[i].ID) 526 break; 527 case CLOCKORBIT_SATGLONASS: 528 T_GLONASS_SATELLITE_ID(b->Sat[i].ID) 529 break; 544 530 } 545 531 T_NO_OF_CODE_BIASES(b->Sat[i].NumberOfCodeBiases) 546 for(j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j) 547 { 532 for (j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j) { 548 533 T_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type) 549 534 T_CODE_BIAS(b->Sat[i].Biases[j].Bias) … … 557 542 558 543 size_t MakePhaseBias(const struct PhaseBias *b, enum PhaseBiasType type, 559 int moremessagesfollow, char *buffer, size_t size) 560 { 544 int moremessagesfollow, char *buffer, size_t size) { 561 545 unsigned int s, i, j; 562 546 563 547 STARTDATA 564 548 565 for(s = 0; s < CLOCKORBIT_SATNUM; ++s) 566 { 567 if(b->NumberOfSat[s] && (type == PBTYPE_AUTO || type == s+PBTYPE_BASE)) 568 { 549 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) { 550 if (b->NumberOfSat[s] && (type == PBTYPE_AUTO || type == s + PBTYPE_BASE)) { 569 551 INITBLOCK 570 T_MESSAGE_NUMBER(s+PBTYPE_BASE) 571 switch(s) 572 { 573 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 574 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 575 case CLOCKORBIT_SATBDS: 576 T_GPS_EPOCH_TIME(b->EpochTime[s]) 577 break; 578 case CLOCKORBIT_SATGLONASS: 579 T_GLONASS_EPOCH_TIME(b->EpochTime[s]) 580 break; 552 T_RTCM_MESSAGE_NUMBER(s + PBTYPE_BASE) 553 switch (s) { 554 case CLOCKORBIT_SATGPS: 555 case CLOCKORBIT_SATGALILEO: 556 case CLOCKORBIT_SATQZSS: 557 case CLOCKORBIT_SATSBAS: 558 case CLOCKORBIT_SATBDS: 559 T_GPS_EPOCH_TIME(b->EpochTime[s]) 560 break; 561 case CLOCKORBIT_SATGLONASS: 562 T_GLONASS_EPOCH_TIME(b->EpochTime[s]) 563 break; 581 564 } 582 565 T_SSR_UPDATE_INTERVAL(b->UpdateInterval) … … 588 571 T_MW_CONSISTENCY_INDICATOR(b->MWConsistencyIndicator ? 1 : 0) 589 572 T_NO_OF_SATELLITES(b->NumberOfSat[s]) 590 for (i = satoffset[s]; i < satoffset[s]+b->NumberOfSat[s]; ++i)591 {592 switch(s)593 {594 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO:595 case CLOCKORBIT_SATSBAS:case CLOCKORBIT_SATBDS:596 T_GPS_SATELLITE_ID(b->Sat[i].ID)597 break;598 case CLOCKORBIT_SATQZSS:599 T_QZSS_SATELLITE_ID(b->Sat[i].ID)600 break;601 case CLOCKORBIT_SATGLONASS:602 T_GLONASS_SATELLITE_ID(b->Sat[i].ID)603 break;573 for (i = satoffset[s]; i < satoffset[s] + b->NumberOfSat[s]; ++i) { 574 switch (s) { 575 case CLOCKORBIT_SATGPS: 576 case CLOCKORBIT_SATGALILEO: 577 case CLOCKORBIT_SATSBAS: 578 case CLOCKORBIT_SATBDS: 579 T_GPS_SATELLITE_ID(b->Sat[i].ID) 580 break; 581 case CLOCKORBIT_SATQZSS: 582 T_QZSS_SATELLITE_ID(b->Sat[i].ID) 583 break; 584 case CLOCKORBIT_SATGLONASS: 585 T_GLONASS_SATELLITE_ID(b->Sat[i].ID) 586 break; 604 587 } 605 588 T_NO_OF_PHASE_BIASES(b->Sat[i].NumberOfPhaseBiases) 606 589 T_YAW_ANGLE(b->Sat[i].YawAngle) 607 590 T_YAW_RATE(b->Sat[i].YawRate) 608 for(j = 0; j < b->Sat[i].NumberOfPhaseBiases; ++j) 609 { 591 for (j = 0; j < b->Sat[i].NumberOfPhaseBiases; ++j) { 610 592 T_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type) 611 T_INTEGER_INDICATOR(b->Sat[i].Biases[j].SignalIntegerIndicator ? 1 : 0) 612 T_WIDE_LANE_INDICATOR(b->Sat[i].Biases[j].SignalsWideLaneIntegerIndicator) 613 T_DISCONTINUITY_COUNTER(b->Sat[i].Biases[j].SignalDiscontinuityCounter) 593 T_INTEGER_INDICATOR( 594 b->Sat[i].Biases[j].SignalIntegerIndicator ? 1 : 0) 595 T_WIDE_LANE_INDICATOR( 596 b->Sat[i].Biases[j].SignalsWideLaneIntegerIndicator) 597 T_DISCONTINUITY_COUNTER( 598 b->Sat[i].Biases[j].SignalDiscontinuityCounter) 614 599 T_PHASE_BIAS(b->Sat[i].Biases[j].Bias) 615 600 } … … 621 606 } 622 607 623 size_t MakeVTEC(const struct VTEC *v, int moremessagesfollow, char *buffer, 624 size_t size) 625 { 608 size_t MakeVTEC(const struct VTEC *v, int moremessagesfollow, char *buffer, size_t size) { 626 609 unsigned int l, o, d; 627 610 628 611 STARTDATA 629 INITBLOCK630 T_ MESSAGE_NUMBER(VTEC_BASE)612 INITBLOCK 613 T_RTCM_MESSAGE_NUMBER(VTEC_BASE) 631 614 632 615 T_GPS_EPOCH_TIME(v->EpochTime) … … 638 621 T_VTEC_QUALITY_INDICATOR(v->Quality) 639 622 T_NO_IONO_LAYERS(v->NumLayers) 640 for(l = 0; l < v->NumLayers; ++l) 641 { 623 for (l = 0; l < v->NumLayers; ++l) { 642 624 T_IONO_HEIGHT(v->Layers[l].Height) 643 625 T_IONO_DEGREE(v->Layers[l].Degree) 644 626 T_IONO_ORDER(v->Layers[l].Order) 645 for(o = 0; o <= v->Layers[l].Order; ++o) 646 { 647 for(d = o; d <= v->Layers[l].Degree; ++d) 648 { 627 for (o = 0; o <= v->Layers[l].Order; ++o) { 628 for (d = o; d <= v->Layers[l].Degree; ++d) { 649 629 T_IONO_COEFF(v->Layers[l].Cosinus[d][o]) 650 630 } 651 631 } 652 for(o = 1; o <= v->Layers[l].Order; ++o) 653 { 654 for(d = o; d <= v->Layers[l].Degree; ++d) 655 { 632 for (o = 1; o <= v->Layers[l].Order; ++o) { 633 for (d = o; d <= v->Layers[l].Degree; ++d) { 656 634 T_IONO_COEFF(v->Layers[l].Sinus[d][o]) 657 635 } … … 669 647 uint64_t bitbuffer=0; 670 648 671 #define LOADBITS(a) \ 672 { \ 649 #define LOADBITS(a) { \ 673 650 while((a) > numbits) \ 674 651 { \ … … 680 657 681 658 /* extract bits from data stream 682 b = variable to store result, a = number of bits */ 683 #define GETBITS(b, a) \ 684 { \ 659 b = variable to store result, a = number of bits */ 660 #define GETBITS(b, a) { \ 685 661 LOADBITS(a) \ 686 662 b = (bitbuffer<<(64-numbits))>>(64-(a)); \ … … 689 665 690 666 /* extract bits from data stream 691 b = variable to store result, a = number of bits */ 692 #define GETBITSFACTOR(b, a, c) \ 693 { \ 667 b = variable to store result, a = number of bits */ 668 #define GETBITSFACTOR(b, a, c) { \ 694 669 LOADBITS(a) \ 695 670 b = ((bitbuffer<<(64-numbits))>>(64-(a)))*(c); \ … … 698 673 699 674 /* extract signed floating value from data stream 700 b = variable to store result, a = number of bits */ 701 #define GETFLOATSIGN(b, a, c) \ 702 { \ 675 b = variable to store result, a = number of bits */ 676 #define GETFLOATSIGN(b, a, c) { \ 703 677 LOADBITS(a) \ 704 678 b = ((double)(((int64_t)(bitbuffer<<(64-numbits)))>>(64-(a))))*(c); \ … … 707 681 708 682 /* extract floating value from data stream 709 b = variable to store result, a = number of bits, c = scale factor */ 710 #define GETFLOAT(b, a, c) \ 711 { \ 683 b = variable to store result, a = number of bits, c = scale factor */ 684 #define GETFLOAT(b, a, c) { \ 712 685 LOADBITS(a) \ 713 686 b = ((double)((bitbuffer<<(sizeof(bitbuffer)*8-numbits))>>(sizeof(bitbuffer)*8-(a))))*(c); \ … … 721 694 #define G_RESERVEDH(a) GETBITS(a,6) 722 695 #define G_SIZE(a) GETBITS(a, 10) 723 #define G_ MESSAGE_NUMBER(a)GETBITS(a, 12) /* DF002 */696 #define G_RTCM_MESSAGE_NUMBER(a) GETBITS(a, 12) /* DF002 */ 724 697 #define G_GPS_SATELLITE_ID(a) GETBITS(a, 6) /* DF068 */ 725 698 #define G_QZSS_SATELLITE_ID(a) GETBITS(a, 4) /* DF249 */ … … 782 755 #define G_IONO_HEIGHT(a) GETFLOAT(a, 8 , 10000.0) 783 756 784 enum GCOB_RETURN GetSSR(struct ClockOrbit *co, struct CodeBias *b, struct VTEC *v, 785 struct PhaseBias *pb, const char *buffer, size_t size, int *bytesused) 786 { 787 int mmi=0, h, rs; 757 enum GCOB_RETURN GetSSR(struct ClockOrbit *co, struct CodeBias *b,struct VTEC *v, 758 struct PhaseBias *pb, const char *buffer, size_t size, int *bytesused) { 759 int mmi = 0, h, rs; 788 760 unsigned int type, pos, i, j, s, nums, id; 789 761 size_t sizeofrtcmblock; … … 791 763 DECODESTART 792 764 793 if (size < 7)765 if (size < 7) 794 766 return GCOBR_SHORTBUFFER; 795 767 796 #ifdef DEBUG797 fprintf(stderr, "Get ClockOrbitBias START: size %d, numbits %d\n",size, numbits);768 #ifdef BNC_DEBUG 769 fprintf(stderr, "GetSSR START: size %d, numbits %d\n",(int)size, numbits); 798 770 #endif 799 771 … … 802 774 G_SIZE(sizeofrtcmblock); 803 775 804 if ((unsigned char)h != 0xD3 || rs)776 if ((unsigned char) h != 0xD3 || rs) 805 777 return GCOBR_UNKNOWNDATA; 806 if (size < sizeofrtcmblock + 3) /* 3 header bytes already removed */778 if (size < sizeofrtcmblock + 3) /* 3 header bytes already removed */ 807 779 return GCOBR_MESSAGEEXCEEDSBUFFER; 808 if (CRC24(sizeofrtcmblock+3, (const unsigned char *) blockstart) !=809 (uint32_t)((((unsigned char)buffer[sizeofrtcmblock])<<16)|810 (((unsigned char)buffer[sizeofrtcmblock+1])<<8)|811 (((unsigned char)buffer[sizeofrtcmblock+2]))))780 if (CRC24(sizeofrtcmblock + 3, (const unsigned char *) blockstart) != 781 (uint32_t) ((((unsigned char) buffer[sizeofrtcmblock]) << 16) | 782 (((unsigned char) buffer[sizeofrtcmblock + 1]) << 8) | 783 (((unsigned char) buffer[sizeofrtcmblock + 2])))) 812 784 return GCOBR_CRCMISMATCH; 813 785 size = sizeofrtcmblock; /* reduce size, so overflows are detected */ 814 786 815 G_MESSAGE_NUMBER(type) 816 #ifdef DEBUG 817 fprintf(stderr, "type %d size %d\n",type,sizeofrtcmblock); 818 #endif 819 if(bytesused) 820 *bytesused = sizeofrtcmblock+6; 821 if(type == VTEC_BASE) 822 { 787 G_RTCM_MESSAGE_NUMBER(type) 788 #ifdef BNC_DEBUG 789 fprintf(stderr, "type %d size %d\n",type,(int)sizeofrtcmblock); 790 #endif 791 if (bytesused) 792 *bytesused = sizeofrtcmblock + 6; 793 if (type == VTEC_BASE) { 823 794 unsigned int l, o, d; 824 if(!v) return GCOBR_NOVTECPARAMETER; 795 if (!v) 796 return GCOBR_NOVTECPARAMETER; 825 797 memset(v, 0, sizeof(*v)); 826 798 G_EPOCH_TIME(v->EpochTime) … … 832 804 G_VTEC_QUALITY_INDICATOR(v->Quality) 833 805 G_NO_IONO_LAYERS(v->NumLayers) 834 for(l = 0; l < v->NumLayers; ++l) 835 { 806 #ifdef BNC_DEBUG 807 fprintf(stderr, "epochTime %d ui %d mmi %d ssrIod %d providerId %d solId %d vtecQ %8.3f numLay %d \n", 808 v->EpochTime, v->UpdateInterval, mmi, 809 v->SSRIOD, v->SSRProviderID, v->SSRSolutionID, v->Quality, v->NumLayers); 810 #endif 811 for (l = 0; l < v->NumLayers; ++l) { 836 812 G_IONO_HEIGHT(v->Layers[l].Height) 837 813 G_IONO_DEGREE(v->Layers[l].Degree) 838 814 G_IONO_ORDER(v->Layers[l].Order) 839 for(o = 0; o <= v->Layers[l].Order; ++o) 840 { 841 for(d = o; d <= v->Layers[l].Degree; ++d) 842 { 815 #ifdef BNC_DEBUG 816 fprintf(stderr, "h %8.3f deg %d ord %d \n", 817 v->Layers[l].Height, v->Layers[l].Degree, v->Layers[l].Order); 818 #endif 819 for (o = 0; o <= v->Layers[l].Order; ++o) { 820 for (d = o; d <= v->Layers[l].Degree; ++d) { 843 821 G_IONO_COEFF(v->Layers[l].Cosinus[d][o]) 822 #ifdef BNC_DEBUG 823 fprintf(stderr, "C[%02d][%02d] %8.3f \n", 824 d, o, v->Layers[l].Cosinus[d][o]); 825 #endif 844 826 } 845 827 } 846 for(o = 1; o <= v->Layers[l].Order; ++o) 847 { 848 for(d = o; d <= v->Layers[l].Degree; ++d) 849 { 828 for (o = 1; o <= v->Layers[l].Order; ++o) { 829 for (d = o; d <= v->Layers[l].Degree; ++d) { 850 830 G_IONO_COEFF(v->Layers[l].Sinus[d][o]) 831 #ifdef BNC_DEBUG 832 fprintf(stderr, "S[%02d][%02d] %8.3f \n", 833 d, o, v->Layers[l].Sinus[d][o]); 834 #endif 851 835 } 852 836 } 853 837 } 854 #ifdef DEBUG855 for(type = 0; type < ( int)size && (unsigned char)buffer[type] != 0xD3; ++type)856 838 #ifdef BNC_DEBUG 839 for(type = 0; type < (unsigned int)size && (unsigned char)buffer[type] != 0xD3; ++type) 840 numbits += 8; 857 841 fprintf(stderr, "numbits left %d\n",numbits); 858 842 #endif 859 843 return mmi ? GCOBR_MESSAGEFOLLOWS : GCOBR_OK; 860 844 } 861 for(s = CLOCKORBIT_SATNUM; s-- > 0;) 862 { 863 if(type == PBTYPE_BASE+s) 864 { 865 if(!pb) return GCOBR_NOPHASEBIASPARAMETER; 845 for (s = CLOCKORBIT_SATNUM; s-- > 0;) { 846 if (type == PBTYPE_BASE + s) { 847 if (!pb) 848 return GCOBR_NOPHASEBIASPARAMETER; 866 849 pb->messageType = type; 867 switch(s) 868 { 869 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 870 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 871 case CLOCKORBIT_SATBDS: 872 G_GPS_EPOCH_TIME(pb->EpochTime[s], pb->NumberOfSat[s]) 873 break; 874 case CLOCKORBIT_SATGLONASS: 875 G_GLONASS_EPOCH_TIME(pb->EpochTime[s], pb->NumberOfSat[s]) 876 break; 850 switch (s) { 851 case CLOCKORBIT_SATGPS: 852 case CLOCKORBIT_SATGALILEO: 853 case CLOCKORBIT_SATQZSS: 854 case CLOCKORBIT_SATSBAS: 855 case CLOCKORBIT_SATBDS: 856 G_GPS_EPOCH_TIME(pb->EpochTime[s], pb->NumberOfSat[s]) 857 break; 858 case CLOCKORBIT_SATGLONASS: 859 G_GLONASS_EPOCH_TIME(pb->EpochTime[s], pb->NumberOfSat[s]) 860 break; 877 861 } 878 862 G_SSR_UPDATE_INTERVAL(pb->UpdateInterval) … … 884 868 G_MW_CONSISTENCY_INDICATOR(pb->MWConsistencyIndicator) 885 869 G_NO_OF_SATELLITES(nums) 886 for(i = 0; i < nums; ++i) 887 { 888 switch(s) 889 { 890 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 891 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 892 G_GPS_SATELLITE_ID(id) 893 break; 894 case CLOCKORBIT_SATQZSS: 895 G_QZSS_SATELLITE_ID(id) 896 break; 897 case CLOCKORBIT_SATGLONASS: 898 G_GLONASS_SATELLITE_ID(id) 899 break; 870 #ifdef BNC_DEBUG 871 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d dispInd %d mwInd %d\n", 872 pb->EpochTime[s], pb->UpdateInterval,mmi,pb->NumberOfSat[s],nums, 873 pb->SSRIOD, pb->SSRProviderID, pb->SSRSolutionID, 874 pb->DispersiveBiasConsistencyIndicator, pb->MWConsistencyIndicator); 875 #endif 876 for (i = 0; i < nums; ++i) { 877 switch (s) { 878 case CLOCKORBIT_SATGPS: 879 case CLOCKORBIT_SATGALILEO: 880 case CLOCKORBIT_SATSBAS: 881 case CLOCKORBIT_SATBDS: 882 G_GPS_SATELLITE_ID(id) 883 break; 884 case CLOCKORBIT_SATQZSS: 885 G_QZSS_SATELLITE_ID(id) 886 break; 887 case CLOCKORBIT_SATGLONASS: 888 G_GLONASS_SATELLITE_ID(id) 889 break; 900 890 } 901 for(pos = satoffset[s]; pos < satoffset[s]+pb->NumberOfSat[s] && pb->Sat[pos].ID != id; ++pos) 891 for (pos = satoffset[s]; 892 pos < satoffset[s] + pb->NumberOfSat[s] && pb->Sat[pos].ID != id; 893 ++pos) 902 894 ; 903 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 904 else if(pos == pb->NumberOfSat[s] + satoffset[s]) ++pb->NumberOfSat[s]; 895 if (pos >= satoffset[s + 1]) 896 return GCOBR_DATAMISMATCH; 897 else if (pos == pb->NumberOfSat[s] + satoffset[s]) 898 ++pb->NumberOfSat[s]; 905 899 pb->Sat[pos].ID = id; 906 907 900 G_NO_OF_PHASE_BIASES(pb->Sat[pos].NumberOfPhaseBiases) 908 901 G_YAW_ANGLE(pb->Sat[pos].YawAngle) 909 902 G_YAW_RATE(pb->Sat[pos].YawRate) 910 for(j = 0; j < pb->Sat[pos].NumberOfPhaseBiases; ++j) 911 { 903 #ifdef BNC_DEBUG 904 fprintf(stderr, "id %2d #%d y %10.6f yr %10.6f ", 905 pb->Sat[pos].ID, pb->Sat[pos].NumberOfPhaseBiases, 906 pb->Sat[pos].YawAngle/MPI, pb->Sat[pos].YawRate/MPI); 907 #endif 908 for (j = 0; j < pb->Sat[pos].NumberOfPhaseBiases; ++j) { 912 909 G_SIGNAL_IDENTIFIER(pb->Sat[pos].Biases[j].Type) 913 910 G_INTEGER_INDICATOR(pb->Sat[pos].Biases[j].SignalIntegerIndicator) 914 G_WIDE_LANE_INDICATOR(pb->Sat[pos].Biases[j].SignalsWideLaneIntegerIndicator) 915 G_DISCONTINUITY_COUNTER(pb->Sat[pos].Biases[j].SignalDiscontinuityCounter) 911 G_WIDE_LANE_INDICATOR( 912 pb->Sat[pos].Biases[j].SignalsWideLaneIntegerIndicator) 913 G_DISCONTINUITY_COUNTER( 914 pb->Sat[pos].Biases[j].SignalDiscontinuityCounter) 916 915 G_PHASE_BIAS(pb->Sat[pos].Biases[j].Bias) 916 #ifdef BNC_DEBUG 917 fprintf(stderr, "t%02d int %d wl %d disc %d b %8.4f ", 918 pb->Sat[pos].Biases[j].Type, 919 pb->Sat[pos].Biases[j].SignalIntegerIndicator, 920 pb->Sat[pos].Biases[j].SignalsWideLaneIntegerIndicator, 921 pb->Sat[pos].Biases[j].SignalDiscontinuityCounter, 922 pb->Sat[pos].Biases[j].Bias); 923 #endif 917 924 } 918 } 919 #ifdef DEBUG 920 for(type = 0; type < (int)size && (unsigned char)buffer[type] != 0xD3; ++type) 921 numbits += 8; 925 #ifdef BNC_DEBUG 926 fprintf(stderr, "\n"); 927 #endif 928 } 929 #ifdef BNC_DEBUG 930 for(type = 0; type < (unsigned int)size && (unsigned char)buffer[type] != 0xD3; ++type) 931 numbits += 8; 922 932 fprintf(stderr, "numbits left %d\n",numbits); 923 933 #endif 924 934 return mmi ? GCOBR_MESSAGEFOLLOWS : GCOBR_OK; 925 935 } 926 else if(type >= corbase[s]) 927 { 928 switch(type-corbase[s]) 929 { 930 case COBOFS_ORBIT: 931 if(!co) return GCOBR_NOCLOCKORBITPARAMETER; 932 co->messageType = type; 933 switch(s) 934 { 935 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 936 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 937 case CLOCKORBIT_SATBDS: 938 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 939 break; 940 case CLOCKORBIT_SATGLONASS: 941 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 942 break; 943 } 944 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 945 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 946 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 947 G_SSR_IOD(co->SSRIOD) 948 G_SSR_PROVIDER_ID(co->SSRProviderID) 949 G_SSR_SOLUTION_ID(co->SSRSolutionID) 950 G_NO_OF_SATELLITES(nums) 951 co->Supplied[COBOFS_ORBIT] |= 1; 952 #ifdef DEBUG 953 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d rd %d\n",co->EpochTime[s], 954 co->UpdateInterval,mmi,co->NumberOfSat[s],nums, co->SatRefDatum); 955 #endif 956 for(i = 0; i < nums; ++i) 957 { 958 switch(s) 959 { 960 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 961 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 962 G_GPS_SATELLITE_ID(id) 963 break; 964 case CLOCKORBIT_SATQZSS: 965 G_QZSS_SATELLITE_ID(id) 966 break; 967 case CLOCKORBIT_SATGLONASS: 968 G_GLONASS_SATELLITE_ID(id) 969 break; 936 else if (type >= corbase[s]) { 937 switch (type - corbase[s]) { 938 case COBOFS_ORBIT: 939 if (!co) 940 return GCOBR_NOCLOCKORBITPARAMETER; 941 co->messageType = type; 942 switch (s) { 943 case CLOCKORBIT_SATGPS: 944 case CLOCKORBIT_SATGALILEO: 945 case CLOCKORBIT_SATQZSS: 946 case CLOCKORBIT_SATSBAS: 947 case CLOCKORBIT_SATBDS: 948 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 949 break; 950 case CLOCKORBIT_SATGLONASS: 951 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 952 break; 970 953 } 971 for(pos = satoffset[s]; pos < satoffset[s]+co->NumberOfSat[s] && co->Sat[pos].ID != id; ++pos) 972 ; 973 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 974 else if(pos == co->NumberOfSat[s] + satoffset[s]) ++co->NumberOfSat[s]; 975 co->Sat[pos].ID = id; 976 977 switch(s) 978 { 979 case CLOCKORBIT_SATGPS: 980 case CLOCKORBIT_SATQZSS: 981 G_GPS_IODE(co->Sat[pos].IOD) 982 break; 983 case CLOCKORBIT_SATGLONASS: 984 G_GLONASS_IOD(co->Sat[pos].IOD) 985 break; 986 case CLOCKORBIT_SATGALILEO: 987 G_GALILEO_IOD(co->Sat[pos].IOD) 988 break; 989 case CLOCKORBIT_SATSBAS: 990 G_SBAS_T0MOD(co->Sat[pos].toe) 991 G_SBAS_IODCRC(co->Sat[pos].IOD) 992 break; 993 case CLOCKORBIT_SATBDS: 994 G_BDS_TOEMOD(co->Sat[pos].toe) 995 G_BDS_IOD(co->Sat[pos].IOD) 996 break; 954 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 955 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 956 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 957 G_SSR_IOD(co->SSRIOD) 958 G_SSR_PROVIDER_ID(co->SSRProviderID) 959 G_SSR_SOLUTION_ID(co->SSRSolutionID) 960 G_NO_OF_SATELLITES(nums) 961 co->Supplied[COBOFS_ORBIT] |= 1; 962 #ifdef BNC_DEBUG 963 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d rd %d ssrIod %d providerId %d solId %d\n", 964 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums, 965 co->SatRefDatum, co->SSRIOD, co->SSRProviderID, co->SSRSolutionID); 966 #endif 967 for (i = 0; i < nums; ++i) { 968 switch (s) { 969 case CLOCKORBIT_SATGPS: 970 case CLOCKORBIT_SATGALILEO: 971 case CLOCKORBIT_SATSBAS: 972 case CLOCKORBIT_SATBDS: 973 G_GPS_SATELLITE_ID(id) 974 break; 975 case CLOCKORBIT_SATQZSS: 976 G_QZSS_SATELLITE_ID(id) 977 break; 978 case CLOCKORBIT_SATGLONASS: 979 G_GLONASS_SATELLITE_ID(id) 980 break; 981 } 982 for (pos = satoffset[s]; 983 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id; 984 ++pos) 985 ; 986 if (pos >= satoffset[s + 1]) 987 return GCOBR_DATAMISMATCH; 988 else if (pos == co->NumberOfSat[s] + satoffset[s]) 989 ++co->NumberOfSat[s]; 990 co->Sat[pos].ID = id; 991 992 switch (s) { 993 case CLOCKORBIT_SATGPS: 994 case CLOCKORBIT_SATQZSS: 995 G_GPS_IODE(co->Sat[pos].IOD) 996 break; 997 case CLOCKORBIT_SATGLONASS: 998 G_GLONASS_IOD(co->Sat[pos].IOD) 999 break; 1000 case CLOCKORBIT_SATGALILEO: 1001 G_GALILEO_IOD(co->Sat[pos].IOD) 1002 break; 1003 case CLOCKORBIT_SATSBAS: 1004 G_SBAS_T0MOD(co->Sat[pos].toe) 1005 G_SBAS_IODCRC(co->Sat[pos].IOD) 1006 break; 1007 case CLOCKORBIT_SATBDS: 1008 G_BDS_TOEMOD(co->Sat[pos].toe) 1009 G_BDS_IOD(co->Sat[pos].IOD) 1010 break; 1011 } 1012 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial) 1013 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack) 1014 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack) 1015 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial) 1016 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack) 1017 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack) 1018 #ifdef BNC_DEBUG 1019 fprintf(stderr, "id %2d iod %3d dr %8.4f da %8.4f dc %8.4f dr %8.3f da %8.3f dc %8.3f\n", 1020 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial, 1021 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack, 1022 co->Sat[pos].Orbit.DotDeltaRadial, 1023 co->Sat[pos].Orbit.DotDeltaAlongTrack, 1024 co->Sat[pos].Orbit.DotDeltaCrossTrack); 1025 #endif 997 1026 } 998 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial) 999 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack) 1000 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack) 1001 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial) 1002 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack) 1003 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack) 1004 #ifdef DEBUG 1005 fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f\n", 1006 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial, 1007 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack, 1008 co->Sat[pos].Orbit.DotDeltaRadial, 1009 co->Sat[pos].Orbit.DotDeltaAlongTrack, 1010 co->Sat[pos].Orbit.DotDeltaCrossTrack); 1011 #endif 1012 } 1013 break; 1014 case COBOFS_CLOCK: 1015 if(!co) return GCOBR_NOCLOCKORBITPARAMETER; 1016 co->messageType = type; 1017 switch(s) 1018 { 1019 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1020 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 1021 case CLOCKORBIT_SATBDS: 1022 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1023 break; 1024 case CLOCKORBIT_SATGLONASS: 1025 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1026 break; 1027 } 1028 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1029 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1030 G_SSR_IOD(co->SSRIOD) 1031 G_SSR_PROVIDER_ID(co->SSRProviderID) 1032 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1033 G_NO_OF_SATELLITES(nums) 1034 co->Supplied[COBOFS_CLOCK] |= 1; 1035 #ifdef DEBUG 1036 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d\n",co->EpochTime[s], 1037 co->UpdateInterval,mmi,co->NumberOfSat[s],nums); 1038 #endif 1039 for(i = 0; i < nums; ++i) 1040 { 1041 switch(s) 1042 { 1043 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1044 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 1045 G_GPS_SATELLITE_ID(id) 1046 break; 1047 case CLOCKORBIT_SATQZSS: 1048 G_QZSS_SATELLITE_ID(id) 1049 break; 1050 case CLOCKORBIT_SATGLONASS: 1051 G_GLONASS_SATELLITE_ID(id) 1052 break; 1027 break; 1028 case COBOFS_CLOCK: 1029 if (!co) 1030 return GCOBR_NOCLOCKORBITPARAMETER; 1031 co->messageType = type; 1032 switch (s) { 1033 case CLOCKORBIT_SATGPS: 1034 case CLOCKORBIT_SATGALILEO: 1035 case CLOCKORBIT_SATQZSS: 1036 case CLOCKORBIT_SATSBAS: 1037 case CLOCKORBIT_SATBDS: 1038 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1039 break; 1040 case CLOCKORBIT_SATGLONASS: 1041 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1042 break; 1053 1043 } 1054 for(pos = satoffset[s]; pos < satoffset[s]+co->NumberOfSat[s] && co->Sat[pos].ID != id; ++pos) 1055 ; 1056 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 1057 else if(pos == co->NumberOfSat[s] + satoffset[s]) ++co->NumberOfSat[s]; 1058 co->Sat[pos].ID = id; 1059 1060 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0) 1061 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 1062 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 1063 #ifdef DEBUG 1064 fprintf(stderr, "id %2d c0 %8.3f c1 %8.3f c2 %8.3f\n", 1065 co->Sat[pos].ID, co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, 1066 co->Sat[pos].Clock.DeltaA2); 1067 #endif 1068 } 1069 break; 1070 case COBOFS_COMBINED: 1071 if(!co) return GCOBR_NOCLOCKORBITPARAMETER; 1072 co->messageType = type; 1073 switch(s) 1074 { 1075 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1076 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 1077 case CLOCKORBIT_SATBDS: 1078 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1079 break; 1080 case CLOCKORBIT_SATGLONASS: 1081 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1082 break; 1083 } 1084 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1085 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1086 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 1087 G_SSR_IOD(co->SSRIOD) 1088 G_SSR_PROVIDER_ID(co->SSRProviderID) 1089 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1090 G_NO_OF_SATELLITES(nums) 1091 co->Supplied[COBOFS_ORBIT] |= 1; 1092 co->Supplied[COBOFS_CLOCK] |= 1; 1093 for(i = 0; i < nums; ++i) 1094 { 1095 switch(s) 1096 { 1097 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1098 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 1099 G_GPS_SATELLITE_ID(id) 1100 break; 1101 case CLOCKORBIT_SATQZSS: 1102 G_QZSS_SATELLITE_ID(id) 1103 break; 1104 case CLOCKORBIT_SATGLONASS: 1105 G_GLONASS_SATELLITE_ID(id) 1106 break; 1044 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1045 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1046 G_SSR_IOD(co->SSRIOD) 1047 G_SSR_PROVIDER_ID(co->SSRProviderID) 1048 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1049 G_NO_OF_SATELLITES(nums) 1050 co->Supplied[COBOFS_CLOCK] |= 1; 1051 #ifdef BNC_DEBUG 1052 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n", 1053 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums, 1054 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID); 1055 #endif 1056 for (i = 0; i < nums; ++i) { 1057 switch (s) { 1058 case CLOCKORBIT_SATGPS: 1059 case CLOCKORBIT_SATGALILEO: 1060 case CLOCKORBIT_SATSBAS: 1061 case CLOCKORBIT_SATBDS: 1062 G_GPS_SATELLITE_ID(id) 1063 break; 1064 case CLOCKORBIT_SATQZSS: 1065 G_QZSS_SATELLITE_ID(id) 1066 break; 1067 case CLOCKORBIT_SATGLONASS: 1068 G_GLONASS_SATELLITE_ID(id) 1069 break; 1070 } 1071 for (pos = satoffset[s]; 1072 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id; 1073 ++pos) 1074 ; 1075 if (pos >= satoffset[s + 1]) 1076 return GCOBR_DATAMISMATCH; 1077 else if (pos == co->NumberOfSat[s] + satoffset[s]) 1078 ++co->NumberOfSat[s]; 1079 co->Sat[pos].ID = id; 1080 1081 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0) 1082 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 1083 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 1084 #ifdef BNC_DEBUG 1085 fprintf(stderr, "id %2d c0 %8.3f c1 %8.3f c2 %8.3f\n", 1086 co->Sat[pos].ID, co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, 1087 co->Sat[pos].Clock.DeltaA2); 1088 #endif 1107 1089 } 1108 for(pos = satoffset[s]; pos < satoffset[s]+co->NumberOfSat[s] && co->Sat[pos].ID != id; ++pos) 1109 ; 1110 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 1111 else if(pos == co->NumberOfSat[s] + satoffset[s]) ++co->NumberOfSat[s]; 1112 co->Sat[pos].ID = id; 1113 1114 switch(s) 1115 { 1116 case CLOCKORBIT_SATGPS: 1117 case CLOCKORBIT_SATQZSS: 1118 G_GPS_IODE(co->Sat[pos].IOD) 1119 break; 1120 case CLOCKORBIT_SATGLONASS: 1121 G_GLONASS_IOD(co->Sat[pos].IOD) 1122 break; 1123 case CLOCKORBIT_SATGALILEO: 1124 G_GALILEO_IOD(co->Sat[pos].IOD) 1125 break; 1126 case CLOCKORBIT_SATSBAS: 1127 G_SBAS_T0MOD(co->Sat[pos].toe) 1128 G_SBAS_IODCRC(co->Sat[pos].IOD) 1129 break; 1130 case CLOCKORBIT_SATBDS: 1131 G_BDS_TOEMOD(co->Sat[pos].toe) 1132 G_BDS_IOD(co->Sat[pos].IOD) 1133 break; 1090 break; 1091 case COBOFS_COMBINED: 1092 if (!co) 1093 return GCOBR_NOCLOCKORBITPARAMETER; 1094 co->messageType = type; 1095 switch (s) { 1096 case CLOCKORBIT_SATGPS: 1097 case CLOCKORBIT_SATGALILEO: 1098 case CLOCKORBIT_SATQZSS: 1099 case CLOCKORBIT_SATSBAS: 1100 case CLOCKORBIT_SATBDS: 1101 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1102 break; 1103 case CLOCKORBIT_SATGLONASS: 1104 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1105 break; 1134 1106 } 1135 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial) 1136 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack) 1137 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack) 1138 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial) 1139 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack) 1140 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack) 1141 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0) 1142 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 1143 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 1144 } 1145 break; 1146 case COBOFS_URA: 1147 if(!co) return GCOBR_NOCLOCKORBITPARAMETER; 1148 co->messageType = type; 1149 switch(s) 1150 { 1151 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1152 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 1153 case CLOCKORBIT_SATBDS: 1154 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1155 break; 1156 case CLOCKORBIT_SATGLONASS: 1157 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1158 break; 1159 } 1160 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1161 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1162 G_SSR_IOD(co->SSRIOD) 1163 G_SSR_PROVIDER_ID(co->SSRProviderID) 1164 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1165 G_NO_OF_SATELLITES(nums) 1166 co->Supplied[COBOFS_URA] |= 1; 1167 for(i = 0; i < nums; ++i) 1168 { 1169 switch(s) 1170 { 1171 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1172 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 1173 G_GPS_SATELLITE_ID(id) 1174 break; 1175 case CLOCKORBIT_SATQZSS: 1176 G_QZSS_SATELLITE_ID(id) 1177 break; 1178 case CLOCKORBIT_SATGLONASS: 1179 G_GLONASS_SATELLITE_ID(id) 1180 break; 1107 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1108 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1109 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 1110 G_SSR_IOD(co->SSRIOD) 1111 G_SSR_PROVIDER_ID(co->SSRProviderID) 1112 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1113 G_NO_OF_SATELLITES(nums) 1114 co->Supplied[COBOFS_ORBIT] |= 1; 1115 co->Supplied[COBOFS_CLOCK] |= 1; 1116 #ifdef BNC_DEBUG 1117 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d rd %d ssrIod %d providerId %d solId %d\n", 1118 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums, 1119 co->SatRefDatum, co->SSRIOD, co->SSRProviderID, co->SSRSolutionID); 1120 #endif 1121 for (i = 0; i < nums; ++i) { 1122 switch (s) { 1123 case CLOCKORBIT_SATGPS: 1124 case CLOCKORBIT_SATGALILEO: 1125 case CLOCKORBIT_SATSBAS: 1126 case CLOCKORBIT_SATBDS: 1127 G_GPS_SATELLITE_ID(id) 1128 break; 1129 case CLOCKORBIT_SATQZSS: 1130 G_QZSS_SATELLITE_ID(id) 1131 break; 1132 case CLOCKORBIT_SATGLONASS: 1133 G_GLONASS_SATELLITE_ID(id) 1134 break; 1135 } 1136 for (pos = satoffset[s]; 1137 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id; 1138 ++pos) 1139 ; 1140 if (pos >= satoffset[s + 1]) 1141 return GCOBR_DATAMISMATCH; 1142 else if (pos == co->NumberOfSat[s] + satoffset[s]) 1143 ++co->NumberOfSat[s]; 1144 co->Sat[pos].ID = id; 1145 1146 switch (s) { 1147 case CLOCKORBIT_SATGPS: 1148 case CLOCKORBIT_SATQZSS: 1149 G_GPS_IODE(co->Sat[pos].IOD) 1150 break; 1151 case CLOCKORBIT_SATGLONASS: 1152 G_GLONASS_IOD(co->Sat[pos].IOD) 1153 break; 1154 case CLOCKORBIT_SATGALILEO: 1155 G_GALILEO_IOD(co->Sat[pos].IOD) 1156 break; 1157 case CLOCKORBIT_SATSBAS: 1158 G_SBAS_T0MOD(co->Sat[pos].toe) 1159 G_SBAS_IODCRC(co->Sat[pos].IOD) 1160 break; 1161 case CLOCKORBIT_SATBDS: 1162 G_BDS_TOEMOD(co->Sat[pos].toe) 1163 G_BDS_IOD(co->Sat[pos].IOD) 1164 break; 1165 } 1166 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial) 1167 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack) 1168 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack) 1169 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial) 1170 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack) 1171 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack) 1172 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0) 1173 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 1174 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 1175 #ifdef BNC_DEBUG 1176 fprintf(stderr, "id %2d iod %3d dr %10.6f da %10.6f dc %10.6f dr %10.6f da %10.6f dc %10.6f c0 %10.6f c1 %10.6f c2 %10.6f\n", 1177 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial, 1178 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack, 1179 co->Sat[pos].Orbit.DotDeltaRadial, co->Sat[pos].Orbit.DotDeltaAlongTrack, 1180 co->Sat[pos].Orbit.DotDeltaCrossTrack, 1181 co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, co->Sat[pos].Clock.DeltaA2); 1182 #endif 1181 1183 } 1182 for(pos = satoffset[s]; pos < satoffset[s]+co->NumberOfSat[s] && co->Sat[pos].ID != id; ++pos) 1183 ; 1184 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 1185 else if(pos == co->NumberOfSat[s] + satoffset[s]) ++co->NumberOfSat[s]; 1186 co->Sat[pos].ID = id; 1187 1188 G_SSR_URA(co->Sat[pos].UserRangeAccuracy) 1189 } 1190 break; 1191 case COBOFS_HR: 1192 if(!co) return GCOBR_NOCLOCKORBITPARAMETER; 1193 co->messageType = type; 1194 switch(s) 1195 { 1196 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1197 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 1198 case CLOCKORBIT_SATBDS: 1199 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1200 break; 1201 case CLOCKORBIT_SATGLONASS: 1202 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1203 break; 1204 } 1205 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1206 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1207 G_SSR_IOD(co->SSRIOD) 1208 G_SSR_PROVIDER_ID(co->SSRProviderID) 1209 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1210 G_NO_OF_SATELLITES(nums) 1211 co->Supplied[COBOFS_HR] |= 1; 1212 for(i = 0; i < nums; ++i) 1213 { 1214 switch(s) 1215 { 1216 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1217 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 1218 G_GPS_SATELLITE_ID(id) 1219 break; 1220 case CLOCKORBIT_SATQZSS: 1221 G_QZSS_SATELLITE_ID(id) 1222 break; 1223 case CLOCKORBIT_SATGLONASS: 1224 G_GLONASS_SATELLITE_ID(id) 1225 break; 1184 break; 1185 case COBOFS_URA: 1186 if (!co) 1187 return GCOBR_NOCLOCKORBITPARAMETER; 1188 co->messageType = type; 1189 switch (s) { 1190 case CLOCKORBIT_SATGPS: 1191 case CLOCKORBIT_SATGALILEO: 1192 case CLOCKORBIT_SATQZSS: 1193 case CLOCKORBIT_SATSBAS: 1194 case CLOCKORBIT_SATBDS: 1195 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1196 break; 1197 case CLOCKORBIT_SATGLONASS: 1198 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1199 break; 1226 1200 } 1227 for(pos = satoffset[s]; pos < satoffset[s]+co->NumberOfSat[s] && co->Sat[pos].ID != id; ++pos) 1228 ; 1229 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 1230 else if(pos == co->NumberOfSat[s] + satoffset[s]) ++co->NumberOfSat[s]; 1231 co->Sat[pos].ID = id; 1232 1233 G_HR_CLOCK_CORRECTION(co->Sat[pos].hrclock) 1234 } 1235 break; 1236 case COBOFS_BIAS: 1237 if(!b) return GCOBR_NOCODEBIASPARAMETER; 1238 b->messageType = type; 1239 switch(s) 1240 { 1241 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1242 case CLOCKORBIT_SATQZSS: case CLOCKORBIT_SATSBAS: 1243 case CLOCKORBIT_SATBDS: 1244 G_GPS_EPOCH_TIME(b->EpochTime[s], b->NumberOfSat[s]) 1245 break; 1246 case CLOCKORBIT_SATGLONASS: 1247 G_GLONASS_EPOCH_TIME(b->EpochTime[s], b->NumberOfSat[s]) 1248 break; 1249 } 1250 G_SSR_UPDATE_INTERVAL(b->UpdateInterval) 1251 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1252 G_SSR_IOD(b->SSRIOD) 1253 G_SSR_PROVIDER_ID(b->SSRProviderID) 1254 G_SSR_SOLUTION_ID(b->SSRSolutionID) 1255 G_NO_OF_SATELLITES(nums) 1256 for(i = 0; i < nums; ++i) 1257 { 1258 switch(s) 1259 { 1260 case CLOCKORBIT_SATGPS: case CLOCKORBIT_SATGALILEO: 1261 case CLOCKORBIT_SATSBAS: case CLOCKORBIT_SATBDS: 1262 G_GPS_SATELLITE_ID(id) 1263 break; 1264 case CLOCKORBIT_SATQZSS: 1265 G_QZSS_SATELLITE_ID(id) 1266 break; 1267 case CLOCKORBIT_SATGLONASS: 1268 G_GLONASS_SATELLITE_ID(id) 1269 break; 1201 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1202 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1203 G_SSR_IOD(co->SSRIOD) 1204 G_SSR_PROVIDER_ID(co->SSRProviderID) 1205 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1206 G_NO_OF_SATELLITES(nums) 1207 co->Supplied[COBOFS_URA] |= 1; 1208 #ifdef BNC_DEBUG 1209 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n", 1210 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums, 1211 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID); 1212 #endif 1213 for (i = 0; i < nums; ++i) { 1214 switch (s) { 1215 case CLOCKORBIT_SATGPS: 1216 case CLOCKORBIT_SATGALILEO: 1217 case CLOCKORBIT_SATSBAS: 1218 case CLOCKORBIT_SATBDS: 1219 G_GPS_SATELLITE_ID(id) 1220 break; 1221 case CLOCKORBIT_SATQZSS: 1222 G_QZSS_SATELLITE_ID(id) 1223 break; 1224 case CLOCKORBIT_SATGLONASS: 1225 G_GLONASS_SATELLITE_ID(id) 1226 break; 1227 } 1228 for (pos = satoffset[s]; 1229 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id; 1230 ++pos) 1231 ; 1232 if (pos >= satoffset[s + 1]) 1233 return GCOBR_DATAMISMATCH; 1234 else if (pos == co->NumberOfSat[s] + satoffset[s]) 1235 ++co->NumberOfSat[s]; 1236 co->Sat[pos].ID = id; 1237 G_SSR_URA(co->Sat[pos].UserRangeAccuracy) 1238 #ifdef BNC_DEBUG 1239 fprintf(stderr, "id %2d ura %8.3f \n", 1240 co->Sat[pos].ID, co->Sat[pos].UserRangeAccuracy); 1241 #endif 1270 1242 } 1271 for(pos = satoffset[s]; pos < satoffset[s]+b->NumberOfSat[s] && b->Sat[pos].ID != id; ++pos) 1272 ; 1273 if(pos >= satoffset[s+1]) return GCOBR_DATAMISMATCH; 1274 else if(pos == b->NumberOfSat[s] + satoffset[s]) ++b->NumberOfSat[s]; 1275 b->Sat[pos].ID = id; 1276 1277 G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases) 1278 for(j = 0; j < b->Sat[pos].NumberOfCodeBiases; ++j) 1279 { 1280 G_SIGNAL_IDENTIFIER(b->Sat[pos].Biases[j].Type) 1281 G_CODE_BIAS(b->Sat[pos].Biases[j].Bias) 1243 break; 1244 case COBOFS_HR: 1245 if (!co) 1246 return GCOBR_NOCLOCKORBITPARAMETER; 1247 co->messageType = type; 1248 switch (s) { 1249 case CLOCKORBIT_SATGPS: 1250 case CLOCKORBIT_SATGALILEO: 1251 case CLOCKORBIT_SATQZSS: 1252 case CLOCKORBIT_SATSBAS: 1253 case CLOCKORBIT_SATBDS: 1254 G_GPS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1255 break; 1256 case CLOCKORBIT_SATGLONASS: 1257 G_GLONASS_EPOCH_TIME(co->EpochTime[s], co->NumberOfSat[s]) 1258 break; 1282 1259 } 1283 } 1284 break; 1285 default: 1286 continue; 1287 } 1288 #ifdef COR_LATENCY 1289 if(s == CLOCKORBIT_SATGPS && type-corbase[s] != COBOFS_BIAS) 1290 { 1291 co->epochGPS[co->epochSize] = co->EpochTime[s]; 1292 if(co->epochSize < COR_LATENCYCOUNT) 1293 ++co->epochSize; 1294 } 1295 #endif 1296 #ifdef DEBUG 1297 for(type = 0; type < (int)size && (unsigned char)buffer[type] != 0xD3; ++type) 1298 numbits += 8; 1260 G_SSR_UPDATE_INTERVAL(co->UpdateInterval) 1261 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1262 G_SSR_IOD(co->SSRIOD) 1263 G_SSR_PROVIDER_ID(co->SSRProviderID) 1264 G_SSR_SOLUTION_ID(co->SSRSolutionID) 1265 G_NO_OF_SATELLITES(nums) 1266 co->Supplied[COBOFS_HR] |= 1; 1267 #ifdef BNC_DEBUG 1268 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n", 1269 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums, 1270 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID); 1271 #endif 1272 for (i = 0; i < nums; ++i) { 1273 switch (s) { 1274 case CLOCKORBIT_SATGPS: 1275 case CLOCKORBIT_SATGALILEO: 1276 case CLOCKORBIT_SATSBAS: 1277 case CLOCKORBIT_SATBDS: 1278 G_GPS_SATELLITE_ID(id) 1279 break; 1280 case CLOCKORBIT_SATQZSS: 1281 G_QZSS_SATELLITE_ID(id) 1282 break; 1283 case CLOCKORBIT_SATGLONASS: 1284 G_GLONASS_SATELLITE_ID(id) 1285 break; 1286 } 1287 for (pos = satoffset[s]; 1288 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id; 1289 ++pos) 1290 ; 1291 if (pos >= satoffset[s + 1]) 1292 return GCOBR_DATAMISMATCH; 1293 else if (pos == co->NumberOfSat[s] + satoffset[s]) 1294 ++co->NumberOfSat[s]; 1295 co->Sat[pos].ID = id; 1296 G_HR_CLOCK_CORRECTION(co->Sat[pos].hrclock) 1297 #ifdef BNC_DEBUG 1298 fprintf(stderr, "id %2d hrClock %8.3f \n", 1299 co->Sat[pos].ID, co->Sat[pos].hrclock); 1300 #endif 1301 } 1302 break; 1303 case COBOFS_CBIAS: 1304 if (!b) 1305 return GCOBR_NOCODEBIASPARAMETER; 1306 b->messageType = type; 1307 switch (s) { 1308 case CLOCKORBIT_SATGPS: 1309 case CLOCKORBIT_SATGALILEO: 1310 case CLOCKORBIT_SATQZSS: 1311 case CLOCKORBIT_SATSBAS: 1312 case CLOCKORBIT_SATBDS: 1313 G_GPS_EPOCH_TIME(b->EpochTime[s], b->NumberOfSat[s]) 1314 break; 1315 case CLOCKORBIT_SATGLONASS: 1316 G_GLONASS_EPOCH_TIME(b->EpochTime[s], b->NumberOfSat[s]) 1317 break; 1318 } 1319 G_SSR_UPDATE_INTERVAL(b->UpdateInterval) 1320 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 1321 G_SSR_IOD(b->SSRIOD) 1322 G_SSR_PROVIDER_ID(b->SSRProviderID) 1323 G_SSR_SOLUTION_ID(b->SSRSolutionID) 1324 G_NO_OF_SATELLITES(nums) 1325 #ifdef BNC_DEBUG 1326 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n", 1327 b->EpochTime[s], b->UpdateInterval,mmi,b->NumberOfSat[s],nums, 1328 b->SSRIOD, b->SSRProviderID, b->SSRSolutionID); 1329 #endif 1330 for (i = 0; i < nums; ++i) { 1331 switch (s) { 1332 case CLOCKORBIT_SATGPS: 1333 case CLOCKORBIT_SATGALILEO: 1334 case CLOCKORBIT_SATSBAS: 1335 case CLOCKORBIT_SATBDS: 1336 G_GPS_SATELLITE_ID(id) 1337 break; 1338 case CLOCKORBIT_SATQZSS: 1339 G_QZSS_SATELLITE_ID(id) 1340 break; 1341 case CLOCKORBIT_SATGLONASS: 1342 G_GLONASS_SATELLITE_ID(id) 1343 break; 1344 } 1345 for (pos = satoffset[s]; 1346 pos < satoffset[s] + b->NumberOfSat[s] && b->Sat[pos].ID != id; 1347 ++pos) 1348 ; 1349 if (pos >= satoffset[s + 1]) 1350 return GCOBR_DATAMISMATCH; 1351 else if (pos == b->NumberOfSat[s] + satoffset[s]) 1352 ++b->NumberOfSat[s]; 1353 b->Sat[pos].ID = id; 1354 G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases) 1355 #ifdef BNC_DEBUG 1356 fprintf(stderr, "id %2d #%d ", 1357 b->Sat[pos].ID, b->Sat[pos].NumberOfCodeBiases); 1358 #endif 1359 for (j = 0; j < b->Sat[pos].NumberOfCodeBiases; ++j) { 1360 G_SIGNAL_IDENTIFIER(b->Sat[pos].Biases[j].Type) 1361 G_CODE_BIAS(b->Sat[pos].Biases[j].Bias) 1362 #ifdef BNC_DEBUG 1363 fprintf(stderr, "t%02d b %8.2f ", 1364 b->Sat[pos].Biases[j].Type, b->Sat[pos].Biases[j].Bias); 1365 #endif 1366 } 1367 #ifdef BNC_DEBUG 1368 fprintf(stderr, "\n"); 1369 #endif 1370 } 1371 break; 1372 default: 1373 continue; 1374 } 1375 #ifdef BNC_DEBUG 1376 for(type = 0; type < (unsigned int)size && (unsigned char)buffer[type] != 0xD3; ++type) 1377 numbits += 8; 1299 1378 fprintf(stderr, "numbits left %d\n",numbits); 1300 1379 #endif -
branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h
r8943 r8987 13 13 #include <string.h> 14 14 15 enum SatelliteReferenceDatum { DATUM_ITRF=0, DATUM_LOCAL=1 }; 15 16 17 18 19 20 enum SatelliteReferenceDatum { 21 DATUM_ITRF = 0, 22 DATUM_LOCAL = 1 23 }; 16 24 17 25 enum COR_BASE { 18 COBBASE_GPS = 1057,26 COBBASE_GPS = 1057, 19 27 COBBASE_GLONASS = 1063, 20 28 COBBASE_GALILEO = 1240, 21 COBBASE_QZSS = 1246, 22 COBBASE_SBAS = 1252, 23 COBBASE_BDS = 1258, 29 COBBASE_QZSS = 1246, 30 COBBASE_SBAS = 1252, 31 COBBASE_BDS = 1258, 32 COBBASE_NUM 24 33 }; 25 34 … … 27 36 COBOFS_ORBIT = 0, 28 37 COBOFS_CLOCK, 29 COBOFS_ BIAS,38 COBOFS_CBIAS, 30 39 COBOFS_COMBINED, 31 40 COBOFS_URA, … … 35 44 36 45 enum ClockOrbitType { 37 COTYPE_GPSORBIT = COBBASE_GPS+ COBOFS_ORBIT,46 COTYPE_GPSORBIT = COBBASE_GPS + COBOFS_ORBIT, 38 47 COTYPE_GPSCLOCK, 39 COTYPE_GPSCOMBINED = COBBASE_GPS+ COBOFS_COMBINED,48 COTYPE_GPSCOMBINED = COBBASE_GPS + COBOFS_COMBINED, 40 49 COTYPE_GPSURA, 41 50 COTYPE_GPSHR, 42 51 43 COTYPE_GLONASSORBIT = COBBASE_GLONASS + COBOFS_ORBIT,52 COTYPE_GLONASSORBIT = COBBASE_GLONASS + COBOFS_ORBIT, 44 53 COTYPE_GLONASSCLOCK, 45 54 COTYPE_GLONASSCOMBINED = COBBASE_GLONASS + COBOFS_COMBINED, … … 47 56 COTYPE_GLONASSHR, 48 57 49 COTYPE_GALILEOORBIT = COBBASE_GALILEO + COBOFS_ORBIT,58 COTYPE_GALILEOORBIT = COBBASE_GALILEO + COBOFS_ORBIT, 50 59 COTYPE_GALILEOCLOCK, 51 60 COTYPE_GALILEOCOMBINED = COBBASE_GALILEO + COBOFS_COMBINED, … … 53 62 COTYPE_GALILEOHR, 54 63 55 COTYPE_QZSSORBIT = COBBASE_QZSS+ COBOFS_ORBIT,64 COTYPE_QZSSORBIT = COBBASE_QZSS + COBOFS_ORBIT, 56 65 COTYPE_QZSSCLOCK, 57 COTYPE_QZSSCOMBINED = COBBASE_QZSS+ COBOFS_COMBINED,66 COTYPE_QZSSCOMBINED = COBBASE_QZSS + COBOFS_COMBINED, 58 67 COTYPE_QZSSURA, 59 68 COTYPE_QZSSHR, 60 69 61 COTYPE_SBASORBIT = COBBASE_SBAS+ COBOFS_ORBIT,70 COTYPE_SBASORBIT = COBBASE_SBAS + COBOFS_ORBIT, 62 71 COTYPE_SBASCLOCK, 63 COTYPE_SBASCOMBINED = COBBASE_SBAS+ COBOFS_COMBINED,72 COTYPE_SBASCOMBINED = COBBASE_SBAS + COBOFS_COMBINED, 64 73 COTYPE_SBASURA, 65 74 COTYPE_SBASHR, 66 75 67 COTYPE_BDSORBIT = COBBASE_BDS+ COBOFS_ORBIT,76 COTYPE_BDSORBIT = COBBASE_BDS + COBOFS_ORBIT, 68 77 COTYPE_BDSCLOCK, 69 COTYPE_BDSCOMBINED = COBBASE_BDS + COBOFS_COMBINED,78 COTYPE_BDSCOMBINED = COBBASE_BDS + COBOFS_COMBINED, 70 79 COTYPE_BDSURA, 71 80 COTYPE_BDSHR, … … 75 84 76 85 enum CodeBiasType { 77 BTYPE_GPS = COBBASE_GPS + COBOFS_BIAS,78 BTYPE_GLONASS = COBBASE_GLONASS + COBOFS_BIAS,79 BTYPE_GALILEO = COBBASE_GALILEO + COBOFS_BIAS,80 BTYPE_QZSS = COBBASE_QZSS + COBOFS_BIAS,81 BTYPE_SBAS = COBBASE_SBAS + COBOFS_BIAS,82 BTYPE_BDS = COBBASE_BDS + COBOFS_BIAS,83 BTYPE_AUTO= 084 }; 85 86 enum PhaseBiasType 87 PBTYPE_BASE = 1265,88 PBTYPE_GPS = PBTYPE_BASE,86 CBTYPE_GPS = COBBASE_GPS + COBOFS_CBIAS, 87 CBTYPE_GLONASS = COBBASE_GLONASS + COBOFS_CBIAS, 88 CBTYPE_GALILEO = COBBASE_GALILEO + COBOFS_CBIAS, 89 CBTYPE_QZSS = COBBASE_QZSS + COBOFS_CBIAS, 90 CBTYPE_SBAS = COBBASE_SBAS + COBOFS_CBIAS, 91 CBTYPE_BDS = COBBASE_BDS + COBOFS_CBIAS, 92 CBTYPE_AUTO = 0 93 }; 94 95 enum PhaseBiasType{ 96 PBTYPE_BASE = 1265, 97 PBTYPE_GPS = PBTYPE_BASE, 89 98 PBTYPE_GLONASS, 90 99 PBTYPE_GALILEO, … … 92 101 PBTYPE_SBAS, 93 102 PBTYPE_BDS, 94 PBTYPE_AUTO = 0103 PBTYPE_AUTO = 0 95 104 }; 96 105 … … 102 111 for these systems to save space */ 103 112 enum COR_CONSTANTS { 104 CLOCKORBIT_BUFFERSIZE =8192,105 CLOCKORBIT_NUMGPS =32,106 CLOCKORBIT_NUMGLONASS =26,107 CLOCKORBIT_NUMGALILEO =36,108 CLOCKORBIT_NUMQZSS =10,109 CLOCKORBIT_NUMSBAS =38,110 CLOCKORBIT_NUMBDS =65,111 CLOCKORBIT_NUMBIAS =100,112 CLOCKORBIT_NUMIONOLAYERS =4,113 CLOCKORBIT_MAXIONOORDER =16,114 CLOCKORBIT_MAXIONODEGREE =16113 CLOCKORBIT_BUFFERSIZE = 8192, 114 CLOCKORBIT_NUMGPS = 32, 115 CLOCKORBIT_NUMGLONASS = 26, 116 CLOCKORBIT_NUMGALILEO = 36, 117 CLOCKORBIT_NUMQZSS = 10, 118 CLOCKORBIT_NUMSBAS = 38, 119 CLOCKORBIT_NUMBDS = 65, 120 CLOCKORBIT_NUMBIAS = 100, 121 CLOCKORBIT_NUMIONOLAYERS = 4, 122 CLOCKORBIT_MAXIONOORDER = 16, 123 CLOCKORBIT_MAXIONODEGREE = 16 115 124 }; 116 125 … … 126 135 127 136 enum COR_OFFSETS { 128 CLOCKORBIT_OFFSETGPS=0, 129 CLOCKORBIT_OFFSETGLONASS=CLOCKORBIT_NUMGPS, 130 CLOCKORBIT_OFFSETGALILEO=CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS, 131 CLOCKORBIT_OFFSETQZSS=CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS 132 +CLOCKORBIT_NUMGALILEO, 133 CLOCKORBIT_OFFSETSBAS=CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS 134 +CLOCKORBIT_NUMGALILEO+CLOCKORBIT_NUMQZSS, 135 CLOCKORBIT_OFFSETBDS=CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS 136 +CLOCKORBIT_NUMGALILEO+CLOCKORBIT_NUMQZSS+CLOCKORBIT_NUMSBAS, 137 CLOCKORBIT_COUNTSAT=CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS 138 +CLOCKORBIT_NUMGALILEO+CLOCKORBIT_NUMQZSS+CLOCKORBIT_NUMSBAS 139 +CLOCKORBIT_NUMBDS 137 CLOCKORBIT_OFFSETGPS = 0, 138 CLOCKORBIT_OFFSETGLONASS = CLOCKORBIT_NUMGPS, 139 CLOCKORBIT_OFFSETGALILEO = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS, 140 CLOCKORBIT_OFFSETQZSS = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO, 141 CLOCKORBIT_OFFSETSBAS = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 142 + CLOCKORBIT_NUMQZSS, 143 CLOCKORBIT_OFFSETBDS = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 144 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS, 145 CLOCKORBIT_COUNTSAT = CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 146 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS + CLOCKORBIT_NUMBDS 140 147 }; 141 148 … … 220 227 CODETYPE_SBAS_L5_Q = 2, 221 228 CODETYPE_SBAS_L5_IQ = 3, 229 222 230 CODETYPE_BDS_B1_I = 0, 223 231 CODETYPE_BDS_B1_Q = 1, … … 234 242 CODETYPE_BDS_B2a_D = 12, 235 243 CODETYPE_BDS_B2a_P = 13, 236 CODETYPE_BDS_B2a_DP = 14, 237 238 CODETYPE_IRNSS_S_SPS = 8, 239 CODETYPE_IRNSS_L5_SPS = 22 244 CODETYPE_BDS_B2a_DP = 14 240 245 }; 241 246 … … 247 252 xxx->Sat[CLOCKORBIT_OFFSETGPS]. */ 248 253 249 #ifdef COR_LEGACY 250 /* old names */ 251 #define NumberOfGPSSat NumberOfSat[CLOCKORBIT_SATGPS] 252 #define NumberOfGLONASSSat NumberOfSat[CLOCKORBIT_SATGLONASS] 253 #define GPSEpochTime EpochTime[CLOCKORBIT_SATGPS] /* 0 .. 604799 s */ 254 #define GLONASSEpochTime EpochTime[CLOCKORBIT_SATGLONASS] /* 0 .. 86399 s (86400 for leap second) */ 255 #define ClockDataSupplied Supplied[COBOFS_CLOCK] 256 #define HRDataSupplied Supplied[COBOFS_HR] 257 #define OrbitDataSupplied Supplied[COBOFS_ORBIT] 258 #define URADataSupplied Supplied[COBOFS_URA] 259 #define GetClockOrbitBias(a,b,c,d,e) GetSSR(a,b,0,0,c,d,e) 260 #endif /* COR_LEGACY */ 261 262 /* latency check code, disabled by default */ 263 #ifdef COR_LATENCY 264 #define COR_LATENCYCOUNT 100 265 #endif 266 267 struct ClockOrbit 268 { 254 struct ClockOrbit { 269 255 enum ClockOrbitType messageType; 270 256 unsigned int EpochTime[CLOCKORBIT_SATNUM]; /* 0 .. system specific maximum */ 271 257 unsigned int NumberOfSat[CLOCKORBIT_SATNUM]; /* 0 .. CLOCKORBIT_NUM... */ 272 273 258 unsigned int Supplied[COBOFS_NUM]; /* boolean */ 274 #ifdef COR_LATENCY275 unsigned int epochGPS[COR_LATENCYCOUNT+1]; /* Weber, for latency */276 unsigned int epochSize; /* Weber, for latency */277 #endif278 259 unsigned int SSRIOD; 279 260 unsigned int SSRProviderID; … … 287 268 double UserRangeAccuracy; /* accuracy values in [m] */ 288 269 double hrclock; 289 struct OrbitPart 290 { 270 struct OrbitPart { 291 271 double DeltaRadial; /* m */ 292 272 double DeltaAlongTrack; /* m */ … … 296 276 double DotDeltaCrossTrack; /* m/s */ 297 277 } Orbit; 298 struct ClockPart 299 { 278 struct ClockPart { 300 279 double DeltaA0; /* m */ 301 280 double DeltaA1; /* m/s */ … … 305 284 }; 306 285 307 struct CodeBias 308 { 286 struct CodeBias { 309 287 enum CodeBiasType messageType; 310 288 unsigned int EpochTime[CLOCKORBIT_SATNUM]; /* 0 .. system specific maximum */ … … 314 292 unsigned int SSRProviderID; 315 293 unsigned int SSRSolutionID; 316 struct BiasSat 317 { 294 struct BiasSat { 318 295 unsigned int ID; /* all */ 319 296 unsigned int NumberOfCodeBiases; 320 struct CodeBiasEntry 321 { 297 struct CodeBiasEntry { 322 298 enum CodeType Type; 323 299 float Bias; /* m */ … … 326 302 }; 327 303 328 struct PhaseBias 329 { 304 struct PhaseBias { 330 305 enum PhaseBiasType messageType; 331 306 unsigned int EpochTime[CLOCKORBIT_SATNUM]; /* 0 .. system specific maximum */ … … 337 312 unsigned int DispersiveBiasConsistencyIndicator; 338 313 unsigned int MWConsistencyIndicator; 339 struct PhaseBiasSat 340 { 314 struct PhaseBiasSat { 341 315 unsigned int ID; /* all */ 342 316 unsigned int NumberOfPhaseBiases; 343 317 double YawAngle; /* radiant */ 344 318 double YawRate; /* radiant/s */ 345 struct PhaseBiasEntry 346 { 319 struct PhaseBiasEntry { 347 320 enum CodeType Type; 348 321 unsigned int SignalIntegerIndicator; … … 354 327 }; 355 328 356 struct VTEC 357 { 329 struct VTEC { 358 330 unsigned int EpochTime; /* GPS */ 359 331 unsigned int UpdateInterval; … … 384 356 enum GCOB_RETURN { 385 357 /* all well */ 386 GCOBR_MESSAGEFOLLOWS =1,387 GCOBR_OK =0,358 GCOBR_MESSAGEFOLLOWS = 1, 359 GCOBR_OK = 0, 388 360 /* unknown data, a warning */ 389 GCOBR_UNKNOWNTYPE = -1,390 GCOBR_UNKNOWNDATA = -2,391 GCOBR_CRCMISMATCH = -3,392 GCOBR_SHORTMESSAGE = -4,361 GCOBR_UNKNOWNTYPE = -1, 362 GCOBR_UNKNOWNDATA = -2, 363 GCOBR_CRCMISMATCH = -3, 364 GCOBR_SHORTMESSAGE = -4, 393 365 /* failed to do the work */ 394 366 GCOBR_NOCLOCKORBITPARAMETER = -10, 395 GCOBR_NOCODEBIASPARAMETER = -11,396 GCOBR_NOPHASEBIASPARAMETER = -12,397 GCOBR_NOVTECPARAMETER = -13,367 GCOBR_NOCODEBIASPARAMETER = -11, 368 GCOBR_NOPHASEBIASPARAMETER = -12, 369 GCOBR_NOVTECPARAMETER = -13, 398 370 /* data mismatch - data in storage does not match new data */ 399 GCOBR_TIMEMISMATCH = -20,400 GCOBR_DATAMISMATCH = -21,371 GCOBR_TIMEMISMATCH = -20, 372 GCOBR_DATAMISMATCH = -21, 401 373 /* not enough data - can decode the block completely */ 402 GCOBR_SHORTBUFFER = -30,403 GCOBR_MESSAGEEXCEEDSBUFFER = -31};374 GCOBR_SHORTBUFFER = -30, 375 GCOBR_MESSAGEEXCEEDSBUFFER = -31}; 404 376 405 377 /* NOTE: When an error message has been emitted, the output structures may have been modified. Make a copy of the previous variant before calling the -
branches/BNC_2.12/src/src.pri
r7858 r8987 60 60 RTCM3/RTCM3Decoder.h RTCM3/bits.h RTCM3/gnss.h \ 61 61 RTCM3/RTCM3coDecoder.h RTCM3/ephEncoder.h \ 62 RTCM3/clock_and_orbit/clock_orbit_rtcm.h \63 62 rinex/rnxobsfile.h \ 64 63 rinex/rnxnavfile.h rinex/corrfile.h \ … … 97 96 RTCM3/RTCM3Decoder.cpp \ 98 97 RTCM3/RTCM3coDecoder.cpp RTCM3/ephEncoder.cpp \ 99 RTCM3/clock_and_orbit/clock_orbit_rtcm.c \100 98 rinex/rnxobsfile.cpp \ 101 99 rinex/rnxnavfile.cpp rinex/corrfile.cpp \ … … 113 111 114 112 QT += network 113 114 # Format of SSR corrections 115 # ------------------------- 116 DEFINES += USE_SSR_RTCM 117 #DEFINES += USE_SSR_IGS 118 contains(DEFINES, USE_SSR_IGS) { 119 HEADERS += RTCM3/clock_and_orbit/clock_orbit_igs.h 120 SOURCES += RTCM3/clock_and_orbit/clock_orbit_igs.c 121 } 122 else { 123 HEADERS += RTCM3/clock_and_orbit/clock_orbit_rtcm.h 124 SOURCES += RTCM3/clock_and_orbit/clock_orbit_rtcm.c 125 } 115 126 116 127 exists(PPP) { -
branches/BNC_2.12/src/upload/bncrtnetuploadcaster.cpp
r8946 r8987 150 150 _t0 = 2020.0; 151 151 } 152 // Transformation Parameters from IGb14 to SIRGAS2000 (Sonia Costa, BRA) 152 // Transformation Parameters from IGb14 to SIRGAS2000 (Thanks to Sonia Costa, BRA) 153 // June 29 2020: TX:-0.0027 m TY:-0.0025 m TZ:-0.0042 m SCL:1.20 (ppb) no rotations and no rates.*/ 153 154 else if (_crdTrafo == "SIRGAS2000") { 154 _dx = 0.0026;155 _dy = 0.0018;156 _dz = -0.00 61;155 _dx = -0.0027; 156 _dy = -0.0025; 157 _dz = -0.0042; 157 158 158 159 _dxr = 0.0000; … … 168 169 _ozr = 0.000000; 169 170 170 _sc = -1.00000;171 _sc = 1.20000; 171 172 _scr = 0.00000; 172 173 _t0 = 2000.0; … … 553 554 else if (prn.system() == 'E') { 554 555 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 555 556 + co.NumberOfSat[CLOCKORBIT_SATGALILEO]; 556 557 ++co.NumberOfSat[CLOCKORBIT_SATGALILEO]; 557 558 } 558 559 else if (prn.system() == 'J') { 559 560 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 560 + CLOCKORBIT_NUMGALILEO + co.NumberOfSat[CLOCKORBIT_SATQZSS]; 561 + CLOCKORBIT_NUMGALILEO 562 + co.NumberOfSat[CLOCKORBIT_SATQZSS]; 561 563 ++co.NumberOfSat[CLOCKORBIT_SATQZSS]; 562 564 } … … 569 571 else if (prn.system() == 'C') { 570 572 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 571 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS 573 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS 574 + CLOCKORBIT_NUMSBAS 572 575 + co.NumberOfSat[CLOCKORBIT_SATBDS]; 573 576 ++co.NumberOfSat[CLOCKORBIT_SATBDS]; … … 594 597 else if (prn.system() == 'R') { 595 598 biasSat = bias.Sat + CLOCKORBIT_NUMGPS 596 + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];599 + bias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 597 600 ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 598 601 } 599 602 else if (prn.system() == 'E') { 600 603 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 601 + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];604 + bias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 602 605 ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 603 606 } 604 607 else if (prn.system() == 'J') { 605 608 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 606 + CLOCKORBIT_NUMGALILEO + bias.NumberOfSat[CLOCKORBIT_SATQZSS]; 609 + CLOCKORBIT_NUMGALILEO 610 + bias.NumberOfSat[CLOCKORBIT_SATQZSS]; 607 611 ++bias.NumberOfSat[CLOCKORBIT_SATQZSS]; 608 612 } 609 613 else if (prn.system() == 'S') { 610 614 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 611 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS612 + bias.NumberOfSat[CLOCKORBIT_SATSBAS];615 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS 616 + bias.NumberOfSat[CLOCKORBIT_SATSBAS]; 613 617 ++bias.NumberOfSat[CLOCKORBIT_SATSBAS]; 614 618 } 615 619 else if (prn.system() == 'C') { 616 620 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 617 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS 618 + bias.NumberOfSat[CLOCKORBIT_SATBDS]; 621 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS 622 + CLOCKORBIT_NUMSBAS 623 + bias.NumberOfSat[CLOCKORBIT_SATBDS]; 619 624 ++bias.NumberOfSat[CLOCKORBIT_SATBDS]; 620 625 } … … 652 657 biasSat->Biases[ii].Bias = it.value(); 653 658 } 659 #ifdef USE_SSR_RTCM 654 660 else if (it.key() == "1X") { 655 661 int ii = biasSat->NumberOfCodeBiases; … … 660 666 biasSat->Biases[ii].Bias = it.value(); 661 667 } 668 #endif 662 669 else if (it.key() == "1P") { 663 670 int ii = biasSat->NumberOfCodeBiases; … … 708 715 biasSat->Biases[ii].Bias = it.value(); 709 716 } 717 #ifdef USE_SSR_RTCM 710 718 else if (it.key() == "2X") { 711 719 int ii = biasSat->NumberOfCodeBiases; … … 716 724 biasSat->Biases[ii].Bias = it.value(); 717 725 } 726 #endif 718 727 else if (it.key() == "2P") { 719 728 int ii = biasSat->NumberOfCodeBiases; … … 748 757 biasSat->Biases[ii].Bias = it.value(); 749 758 } 759 #ifdef USE_SSR_RTCM 750 760 else if (it.key() == "5X") { 751 761 int ii = biasSat->NumberOfCodeBiases; … … 756 766 biasSat->Biases[ii].Bias = it.value(); 757 767 } 768 #endif 758 769 } 759 770 } … … 810 821 biasSat->Biases[ii].Bias = it.value(); 811 822 } 823 #ifdef USE_SSR_RTCM 812 824 else if (it.key() == "4X") { 813 825 int ii = biasSat->NumberOfCodeBiases; … … 818 830 biasSat->Biases[ii].Bias = it.value(); 819 831 } 832 #endif 820 833 else if (it.key() == "6A") { 821 834 int ii = biasSat->NumberOfCodeBiases; … … 834 847 biasSat->Biases[ii].Bias = it.value(); 835 848 } 849 #ifdef USE_SSR_RTCM 836 850 else if (it.key() == "6X") { 837 851 int ii = biasSat->NumberOfCodeBiases; … … 842 856 biasSat->Biases[ii].Bias = it.value(); 843 857 } 858 #endif 844 859 else if (it.key() == "3I") { 845 860 int ii = biasSat->NumberOfCodeBiases; … … 858 873 biasSat->Biases[ii].Bias = it.value(); 859 874 } 875 #ifdef USE_SSR_RTCM 860 876 else if (it.key() == "3X") { 861 877 int ii = biasSat->NumberOfCodeBiases; … … 866 882 biasSat->Biases[ii].Bias = it.value(); 867 883 } 884 #endif 868 885 } 869 886 } … … 896 913 biasSat->Biases[ii].Bias = it.value(); 897 914 } 915 #ifdef USE_SSR_RTCM 898 916 else if (it.key() == "1X") { 899 917 int ii = biasSat->NumberOfCodeBiases; … … 912 930 biasSat->Biases[ii].Bias = it.value(); 913 931 } 932 #endif 914 933 else if (it.key() == "5I") { 915 934 int ii = biasSat->NumberOfCodeBiases; … … 928 947 biasSat->Biases[ii].Bias = it.value(); 929 948 } 949 #ifdef USE_SSR_RTCM 930 950 else if (it.key() == "5X") { 931 951 int ii = biasSat->NumberOfCodeBiases; … … 936 956 biasSat->Biases[ii].Bias = it.value(); 937 957 } 958 #endif 938 959 else if (it.key() == "7I") { 939 960 int ii = biasSat->NumberOfCodeBiases; … … 952 973 biasSat->Biases[ii].Bias = it.value(); 953 974 } 975 #ifdef USE_SSR_RTCM 954 976 else if (it.key() == "7X") { 955 977 int ii = biasSat->NumberOfCodeBiases; … … 984 1006 biasSat->Biases[ii].Bias = it.value(); 985 1007 } 1008 #endif 986 1009 else if (it.key() == "6A") { 987 1010 int ii = biasSat->NumberOfCodeBiases; … … 1008 1031 biasSat->Biases[ii].Bias = it.value(); 1009 1032 } 1033 #ifdef USE_SSR_RTCM 1010 1034 else if (it.key() == "6X") { 1011 1035 int ii = biasSat->NumberOfCodeBiases; … … 1024 1048 biasSat->Biases[ii].Bias = it.value(); 1025 1049 } 1050 #endif 1026 1051 } 1027 1052 } … … 1070 1095 biasSat->Biases[ii].Bias = it.value(); 1071 1096 } 1097 #ifdef USE_SSR_RTCM 1072 1098 else if (it.key() == "2X") { 1073 1099 int ii = biasSat->NumberOfCodeBiases; … … 1078 1104 biasSat->Biases[ii].Bias = it.value(); 1079 1105 } 1106 #endif 1080 1107 else if (it.key() == "5I") { 1081 1108 int ii = biasSat->NumberOfCodeBiases; … … 1094 1121 biasSat->Biases[ii].Bias = it.value(); 1095 1122 } 1123 #ifdef USE_SSR_RTCM 1096 1124 else if (it.key() == "5X") { 1097 1125 int ii = biasSat->NumberOfCodeBiases; … … 1102 1130 biasSat->Biases[ii].Bias = it.value(); 1103 1131 } 1132 #endif 1104 1133 else if (it.key() == "6S") { 1105 1134 int ii = biasSat->NumberOfCodeBiases; … … 1118 1147 biasSat->Biases[ii].Bias = it.value(); 1119 1148 } 1149 #ifdef USE_SSR_RTCM 1120 1150 else if (it.key() == "6X") { 1121 1151 int ii = biasSat->NumberOfCodeBiases; … … 1166 1196 biasSat->Biases[ii].Bias = it.value(); 1167 1197 } 1198 #endif 1168 1199 else if (it.key() == "6E") { 1169 1200 int ii = biasSat->NumberOfCodeBiases; … … 1174 1205 biasSat->Biases[ii].Bias = it.value(); 1175 1206 } 1207 #ifdef USE_SSR_RTCM 1176 1208 else if (it.key() == "6Z") { 1177 1209 int ii = biasSat->NumberOfCodeBiases; … … 1182 1214 biasSat->Biases[ii].Bias = it.value(); 1183 1215 } 1216 #endif 1184 1217 } 1185 1218 } … … 1212 1245 biasSat->Biases[ii].Bias = it.value(); 1213 1246 } 1247 #ifdef USE_SSR_RTCM 1214 1248 else if (it.key() == "5X") { 1215 1249 int ii = biasSat->NumberOfCodeBiases; … … 1220 1254 biasSat->Biases[ii].Bias = it.value(); 1221 1255 } 1256 #endif 1222 1257 } 1223 1258 } … … 1242 1277 biasSat->Biases[ii].Bias = it.value(); 1243 1278 } 1279 #ifdef USE_SSR_RTCM 1244 1280 else if (it.key() == "2X") { 1245 1281 int ii = biasSat->NumberOfCodeBiases; … … 1250 1286 biasSat->Biases[ii].Bias = it.value(); 1251 1287 } 1288 #endif 1252 1289 else if (it.key() == "6I") { 1253 1290 int ii = biasSat->NumberOfCodeBiases; … … 1266 1303 biasSat->Biases[ii].Bias = it.value(); 1267 1304 } 1305 #ifdef USE_SSR_RTCM 1268 1306 else if (it.key() == "6X") { 1269 1307 int ii = biasSat->NumberOfCodeBiases; … … 1274 1312 biasSat->Biases[ii].Bias = it.value(); 1275 1313 } 1314 #endif 1276 1315 else if (it.key() == "7I") { 1277 1316 int ii = biasSat->NumberOfCodeBiases; … … 1290 1329 biasSat->Biases[ii].Bias = it.value(); 1291 1330 } 1331 #ifdef USE_SSR_RTCM 1292 1332 else if (it.key() == "7X") { 1293 1333 int ii = biasSat->NumberOfCodeBiases; … … 1298 1338 biasSat->Biases[ii].Bias = it.value(); 1299 1339 } 1340 #endif 1300 1341 else if (it.key() == "1D") { 1301 1342 int ii = biasSat->NumberOfCodeBiases; … … 1314 1355 biasSat->Biases[ii].Bias = it.value(); 1315 1356 } 1357 #ifdef USE_SSR_RTCM 1316 1358 else if (it.key() == "1X") { 1317 1359 int ii = biasSat->NumberOfCodeBiases; … … 1322 1364 biasSat->Biases[ii].Bias = it.value(); 1323 1365 } 1366 #endif 1324 1367 else if (it.key() == "5D") { 1325 1368 int ii = biasSat->NumberOfCodeBiases; … … 1338 1381 biasSat->Biases[ii].Bias = it.value(); 1339 1382 } 1383 #ifdef USE_SSR_RTCM 1340 1384 else if (it.key() == "5X") { 1341 1385 int ii = biasSat->NumberOfCodeBiases; … … 1346 1390 biasSat->Biases[ii].Bias = it.value(); 1347 1391 } 1392 #elif USE_SSR_IGS 1393 else if (it.key() == "1A") { 1394 int ii = biasSat->NumberOfCodeBiases; 1395 if (ii >= CLOCKORBIT_NUMBIAS) 1396 break; 1397 biasSat->NumberOfCodeBiases += 1; 1398 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_A; 1399 biasSat->Biases[ii].Bias = it.value(); 1348 1400 } 1349 } 1350 } 1401 else if (it.key() == "6A") { 1402 int ii = biasSat->NumberOfCodeBiases; 1403 if (ii >= CLOCKORBIT_NUMBIAS) 1404 break; 1405 biasSat->NumberOfCodeBiases += 1; 1406 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_A; 1407 biasSat->Biases[ii].Bias = it.value(); 1408 } 1409 #endif 1410 } 1411 } 1412 } 1413 1351 1414 // Phase Biases 1352 1415 // ------------ 1353 1416 struct PhaseBias::PhaseBiasSat* phasebiasSat = 0; 1354 // if (!phaseBiasList.isEmpty()) { // to allow yaw angle without phase bias list 1355 if (prn.system() == 'G') { 1356 phasebiasSat = phasebias.Sat 1357 + phasebias.NumberOfSat[CLOCKORBIT_SATGPS]; 1358 ++phasebias.NumberOfSat[CLOCKORBIT_SATGPS]; 1359 } 1360 else if (prn.system() == 'R') { 1361 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1362 + phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 1363 ++phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 1364 } 1365 else if (prn.system() == 'E') { 1366 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1367 + CLOCKORBIT_NUMGLONASS 1368 + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 1369 ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 1370 } 1371 else if (prn.system() == 'J') { 1372 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1373 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 1374 + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS]; 1375 ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS]; 1376 } 1377 else if (prn.system() == 'S') { 1378 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1379 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 1380 + CLOCKORBIT_NUMQZSS + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS]; 1381 ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS]; 1382 } 1383 else if (prn.system() == 'C') { 1384 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1385 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO 1386 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS 1387 + phasebias.NumberOfSat[CLOCKORBIT_SATBDS]; 1388 ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS]; 1389 } 1390 //} 1417 if (prn.system() == 'G') { 1418 phasebiasSat = phasebias.Sat 1419 + phasebias.NumberOfSat[CLOCKORBIT_SATGPS]; 1420 ++phasebias.NumberOfSat[CLOCKORBIT_SATGPS]; 1421 } 1422 else if (prn.system() == 'R') { 1423 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS 1424 + phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 1425 ++phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS]; 1426 } 1427 else if (prn.system() == 'E') { 1428 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 1429 + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 1430 ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO]; 1431 } 1432 else if (prn.system() == 'J') { 1433 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 1434 + CLOCKORBIT_NUMGALILEO 1435 + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS]; 1436 ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS]; 1437 } 1438 else if (prn.system() == 'S') { 1439 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 1440 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS 1441 + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS]; 1442 ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS]; 1443 } 1444 else if (prn.system() == 'C') { 1445 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS 1446 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS 1447 + CLOCKORBIT_NUMSBAS 1448 + phasebias.NumberOfSat[CLOCKORBIT_SATBDS]; 1449 ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS]; 1450 } 1391 1451 1392 1452 if (phasebiasSat) { … … 1478 1538 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1479 1539 } 1540 #ifdef USE_SSR_RTCM 1480 1541 else if (pbSig.type == "2X") { 1481 1542 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1489 1550 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1490 1551 } 1552 #endif 1491 1553 else if (pbSig.type == "2P") { 1492 1554 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1533 1595 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1534 1596 } 1597 #ifdef USE_SSR_RTCM 1535 1598 else if (pbSig.type == "5X") { 1536 1599 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1544 1607 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1545 1608 } 1609 #endif 1546 1610 else if (pbSig.type == "1S") { 1547 1611 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1566 1630 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1567 1631 } 1632 #ifdef USE_SSR_RTCM 1568 1633 else if (pbSig.type == "1X") { 1569 1634 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1577 1642 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1578 1643 } 1644 #endif 1579 1645 } 1580 1646 } … … 1649 1715 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1650 1716 } 1717 #ifdef USE_SSR_RTCM 1651 1718 else if (pbSig.type == "4X") { 1652 1719 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1660 1727 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1661 1728 } 1729 #endif 1662 1730 else if (pbSig.type == "6A") { 1663 1731 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1682 1750 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1683 1751 } 1752 #ifdef USE_SSR_RTCM 1684 1753 else if (pbSig.type == "6X") { 1685 1754 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1693 1762 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1694 1763 } 1764 #endif 1695 1765 else if (pbSig.type == "3I") { 1696 1766 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1715 1785 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1716 1786 } 1787 #ifdef USE_SSR_RTCM 1717 1788 else if (pbSig.type == "3X") { 1718 1789 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1726 1797 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1727 1798 } 1799 #endif 1728 1800 } 1729 1801 } … … 1765 1837 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1766 1838 } 1839 #ifdef USE_SSR_RTCM 1767 1840 else if (pbSig.type == "1X") { 1768 1841 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1787 1860 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1788 1861 } 1862 #endif 1789 1863 else if (pbSig.type == "5I") { 1790 1864 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1809 1883 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1810 1884 } 1885 #ifdef USE_SSR_RTCM 1811 1886 else if (pbSig.type == "5X") { 1812 1887 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1820 1895 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1821 1896 } 1897 #endif 1822 1898 else if (pbSig.type == "7I") { 1823 1899 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1842 1918 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1843 1919 } 1920 #ifdef USE_SSR_RTCM 1844 1921 else if (pbSig.type == "7X") { 1845 1922 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1886 1963 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1887 1964 } 1965 #endif 1888 1966 else if (pbSig.type == "6A") { 1889 1967 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1919 1997 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1920 1998 } 1999 #ifdef USE_SSR_RTCM 1921 2000 else if (pbSig.type == "6X") { 1922 2001 int ii = phasebiasSat->NumberOfPhaseBiases; … … 1941 2020 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 1942 2021 } 2022 #endif 1943 2023 } 1944 2024 } … … 2001 2081 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2002 2082 } 2083 #ifdef USE_SSR_RTCM 2003 2084 else if (pbSig.type == "2X") { 2004 2085 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2011 2092 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2012 2093 } 2094 #endif 2013 2095 else if (pbSig.type == "5I") { 2014 2096 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2033 2115 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2034 2116 } 2117 #ifdef USE_SSR_RTCM 2035 2118 else if (pbSig.type == "5X") { 2036 2119 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2044 2127 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2045 2128 } 2129 #endif 2046 2130 else if (pbSig.type == "6S") { 2047 2131 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2066 2150 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2067 2151 } 2152 #ifdef USE_SSR_RTCM 2068 2153 else if (pbSig.type == "6X") { 2069 2154 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2077 2162 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2078 2163 } 2079 else if (pbSig.type == "1X") {2164 else if (pbSig.type == "1X") { 2080 2165 int ii = phasebiasSat->NumberOfPhaseBiases; 2081 2166 if (ii >= CLOCKORBIT_NUMBIAS) … … 2132 2217 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2133 2218 } 2219 #endif 2134 2220 else if (pbSig.type == "6E") { 2135 2221 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2143 2229 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2144 2230 } 2231 #ifdef USE_SSR_RTCM 2145 2232 else if (pbSig.type == "6Z") { 2146 2233 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2154 2241 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2155 2242 } 2243 #endif 2156 2244 } 2157 2245 } … … 2192 2280 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2193 2281 } 2282 #ifdef USE_SSR_RTCM 2194 2283 else if (pbSig.type == "5X") { 2195 2284 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2203 2292 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2204 2293 } 2294 #endif 2205 2295 } 2206 2296 } … … 2231 2321 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2232 2322 } 2323 #ifdef USE_SSR_RTCM 2233 2324 else if (pbSig.type == "2X") { 2234 2325 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2242 2333 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2243 2334 } 2335 #endif 2244 2336 else if (pbSig.type == "6I") { 2245 2337 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2264 2356 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2265 2357 } 2358 #ifdef USE_SSR_RTCM 2266 2359 else if (pbSig.type == "6X") { 2267 2360 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2275 2368 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2276 2369 } 2370 #endif 2277 2371 else if (pbSig.type == "7I") { 2278 2372 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2297 2391 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2298 2392 } 2393 #ifdef USE_SSR_RTCM 2299 2394 else if (pbSig.type == "7X") { 2300 2395 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2307 2402 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2308 2403 } 2404 #endif 2309 2405 else if (pbSig.type == "1D") { 2310 2406 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2327 2423 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2328 2424 } 2425 #ifdef USE_SSR_RTCM 2329 2426 else if (pbSig.type == "1X") { 2330 2427 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2337 2434 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2338 2435 } 2436 #endif 2339 2437 else if (pbSig.type == "5D") { 2340 2438 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2357 2455 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2358 2456 } 2457 #ifdef USE_SSR_RTCM 2359 2458 else if (pbSig.type == "5X") { 2360 2459 int ii = phasebiasSat->NumberOfPhaseBiases; … … 2367 2466 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2368 2467 } 2468 #elif USE_SSR_IGS 2469 else if (pbSig.type == "1A") { 2470 int ii = phasebiasSat->NumberOfPhaseBiases; 2471 if (ii >= CLOCKORBIT_NUMBIAS) 2472 break; 2473 phasebiasSat->NumberOfPhaseBiases += 1; 2474 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_A; 2475 phasebiasSat->Biases[ii].Bias = pbSig.bias; 2476 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlIndicator; 2477 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2478 } 2479 else if (pbSig.type == "6A") { 2480 int ii = phasebiasSat->NumberOfPhaseBiases; 2481 if (ii >= CLOCKORBIT_NUMBIAS) 2482 break; 2483 phasebiasSat->NumberOfPhaseBiases += 1; 2484 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_A; 2485 phasebiasSat->Biases[ii].Bias = pbSig.bias; 2486 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlIndicator; 2487 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discontinuityCounter; 2488 } 2489 #endif 2369 2490 } 2370 2491 } … … 2372 2493 } 2373 2494 } 2495 2374 2496 2375 2497 QByteArray hlpBufferCo; … … 2525 2647 || bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) { 2526 2648 char obuffer[CLOCKORBIT_BUFFERSIZE]; 2527 int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));2649 int len = MakeCodeBias(&bias, CBTYPE_AUTO, 0, obuffer, sizeof(obuffer)); 2528 2650 if (len > 0) { 2529 2651 hlpBufferBias = QByteArray(obuffer, len);
Note:
See TracChangeset
for help on using the changeset viewer.