Changeset 1843 in ntrip for trunk/BNS/RTCM/clock_orbit_rtcm.c
- Timestamp:
- May 14, 2009, 4:17:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNS/RTCM/clock_orbit_rtcm.c
r1841 r1843 3 3 Name: clock_orbit_rtcm.c 4 4 Project: RTCM3 5 Version: $Id: clock_orbit_rtcm.c,v 1. 7 2009/05/12 13:19:03 stoecker Exp $5 Version: $Id: clock_orbit_rtcm.c,v 1.15 2009/05/14 13:24:13 stoecker Exp $ 6 6 Authors: Dirk Stöcker 7 7 Description: state space approach for RTCM3 … … 573 573 return GCOBR_SHORTBUFFER; 574 574 575 #ifdef DEBUG 576 fprintf(stderr, "GetClockOrbitBias START: size %d, numbits %d\n",size, numbits); 577 #endif 578 575 579 G_HEADER(h) 576 580 G_RESERVEDH(rs) … … 605 609 co->OrbitDataSupplied |= 1; 606 610 #ifdef DEBUG 607 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat); 611 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d\n",co->GPSEpochTime, 612 co->UpdateInterval,mmi,co->NumberOfGPSSat,nums); 608 613 #endif 609 614 for(i = 0; i < nums; ++i) … … 653 658 G_NO_OF_SATELLITES(nums) 654 659 co->ClockDataSupplied |= 1; 660 #ifdef DEBUG 661 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d\n",co->GPSEpochTime, 662 co->UpdateInterval,mmi,co->NumberOfGPSSat,nums); 663 #endif 655 664 for(i = 0; i < nums; ++i) 656 665 { … … 665 674 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 666 675 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 676 #ifdef DEBUG 677 fprintf(stderr, "id %2d c0 %8.3f c1 %8.3f c2 %8.3f\n", 678 co->Sat[pos].ID, co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, 679 co->Sat[pos].Clock.DeltaA2); 680 #endif 667 681 } 668 682 break; … … 755 769 G_NO_OF_SATELLITES(nums) 756 770 co->OrbitDataSupplied |= 2; 771 #ifdef DEBUG 772 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d\n",co->GLONASSEpochTime, 773 co->UpdateInterval,mmi,co->NumberOfGLONASSSat,nums); 774 #endif 757 775 for(i = 0; i < nums; ++i) 758 776 { 759 777 G_GLONASS_SATELLITE_ID(id) 760 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)778 for(pos = CLOCKORBIT_NUMGPS; pos < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos) 761 779 ; 762 780 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 763 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;781 else if(pos == CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat; 764 782 co->Sat[pos].ID = id; 765 783 766 G_GLONASS_SATELLITE_ID(co->Sat[pos].ID)767 784 G_GLONASS_IOD(co->Sat[pos].IOD) 768 785 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial) … … 777 794 G_SATELLITE_REFERENCE_POINT(co->SatRefPoint) 778 795 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum) 796 #ifdef DEBUG 797 fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f rp %d rd %d\n", 798 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial, 799 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack, 800 co->Sat[pos].Orbit.DotDeltaRadial, 801 co->Sat[pos].Orbit.DotDeltaAlongTrack, 802 co->Sat[pos].Orbit.DotDeltaCrossTrack, 803 co->Sat[pos].Orbit.DotDotDeltaRadial, 804 co->Sat[pos].Orbit.DotDotDeltaAlongTrack, 805 co->Sat[pos].Orbit.DotDotDeltaCrossTrack, 806 co->SatRefPoint, 807 co->SatRefDatum); 808 #endif 779 809 } 780 810 break; … … 787 817 G_NO_OF_SATELLITES(nums) 788 818 co->ClockDataSupplied |= 2; 819 #ifdef DEBUG 820 fprintf(stderr, "epochtime %d ui %d mmi %d sats %d/%d\n",co->GLONASSEpochTime, 821 co->UpdateInterval,mmi,co->NumberOfGLONASSSat,nums); 822 #endif 789 823 for(i = 0; i < nums; ++i) 790 824 { 791 825 G_GLONASS_SATELLITE_ID(id) 792 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)826 for(pos = CLOCKORBIT_NUMGPS; pos < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos) 793 827 ; 794 828 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 795 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;829 else if(pos == CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat; 796 830 co->Sat[pos].ID = id; 797 831 … … 799 833 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1) 800 834 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2) 835 #ifdef DEBUG 836 fprintf(stderr, "id %2d c0 %8.3f c1 %8.3f c2 %8.3f\n", 837 co->Sat[pos].ID, co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, 838 co->Sat[pos].Clock.DeltaA2); 839 #endif 801 840 } 802 841 break; … … 813 852 { 814 853 G_GLONASS_SATELLITE_ID(id) 815 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)854 for(pos = CLOCKORBIT_NUMGPS; pos < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos) 816 855 ; 817 856 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 818 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;857 else if(pos == CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat; 819 858 co->Sat[pos].ID = id; 820 859 … … 846 885 { 847 886 G_GLONASS_SATELLITE_ID(id) 848 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)887 for(pos = CLOCKORBIT_NUMGPS; pos < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos) 849 888 ; 850 889 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 851 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;890 else if(pos == CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat; 852 891 co->Sat[pos].ID = id; 853 892 … … 866 905 { 867 906 G_GLONASS_SATELLITE_ID(id) 868 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)907 for(pos = CLOCKORBIT_NUMGPS; pos < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos) 869 908 ; 870 909 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 871 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;910 else if(pos == CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat; 872 911 co->Sat[pos].ID = id; 873 912 … … 877 916 case BTYPE_GPS: 878 917 if(!b) return GCOBR_NOBIASPARAMETER; 879 G_GPS_EPOCH_TIME(b->GPSEpochTime, co->NumberOfGPSSat)880 G_SSR_UPDATE_INTERVAL( co->UpdateInterval)918 G_GPS_EPOCH_TIME(b->GPSEpochTime, b->NumberOfGPSSat) 919 G_SSR_UPDATE_INTERVAL(b->UpdateInterval) 881 920 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 882 921 G_RESERVED5 … … 885 924 { 886 925 G_GPS_SATELLITE_ID(id) 887 for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)926 for(pos = 0; pos < b->NumberOfGPSSat && b->Sat[pos].ID != id; ++pos) 888 927 ; 889 928 if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH; 890 else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;891 co->Sat[pos].ID = id;929 else if(pos == b->NumberOfGPSSat) ++b->NumberOfGPSSat; 930 b->Sat[pos].ID = id; 892 931 893 932 G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases) … … 901 940 case BTYPE_GLONASS: 902 941 if(!b) return GCOBR_NOBIASPARAMETER; 903 G_G PS_EPOCH_TIME(b->GLONASSEpochTime, co->NumberOfGLONASSSat)904 G_SSR_UPDATE_INTERVAL( co->UpdateInterval)942 G_GLONASS_EPOCH_TIME(b->GLONASSEpochTime, b->NumberOfGLONASSSat) 943 G_SSR_UPDATE_INTERVAL(b->UpdateInterval) 905 944 G_MULTIPLE_MESSAGE_INDICATOR(mmi) 906 945 G_RESERVED5 … … 909 948 { 910 949 G_GLONASS_SATELLITE_ID(id) 911 for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)950 for(pos = CLOCKORBIT_NUMGPS; pos < b->NumberOfGLONASSSat && b->Sat[pos].ID != id; ++pos) 912 951 ; 913 952 if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH; 914 else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;915 co->Sat[pos].ID = id;953 else if(pos == b->NumberOfGLONASSSat) ++b->NumberOfGLONASSSat; 954 b->Sat[pos].ID = id; 916 955 917 956 G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases) … … 924 963 break; 925 964 default: 965 if(bytesused) 966 *bytesused = sizeofrtcmblock+6; 926 967 return GCOBR_UNKNOWNTYPE; 927 968 } 928 969 #ifdef DEBUG 929 for(type = 0; type < size && (unsigned char)buffer[type] != 0xD3; ++type)970 for(type = 0; type < (int)size && (unsigned char)buffer[type] != 0xD3; ++type) 930 971 numbits += 8; 931 972 fprintf(stderr, "numbits left %d\n",numbits);
Note:
See TracChangeset
for help on using the changeset viewer.