Changeset 5358 in ntrip for trunk/rtcm3torinex/lib
- Timestamp:
- Aug 26, 2013, 10:43:34 AM (11 years ago)
- Location:
- trunk/rtcm3torinex/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtcm3torinex/lib/rtcm3torinex.c
r5333 r5358 1225 1225 int rrint[RTCM3_MSM_NUMSAT], rdop[RTCM3_MSM_NUMSAT], 1226 1226 extsat[RTCM3_MSM_NUMSAT]; 1227 int ll[RTCM3_MSM_NUMCELLS] , hc[RTCM3_MSM_NUMCELLS];1227 int ll[RTCM3_MSM_NUMCELLS]/*, hc[RTCM3_MSM_NUMCELLS]*/; 1228 1228 double cnr[RTCM3_MSM_NUMCELLS]; 1229 1229 double cp[RTCM3_MSM_NUMCELLS], psr[RTCM3_MSM_NUMCELLS], … … 1357 1357 for(count = numcells; count--;) 1358 1358 if(cellmask & (UINT64(1)<<count)) 1359 GETBITS(hc[count], 1)1359 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1360 1360 break; 1361 1361 case 3: … … 1371 1371 for(count = numcells; count--;) 1372 1372 if(cellmask & (UINT64(1)<<count)) 1373 GETBITS(hc[count], 1)1373 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1374 1374 break; 1375 1375 case 4: … … 1385 1385 for(count = numcells; count--;) 1386 1386 if(cellmask & (UINT64(1)<<count)) 1387 GETBITS(hc[count], 1)1387 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1388 1388 for(count = numcells; count--;) 1389 1389 if(cellmask & (UINT64(1)<<count)) … … 1402 1402 for(count = numcells; count--;) 1403 1403 if(cellmask & (UINT64(1)<<count)) 1404 GETBITS(hc[count], 1)1404 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1405 1405 for(count = numcells; count--;) 1406 1406 if(cellmask & (UINT64(1)<<count)) … … 1422 1422 for(count = numcells; count--;) 1423 1423 if(cellmask & (UINT64(1)<<count)) 1424 GETBITS(hc[count], 1)1424 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1425 1425 for(count = numcells; count--;) 1426 1426 if(cellmask & (UINT64(1)<<count)) … … 1439 1439 for(count = numcells; count--;) 1440 1440 if(cellmask & (UINT64(1)<<count)) 1441 GETBITS(hc[count], 1)1441 SKIPBITS(1)/*GETBITS(hc[count], 1)*/ 1442 1442 for(count = numcells; count--;) 1443 1443 if(cellmask & (UINT64(1)<<count)) … … 1822 1822 #define NUMSTARTSKIP 3 1823 1823 #endif 1824 1825 int HandleObsHeader(struct RTCM3ParserData *Parser, char *buffer, 1826 size_t buffersize, struct HeaderData *hdata) 1827 { 1828 int buffersizeold = buffersize; 1829 int i, modified = 0; 1830 1831 if(Parser->rinex3) 1832 { 1833 int flags; 1834 #define CHECKFLAGSNEW(a, b, c) \ 1835 if(flags & GNSSDF_##b##DATA) \ 1836 { \ 1837 int new = hdata ? 1 : 0; \ 1838 if(!hdata) /* check if already known */ \ 1839 { \ 1840 int ic; \ 1841 for(ic = 0; ic < Parser->info[RTCM3_MSM_##a].numtypes \ 1842 && Parser->info[RTCM3_MSM_##a].flags[ic] != GNSSDF_##b##DATA; ++ic) \ 1843 ; \ 1844 if(ic == Parser->info[RTCM3_MSM_##a].numtypes) \ 1845 new = 1; \ 1846 } \ 1847 if(new) \ 1848 { \ 1849 Parser->info[RTCM3_MSM_##a].flags[Parser->info[RTCM3_MSM_##a].numtypes] \ 1850 = GNSSDF_##b##DATA; \ 1851 Parser->info[RTCM3_MSM_##a].pos[Parser->info[RTCM3_MSM_##a].numtypes] \ 1852 = GNSSENTRY_##b##DATA; \ 1853 if(Parser->info[RTCM3_MSM_##a].type[GNSSENTRY_##b##DATA]) \ 1854 { \ 1855 snprintf(Parser->fieldbuffer##a+4*Parser->info[RTCM3_MSM_##a].numtypes, \ 1856 sizeof(Parser->fieldbuffer##a)-4*Parser->info[RTCM3_MSM_##a].numtypes, \ 1857 " %-2.2s%c", #c, Parser->info[RTCM3_MSM_##a].type[GNSSENTRY_##b##DATA]); \ 1858 } \ 1859 else \ 1860 { \ 1861 snprintf(Parser->fieldbuffer##a+4*Parser->info[RTCM3_MSM_##a].numtypes, \ 1862 sizeof(Parser->fieldbuffer##a)-4*Parser->info[RTCM3_MSM_##a].numtypes, \ 1863 " %-3s", #c); \ 1864 } \ 1865 ++Parser->info[RTCM3_MSM_##a].numtypes; \ 1866 ++modified; \ 1867 } \ 1868 } 1869 1870 #define INITFLAGS(a) \ 1871 flags = Parser->startflags; \ 1872 modified = 0; \ 1873 for(i = 0; i < Parser->Data.numsats; ++i) \ 1874 { \ 1875 if(Parser->Data.satellites[i] >= PRN_##a##_START \ 1876 && Parser->Data.satellites[i] <= PRN_##a##_END) \ 1877 flags |= Parser->Data.dataflags[i]; \ 1878 } 1879 1880 INITFLAGS(SBAS) 1881 CHECKFLAGSNEW(SBAS, C1, C1C) 1882 CHECKFLAGSNEW(SBAS, L1C, L1C) 1883 CHECKFLAGSNEW(SBAS, D1C, D1C) 1884 CHECKFLAGSNEW(SBAS, S1C, S1C) 1885 CHECKFLAGSNEW(SBAS, C5, C5) 1886 CHECKFLAGSNEW(SBAS, L5, L5) 1887 CHECKFLAGSNEW(SBAS, D5, D5) 1888 CHECKFLAGSNEW(SBAS, S5, S5) 1889 1890 if(modified) 1891 { 1892 if(hdata) 1893 hdata->data.named.typesofobsS = buffer; 1894 i = 1+snprintf(buffer, buffersize, 1895 "S %3d%-52.52s SYS / # / OBS TYPES", 1896 Parser->info[RTCM3_MSM_SBAS].numtypes, Parser->fieldbufferSBAS); 1897 buffer += i; buffersize -= i; 1898 } 1899 1900 INITFLAGS(GPS) 1901 CHECKFLAGSNEW(GPS, C1, C1C) 1902 CHECKFLAGSNEW(GPS, L1C, L1C) 1903 CHECKFLAGSNEW(GPS, D1C, D1C) 1904 CHECKFLAGSNEW(GPS, S1C, S1C) 1905 CHECKFLAGSNEW(GPS, P1, C1W) 1906 CHECKFLAGSNEW(GPS, L1P, L1W) 1907 CHECKFLAGSNEW(GPS, D1P, D1W) 1908 CHECKFLAGSNEW(GPS, S1P, S1W) 1909 CHECKFLAGSNEW(GPS, C5, C5) 1910 CHECKFLAGSNEW(GPS, L5, L5) 1911 CHECKFLAGSNEW(GPS, D5, D5) 1912 CHECKFLAGSNEW(GPS, S5, S5) 1913 CHECKFLAGSNEW(GPS, P2, C2W) 1914 CHECKFLAGSNEW(GPS, L2P, L2W) 1915 CHECKFLAGSNEW(GPS, D2P, D2W) 1916 CHECKFLAGSNEW(GPS, S2P, S2W) 1917 CHECKFLAGSNEW(GPS, C2, C2) 1918 CHECKFLAGSNEW(GPS, L2C, L2) 1919 CHECKFLAGSNEW(GPS, D2C, D2) 1920 CHECKFLAGSNEW(GPS, S2C, S2) 1921 CHECKFLAGSNEW(GPS, C1N, C1) 1922 CHECKFLAGSNEW(GPS, L1N, L1) 1923 CHECKFLAGSNEW(GPS, D1N, D1) 1924 CHECKFLAGSNEW(GPS, S1N, S1) 1925 1926 if(modified) 1927 { 1928 if(hdata) 1929 hdata->data.named.typesofobsG = buffer; 1930 i = 1+snprintf(buffer, buffersize, 1931 "G %3d%-52.52s SYS / # / OBS TYPES", 1932 Parser->info[RTCM3_MSM_GPS].numtypes, Parser->fieldbufferGPS); 1933 if(Parser->info[RTCM3_MSM_GPS].numtypes>13) 1934 { 1935 i += snprintf(buffer+i-1, buffersize, 1936 "\n %-52.52s SYS / # / OBS TYPES", Parser->fieldbufferGPS+13*4); 1937 } 1938 buffer += i; buffersize -= i; 1939 } 1940 1941 INITFLAGS(GLONASS) 1942 CHECKFLAGSNEW(GLONASS, C1, C1C) 1943 CHECKFLAGSNEW(GLONASS, L1C, L1C) 1944 CHECKFLAGSNEW(GLONASS, D1C, D1C) 1945 CHECKFLAGSNEW(GLONASS, S1C, S1C) 1946 CHECKFLAGSNEW(GLONASS, P1, C1P) 1947 CHECKFLAGSNEW(GLONASS, L1P, L1P) 1948 CHECKFLAGSNEW(GLONASS, D1P, D1P) 1949 CHECKFLAGSNEW(GLONASS, S1P, S1P) 1950 CHECKFLAGSNEW(GLONASS, P2, C2P) 1951 CHECKFLAGSNEW(GLONASS, L2P, L2P) 1952 CHECKFLAGSNEW(GLONASS, D2P, D2P) 1953 CHECKFLAGSNEW(GLONASS, S2P, S2P) 1954 CHECKFLAGSNEW(GLONASS, C2, C2C) 1955 CHECKFLAGSNEW(GLONASS, L2C, L2C) 1956 CHECKFLAGSNEW(GLONASS, D2C, D2C) 1957 CHECKFLAGSNEW(GLONASS, S2C, S2C) 1958 1959 if(modified) 1960 { 1961 if(hdata) 1962 hdata->data.named.typesofobsR = buffer; 1963 i = 1+snprintf(buffer, buffersize, 1964 "R %3d%-52.52s SYS / # / OBS TYPES", 1965 Parser->info[RTCM3_MSM_GLONASS].numtypes, Parser->fieldbufferGLONASS); 1966 if(Parser->info[RTCM3_MSM_GLONASS].numtypes>13) 1967 { 1968 i += snprintf(buffer+i-1, buffersize, 1969 "\n %-52.52s SYS / # / OBS TYPES", Parser->fieldbufferGLONASS+13*4); 1970 } 1971 buffer += i; buffersize -= i; 1972 } 1973 1974 INITFLAGS(GALGIO) 1975 CHECKFLAGSNEW(GALILEO, C1, C1) 1976 CHECKFLAGSNEW(GALILEO, L1C, L1) 1977 CHECKFLAGSNEW(GALILEO, D1C, D1) 1978 CHECKFLAGSNEW(GALILEO, S1C, S1) 1979 CHECKFLAGSNEW(GALILEO, C6, C6) 1980 CHECKFLAGSNEW(GALILEO, L6, L6) 1981 CHECKFLAGSNEW(GALILEO, D6, D6) 1982 CHECKFLAGSNEW(GALILEO, S6, S6) 1983 CHECKFLAGSNEW(GALILEO, C5, C5) 1984 CHECKFLAGSNEW(GALILEO, L5, L5) 1985 CHECKFLAGSNEW(GALILEO, D5, D5) 1986 CHECKFLAGSNEW(GALILEO, S5, S5) 1987 CHECKFLAGSNEW(GALILEO, C5B, C7) 1988 CHECKFLAGSNEW(GALILEO, L5B, L7) 1989 CHECKFLAGSNEW(GALILEO, D5B, D7) 1990 CHECKFLAGSNEW(GALILEO, S5B, S7) 1991 CHECKFLAGSNEW(GALILEO, C5AB, C8) 1992 CHECKFLAGSNEW(GALILEO, L5AB, L8) 1993 CHECKFLAGSNEW(GALILEO, D5AB, D8) 1994 CHECKFLAGSNEW(GALILEO, S5AB, S8) 1995 1996 if(modified) 1997 { 1998 if(hdata) 1999 hdata->data.named.typesofobsE = buffer; 2000 i = 1+snprintf(buffer, buffersize, 2001 "E %3d%-52.52s SYS / # / OBS TYPES", 2002 Parser->info[RTCM3_MSM_GALILEO].numtypes, Parser->fieldbufferGALILEO); 2003 if(Parser->info[RTCM3_MSM_GALILEO].numtypes>13) 2004 { 2005 i += snprintf(buffer+i-1, buffersize, 2006 "\n %-52.52s SYS / # / OBS TYPES", Parser->fieldbufferGALILEO+13*4); 2007 } 2008 buffer += i; buffersize -= i; 2009 } 2010 2011 INITFLAGS(COMPASS) 2012 CHECKFLAGSNEW(COMPASS, CB1, C2I) 2013 CHECKFLAGSNEW(COMPASS, LB1, L2I) 2014 CHECKFLAGSNEW(COMPASS, DB1, D2I) 2015 CHECKFLAGSNEW(COMPASS, SB1, S2I) 2016 CHECKFLAGSNEW(COMPASS, CB2, C7I) 2017 CHECKFLAGSNEW(COMPASS, LB2, L7I) 2018 CHECKFLAGSNEW(COMPASS, DB2, D7I) 2019 CHECKFLAGSNEW(COMPASS, SB2, S7I) 2020 CHECKFLAGSNEW(COMPASS, CB3, C6I) 2021 CHECKFLAGSNEW(COMPASS, LB3, L6I) 2022 CHECKFLAGSNEW(COMPASS, DB3, D6I) 2023 CHECKFLAGSNEW(COMPASS, SB3, S6I) 2024 2025 if(modified) 2026 { 2027 if(hdata) 2028 hdata->data.named.typesofobsC = buffer; 2029 i = 1+snprintf(buffer, buffersize, 2030 "C %3d%-52.52s SYS / # / OBS TYPES", 2031 Parser->info[RTCM3_MSM_COMPASS].numtypes, Parser->fieldbufferCOMPASS); 2032 if(Parser->info[RTCM3_MSM_COMPASS].numtypes>13) 2033 { 2034 i += snprintf(buffer+i-1, buffersize, 2035 "\n %-52.52s SYS / # / OBS TYPES", Parser->fieldbufferCOMPASS+13*4); 2036 } 2037 buffer += i; buffersize -= i; 2038 } 2039 2040 INITFLAGS(QZSS) 2041 2042 CHECKFLAGSNEW(QZSS, C1, C1C) 2043 CHECKFLAGSNEW(QZSS, L1C, L1C) 2044 CHECKFLAGSNEW(QZSS, D1C, D1C) 2045 CHECKFLAGSNEW(QZSS, S1C, S1C) 2046 2047 CHECKFLAGSNEW(QZSS, CSAIF, C1Z) 2048 CHECKFLAGSNEW(QZSS, LSAIF, L1Z) 2049 CHECKFLAGSNEW(QZSS, DSAIF, D1Z) 2050 CHECKFLAGSNEW(QZSS, SSAIF, S1Z) 2051 2052 CHECKFLAGSNEW(QZSS, C1N, C1) 2053 CHECKFLAGSNEW(QZSS, L1N, L1) 2054 CHECKFLAGSNEW(QZSS, D1N, D1) 2055 CHECKFLAGSNEW(QZSS, S1N, S1) 2056 2057 CHECKFLAGSNEW(QZSS, C6, C6) 2058 CHECKFLAGSNEW(QZSS, L6, L6) 2059 CHECKFLAGSNEW(QZSS, D6, D6) 2060 CHECKFLAGSNEW(QZSS, S6, S6) 2061 2062 CHECKFLAGSNEW(QZSS, C2, C2) 2063 CHECKFLAGSNEW(QZSS, L2C, L2) 2064 CHECKFLAGSNEW(QZSS, D2C, D2) 2065 CHECKFLAGSNEW(QZSS, S2C, S2) 2066 2067 CHECKFLAGSNEW(QZSS, C5, C5) 2068 CHECKFLAGSNEW(QZSS, L5, L5) 2069 CHECKFLAGSNEW(QZSS, D5, D5) 2070 CHECKFLAGSNEW(QZSS, S5, S5) 2071 2072 if(modified) 2073 { 2074 if(hdata) 2075 hdata->data.named.typesofobsJ = buffer; 2076 i = 1+snprintf(buffer, buffersize, 2077 "J %3d%-52.52s SYS / # / OBS TYPES", 2078 Parser->info[RTCM3_MSM_QZSS].numtypes, Parser->fieldbufferQZSS); 2079 if(Parser->info[RTCM3_MSM_QZSS].numtypes>13) 2080 { 2081 i += snprintf(buffer+i-1, buffersize, 2082 "\n %-52.52s SYS / # / OBS TYPES", Parser->fieldbufferQZSS+13*4); 2083 } 2084 buffer += i; buffersize -= i; 2085 } 2086 } 2087 else 2088 { 2089 #define CHECKFLAGS(a, b) \ 2090 if(flags & GNSSDF_##a##DATA) \ 2091 { \ 2092 if(Parser->datafields[RINEXENTRY_##b##DATA]) \ 2093 { \ 2094 Parser->info[RTCM3_MSM_GPS].flags[Parser->datafields[\ 2095 RINEXENTRY_##b##DATA]-1] = GNSSDF_##a##DATA; \ 2096 Parser->info[RTCM3_MSM_GPS].pos[Parser->datafields[\ 2097 RINEXENTRY_##b##DATA]-1] = GNSSENTRY_##a##DATA; \ 2098 } \ 2099 else \ 2100 { \ 2101 Parser->flags[Parser->info[RTCM3_MSM_GPS].numtypes] = GNSSDF_##a##DATA; \ 2102 Parser->pos[Parser->info[RTCM3_MSM_GPS].numtypes] = GNSSENTRY_##a##DATA; \ 2103 Parser->datafields[RINEXENTRY_##b##DATA] = \ 2104 ++Parser->info[RTCM3_MSM_GPS].numtypes; \ 2105 snprintf(Parser->fieldbuffer+6*Parser->numdatafields, \ 2106 sizeof(Parser->fieldbuffer)-6*Parser->numdatafields, " "#b); \ 2107 ++Parser->numdatafields; \ 2108 ++modified; \ 2109 } \ 2110 } 2111 2112 int flags = Parser->startflags; 2113 for(i = 0; i < Parser->Data.numsats; ++i) 2114 flags |= Parser->Data.dataflags[i]; 2115 2116 CHECKFLAGS(C1,C1) 2117 CHECKFLAGS(C2,C2) 2118 CHECKFLAGS(P1,P1) 2119 CHECKFLAGS(P2,P2) 2120 CHECKFLAGS(L1C,L1) 2121 CHECKFLAGS(L1P,L1) 2122 CHECKFLAGS(L2C,L2) 2123 CHECKFLAGS(L2P,L2) 2124 CHECKFLAGS(D1C,D1) 2125 CHECKFLAGS(D1P,D1) 2126 CHECKFLAGS(D2C,D2) 2127 CHECKFLAGS(D2P,D2) 2128 CHECKFLAGS(S1C,S1) 2129 CHECKFLAGS(S1P,S1) 2130 CHECKFLAGS(S2C,S2) 2131 CHECKFLAGS(S2P,S2) 2132 CHECKFLAGS(C5,C5) 2133 CHECKFLAGS(L5,L5) 2134 CHECKFLAGS(D5,D5) 2135 CHECKFLAGS(S5,S5) 2136 CHECKFLAGS(C5AB,C8) 2137 CHECKFLAGS(L5AB,L8) 2138 CHECKFLAGS(D5AB,D8) 2139 CHECKFLAGS(S5AB,S8) 2140 CHECKFLAGS(C5B,C7) 2141 CHECKFLAGS(L5B,L7) 2142 CHECKFLAGS(D5B,D7) 2143 CHECKFLAGS(S5B,S7) 2144 CHECKFLAGS(C6,C6) 2145 CHECKFLAGS(L6,L6) 2146 CHECKFLAGS(D6,D6) 2147 CHECKFLAGS(S6,S6) 2148 /* Skip C1N and SAIF for RINEX2! */ 2149 2150 if(hdata) 2151 hdata->data.named.typesofobs = buffer; 2152 if(modified) 2153 { 2154 i = 1+snprintf(buffer, buffersize, 2155 "%6d%-54.54s# / TYPES OF OBSERV", Parser->info[RTCM3_MSM_GPS].numtypes, 2156 Parser->fieldbuffer); 2157 if(Parser->info[RTCM3_MSM_GPS].numtypes>9) 2158 { 2159 i += snprintf(buffer+i-1, buffersize, 2160 "\n %-54.54s# / TYPES OF OBSERV", Parser->fieldbuffer+9*6); 2161 } 2162 if(Parser->info[RTCM3_MSM_GPS].numtypes>18) 2163 { 2164 i += snprintf(buffer+i-1, buffersize, 2165 "\n %-54.54s# / TYPES OF OBSERV", Parser->fieldbuffer+18*6); 2166 } 2167 buffer += i; buffersize -= i; 2168 } 2169 } 2170 return buffersizeold - buffersize; 2171 } 1824 2172 1825 2173 void HandleHeader(struct RTCM3ParserData *Parser) … … 1983 2331 hdata.numheaders = 18; 1984 2332 1985 if(Parser->rinex3) 1986 { 1987 #define CHECKFLAGSNEW(a, b, c) \ 1988 if(flags & GNSSDF_##b##DATA) \ 1989 { \ 1990 Parser->info[RTCM3_MSM_##a].flags[Parser->info[RTCM3_MSM_##a].numtypes] \ 1991 = GNSSDF_##b##DATA; \ 1992 Parser->info[RTCM3_MSM_##a].pos[Parser->info[RTCM3_MSM_##a].numtypes] \ 1993 = GNSSENTRY_##b##DATA; \ 1994 ++Parser->info[RTCM3_MSM_##a].numtypes; \ 1995 if(Parser->info[RTCM3_MSM_##a].type[GNSSENTRY_##b##DATA]) \ 1996 snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " %-2.2s%c", #c,\ 1997 Parser->info[RTCM3_MSM_##a].type[GNSSENTRY_##b##DATA]); \ 1998 else \ 1999 snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " %-3s", #c); \ 2000 tbufferpos += 4; \ 2001 } 2002 2003 int flags = Parser->startflags; 2004 char tbuffer[6*RINEXENTRY_NUMBER+1]; 2005 int tbufferpos = 0; 2006 for(i = 0; i < Parser->Data.numsats; ++i) 2007 flags |= Parser->Data.dataflags[i]; 2008 2009 CHECKFLAGSNEW(SBAS, C1, C1C) 2010 CHECKFLAGSNEW(SBAS, L1C, L1C) 2011 CHECKFLAGSNEW(SBAS, D1C, D1C) 2012 CHECKFLAGSNEW(SBAS, S1C, S1C) 2013 CHECKFLAGSNEW(SBAS, C5, C5) 2014 CHECKFLAGSNEW(SBAS, L5, L5) 2015 CHECKFLAGSNEW(SBAS, D5, D5) 2016 CHECKFLAGSNEW(SBAS, S5, S5) 2017 2018 hdata.data.named.typesofobsS = buffer; 2019 i = 1+snprintf(buffer, buffersize, 2020 "S %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_SBAS].numtypes, tbuffer); 2021 buffer += i; buffersize -= i; 2022 2023 tbufferpos = 0; 2024 2025 CHECKFLAGSNEW(GPS, C1, C1C) 2026 CHECKFLAGSNEW(GPS, L1C, L1C) 2027 CHECKFLAGSNEW(GPS, D1C, D1C) 2028 CHECKFLAGSNEW(GPS, S1C, S1C) 2029 CHECKFLAGSNEW(GPS, P1, C1W) 2030 CHECKFLAGSNEW(GPS, L1P, L1W) 2031 CHECKFLAGSNEW(GPS, D1P, D1W) 2032 CHECKFLAGSNEW(GPS, S1P, S1W) 2033 CHECKFLAGSNEW(GPS, C5, C5) 2034 CHECKFLAGSNEW(GPS, L5, L5) 2035 CHECKFLAGSNEW(GPS, D5, D5) 2036 CHECKFLAGSNEW(GPS, S5, S5) 2037 CHECKFLAGSNEW(GPS, P2, C2W) 2038 CHECKFLAGSNEW(GPS, L2P, L2W) 2039 CHECKFLAGSNEW(GPS, D2P, D2W) 2040 CHECKFLAGSNEW(GPS, S2P, S2W) 2041 CHECKFLAGSNEW(GPS, C2, C2) 2042 CHECKFLAGSNEW(GPS, L2C, L2) 2043 CHECKFLAGSNEW(GPS, D2C, D2) 2044 CHECKFLAGSNEW(GPS, S2C, S2) 2045 CHECKFLAGSNEW(GPS, C1N, C1) 2046 CHECKFLAGSNEW(GPS, L1N, L1) 2047 CHECKFLAGSNEW(GPS, D1N, D1) 2048 CHECKFLAGSNEW(GPS, S1N, S1) 2049 2050 hdata.data.named.typesofobsG = buffer; 2051 i = 1+snprintf(buffer, buffersize, 2052 "G %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_GPS].numtypes, tbuffer); 2053 if(Parser->info[RTCM3_MSM_GPS].numtypes>13) 2054 { 2055 i += snprintf(buffer+i-1, buffersize, 2056 "\n %-52.52s SYS / # / OBS TYPES", tbuffer+13*4); 2057 } 2058 buffer += i; buffersize -= i; 2059 2060 tbufferpos = 0; 2061 2062 CHECKFLAGSNEW(GLONASS, C1, C1C) 2063 CHECKFLAGSNEW(GLONASS, L1C, L1C) 2064 CHECKFLAGSNEW(GLONASS, D1C, D1C) 2065 CHECKFLAGSNEW(GLONASS, S1C, S1C) 2066 CHECKFLAGSNEW(GLONASS, P1, C1P) 2067 CHECKFLAGSNEW(GLONASS, L1P, L1P) 2068 CHECKFLAGSNEW(GLONASS, D1P, D1P) 2069 CHECKFLAGSNEW(GLONASS, S1P, S1P) 2070 CHECKFLAGSNEW(GLONASS, P2, C2P) 2071 CHECKFLAGSNEW(GLONASS, L2P, L2P) 2072 CHECKFLAGSNEW(GLONASS, D2P, D2P) 2073 CHECKFLAGSNEW(GLONASS, S2P, S2P) 2074 CHECKFLAGSNEW(GLONASS, C2, C2C) 2075 CHECKFLAGSNEW(GLONASS, L2C, L2C) 2076 CHECKFLAGSNEW(GLONASS, D2C, D2C) 2077 CHECKFLAGSNEW(GLONASS, S2C, S2C) 2078 2079 hdata.data.named.typesofobsR = buffer; 2080 i = 1+snprintf(buffer, buffersize, 2081 "R %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_GLONASS].numtypes, tbuffer); 2082 if(Parser->info[RTCM3_MSM_GLONASS].numtypes>13) 2083 { 2084 i += snprintf(buffer+i-1, buffersize, 2085 "\n %-52.52s SYS / # / OBS TYPES", tbuffer+13*4); 2086 } 2087 buffer += i; buffersize -= i; 2088 2089 tbufferpos = 0; 2090 2091 CHECKFLAGSNEW(GALILEO, C1, C1) 2092 CHECKFLAGSNEW(GALILEO, L1C, L1) 2093 CHECKFLAGSNEW(GALILEO, D1C, D1) 2094 CHECKFLAGSNEW(GALILEO, S1C, S1) 2095 CHECKFLAGSNEW(GALILEO, C6, C6) 2096 CHECKFLAGSNEW(GALILEO, L6, L6) 2097 CHECKFLAGSNEW(GALILEO, D6, D6) 2098 CHECKFLAGSNEW(GALILEO, S6, S6) 2099 CHECKFLAGSNEW(GALILEO, C5, C5) 2100 CHECKFLAGSNEW(GALILEO, L5, L5) 2101 CHECKFLAGSNEW(GALILEO, D5, D5) 2102 CHECKFLAGSNEW(GALILEO, S5, S5) 2103 CHECKFLAGSNEW(GALILEO, C5B, C7) 2104 CHECKFLAGSNEW(GALILEO, L5B, L7) 2105 CHECKFLAGSNEW(GALILEO, D5B, D7) 2106 CHECKFLAGSNEW(GALILEO, S5B, S7) 2107 CHECKFLAGSNEW(GALILEO, C5AB, C8) 2108 CHECKFLAGSNEW(GALILEO, L5AB, L8) 2109 CHECKFLAGSNEW(GALILEO, D5AB, D8) 2110 CHECKFLAGSNEW(GALILEO, S5AB, S8) 2111 2112 hdata.data.named.typesofobsE = buffer; 2113 i = 1+snprintf(buffer, buffersize, 2114 "E %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_GALILEO].numtypes, tbuffer); 2115 if(Parser->info[RTCM3_MSM_GALILEO].numtypes>13) 2116 { 2117 i += snprintf(buffer+i-1, buffersize, 2118 "\n %-52.52s SYS / # / OBS TYPES", tbuffer+13*4); 2119 } 2120 buffer += i; buffersize -= i; 2121 2122 tbufferpos = 0; 2123 2124 CHECKFLAGSNEW(COMPASS, CB1, C2I) 2125 CHECKFLAGSNEW(COMPASS, LB1, L2I) 2126 CHECKFLAGSNEW(COMPASS, DB1, D2I) 2127 CHECKFLAGSNEW(COMPASS, SB1, S2I) 2128 CHECKFLAGSNEW(COMPASS, CB2, C7I) 2129 CHECKFLAGSNEW(COMPASS, LB2, L7I) 2130 CHECKFLAGSNEW(COMPASS, DB2, D7I) 2131 CHECKFLAGSNEW(COMPASS, SB2, S7I) 2132 CHECKFLAGSNEW(COMPASS, CB3, C6I) 2133 CHECKFLAGSNEW(COMPASS, LB3, L6I) 2134 CHECKFLAGSNEW(COMPASS, DB3, D6I) 2135 CHECKFLAGSNEW(COMPASS, SB3, S6I) 2136 2137 hdata.data.named.typesofobsC = buffer; 2138 i = 1+snprintf(buffer, buffersize, 2139 "C %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_COMPASS].numtypes, tbuffer); 2140 if(Parser->info[RTCM3_MSM_COMPASS].numtypes>13) 2141 { 2142 i += snprintf(buffer+i-1, buffersize, 2143 "\n %-52.52s SYS / # / OBS TYPES", tbuffer+13*4); 2144 } 2145 buffer += i; buffersize -= i; 2146 2147 tbufferpos = 0; 2148 2149 CHECKFLAGSNEW(QZSS, C1, C1C) 2150 CHECKFLAGSNEW(QZSS, L1C, L1C) 2151 CHECKFLAGSNEW(QZSS, D1C, D1C) 2152 CHECKFLAGSNEW(QZSS, S1C, S1C) 2153 2154 CHECKFLAGSNEW(QZSS, CSAIF, C1Z) 2155 CHECKFLAGSNEW(QZSS, LSAIF, L1Z) 2156 CHECKFLAGSNEW(QZSS, DSAIF, D1Z) 2157 CHECKFLAGSNEW(QZSS, SSAIF, S1Z) 2158 2159 CHECKFLAGSNEW(QZSS, C1N, C1) 2160 CHECKFLAGSNEW(QZSS, L1N, L1) 2161 CHECKFLAGSNEW(QZSS, D1N, D1) 2162 CHECKFLAGSNEW(QZSS, S1N, S1) 2163 2164 CHECKFLAGSNEW(QZSS, C6, C6) 2165 CHECKFLAGSNEW(QZSS, L6, L6) 2166 CHECKFLAGSNEW(QZSS, D6, D6) 2167 CHECKFLAGSNEW(QZSS, S6, S6) 2168 2169 CHECKFLAGSNEW(QZSS, C2, C2) 2170 CHECKFLAGSNEW(QZSS, L2C, L2) 2171 CHECKFLAGSNEW(QZSS, D2C, D2) 2172 CHECKFLAGSNEW(QZSS, S2C, S2) 2173 2174 CHECKFLAGSNEW(QZSS, C5, C5) 2175 CHECKFLAGSNEW(QZSS, L5, L5) 2176 CHECKFLAGSNEW(QZSS, D5, D5) 2177 CHECKFLAGSNEW(QZSS, S5, S5) 2178 2179 hdata.data.named.typesofobsJ = buffer; 2180 i = 1+snprintf(buffer, buffersize, 2181 "J %3d%-52.52s SYS / # / OBS TYPES", Parser->info[RTCM3_MSM_QZSS].numtypes, tbuffer); 2182 if(Parser->info[RTCM3_MSM_QZSS].numtypes>13) 2183 { 2184 i += snprintf(buffer+i-1, buffersize, 2185 "\n %-52.52s SYS / # / OBS TYPES", tbuffer+13*4); 2186 } 2187 buffer += i; buffersize -= i; 2188 } 2189 else 2190 { 2191 #define CHECKFLAGS(a, b) \ 2192 if(flags & GNSSDF_##a##DATA) \ 2193 { \ 2194 if(data[RINEXENTRY_##b##DATA]) \ 2195 { \ 2196 Parser->info[RTCM3_MSM_GPS].flags[data[RINEXENTRY_##b##DATA]-1] = GNSSDF_##a##DATA; \ 2197 Parser->info[RTCM3_MSM_GPS].pos[data[RINEXENTRY_##b##DATA]-1] = GNSSENTRY_##a##DATA; \ 2198 } \ 2199 else \ 2200 { \ 2201 Parser->flags[Parser->info[RTCM3_MSM_GPS].numtypes] = GNSSDF_##a##DATA; \ 2202 Parser->pos[Parser->info[RTCM3_MSM_GPS].numtypes] = GNSSENTRY_##a##DATA; \ 2203 data[RINEXENTRY_##b##DATA] = ++Parser->info[RTCM3_MSM_GPS].numtypes; \ 2204 snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " "#b); \ 2205 tbufferpos += 6; \ 2206 } \ 2207 } 2208 2209 int flags = Parser->startflags; 2210 int data[RINEXENTRY_NUMBER]; 2211 char tbuffer[6*RINEXENTRY_NUMBER+1]; 2212 int tbufferpos = 0; 2213 for(i = 0; i < RINEXENTRY_NUMBER; ++i) 2214 data[i] = 0; 2215 for(i = 0; i < Parser->Data.numsats; ++i) 2216 flags |= Parser->Data.dataflags[i]; 2217 2218 CHECKFLAGS(C1,C1) 2219 CHECKFLAGS(C2,C2) 2220 CHECKFLAGS(P1,P1) 2221 CHECKFLAGS(P2,P2) 2222 CHECKFLAGS(L1C,L1) 2223 CHECKFLAGS(L1P,L1) 2224 CHECKFLAGS(L2C,L2) 2225 CHECKFLAGS(L2P,L2) 2226 CHECKFLAGS(D1C,D1) 2227 CHECKFLAGS(D1P,D1) 2228 CHECKFLAGS(D2C,D2) 2229 CHECKFLAGS(D2P,D2) 2230 CHECKFLAGS(S1C,S1) 2231 CHECKFLAGS(S1P,S1) 2232 CHECKFLAGS(S2C,S2) 2233 CHECKFLAGS(S2P,S2) 2234 CHECKFLAGS(C5,C5) 2235 CHECKFLAGS(L5,L5) 2236 CHECKFLAGS(D5,D5) 2237 CHECKFLAGS(S5,S5) 2238 CHECKFLAGS(C5AB,C8) 2239 CHECKFLAGS(L5AB,L8) 2240 CHECKFLAGS(D5AB,D8) 2241 CHECKFLAGS(S5AB,S8) 2242 CHECKFLAGS(C5B,C7) 2243 CHECKFLAGS(L5B,L7) 2244 CHECKFLAGS(D5B,D7) 2245 CHECKFLAGS(S5B,S7) 2246 CHECKFLAGS(C6,C6) 2247 CHECKFLAGS(L6,L6) 2248 CHECKFLAGS(D6,D6) 2249 CHECKFLAGS(S6,S6) 2250 /* Skip C1N and SAIF for RINEX2! */ 2251 2252 hdata.data.named.typesofobs = buffer; 2253 i = 1+snprintf(buffer, buffersize, 2254 "%6d%-54.54s# / TYPES OF OBSERV", Parser->info[RTCM3_MSM_GPS].numtypes, tbuffer); 2255 if(Parser->info[RTCM3_MSM_GPS].numtypes>9) 2256 { 2257 i += snprintf(buffer+i-1, buffersize, 2258 "\n %-54.54s# / TYPES OF OBSERV", tbuffer+9*6); 2259 } 2260 if(Parser->info[RTCM3_MSM_GPS].numtypes>18) 2261 { 2262 i += snprintf(buffer+i-1, buffersize, 2263 "\n %-54.54s# / TYPES OF OBSERV", tbuffer+18*6); 2264 } 2265 buffer += i; buffersize -= i; 2266 } 2333 i = HandleObsHeader(Parser, buffer, buffersize, &hdata); 2334 buffer += i; buffersize -= i; 2267 2335 2268 2336 { … … 2543 2611 else if (r == 1 || r == 2) 2544 2612 { 2545 int i, j, o; 2613 int i, j, o, nh=0; 2614 char newheader[512]; 2546 2615 struct converttimeinfo cti; 2547 2616 2548 if(Parser->init < NUMSTARTSKIP) /* skip first epochs to detect correct data types */ 2617 /* skip first epochs to detect correct data types */ 2618 if(Parser->init < (Parser->changeobs ? 1 : NUMSTARTSKIP)) 2549 2619 { 2550 2620 ++Parser->init; 2551 2621 2552 if(Parser->init == NUMSTARTSKIP)2622 if(Parser->init == (Parser->changeobs ? 1 : NUMSTARTSKIP)) 2553 2623 HandleHeader(Parser); 2554 2624 else … … 2568 2638 converttime(&cti, Parser->Data.week, 2569 2639 (int)floor(Parser->Data.timeofweek/1000.0)); 2640 newheader[0] = 0; 2641 if(Parser->changeobs) 2642 { 2643 nh = HandleObsHeader(Parser, newheader, sizeof(newheader), 0); 2644 } 2570 2645 if(Parser->rinex3) 2571 2646 { 2572 RTCM3Text("> %04d %02d %02d %02d %02d%11.7f 0%3d\n",2647 RTCM3Text("> %04d %02d %02d %02d %02d%11.7f %d%3d\n", 2573 2648 cti.year, cti.month, cti.day, cti.hour, cti.minute, cti.second 2574 + fmod(Parser->Data.timeofweek/1000.0,1.0), Parser->Data.numsats); 2649 + fmod(Parser->Data.timeofweek/1000.0,1.0), nh ? 4 : 0, 2650 Parser->Data.numsats); 2651 if(nh) 2652 { 2653 RTCM3Text("%s\n " 2654 " END OF HEADER\n", newheader); 2655 } 2575 2656 for(i = 0; i < Parser->Data.numsats; ++i) 2576 2657 { … … 2882 2963 else 2883 2964 { 2884 RTCM3Text(" %02d %2d %2d %2d %2d %10.7f 0%3d",2965 RTCM3Text(" %02d %2d %2d %2d %2d %10.7f %d%3d", 2885 2966 cti.year%100, cti.month, cti.day, cti.hour, cti.minute, cti.second 2886 + fmod(Parser->Data.timeofweek/1000.0,1.0), Parser->Data.numsats); 2967 + fmod(Parser->Data.timeofweek/1000.0,1.0), nh ? 4 : 0, 2968 Parser->Data.numsats); 2887 2969 for(i = 0; i < 12 && i < Parser->Data.numsats; ++i) 2888 2970 { … … 2957 3039 o += 12; 2958 3040 } 3041 if(nh) 3042 { 3043 RTCM3Text("%s\n " 3044 " END OF HEADER\n", newheader); 3045 } 2959 3046 for(i = 0; i < Parser->Data.numsats; ++i) 2960 3047 { … … 3092 3179 int timeout; 3093 3180 int rinex3; 3181 int changeobs; 3094 3182 const char *user; 3095 3183 const char *password; … … 3119 3207 { "glonassephemeris", required_argument, 0, 'G'}, 3120 3208 { "rinex3", no_argument, 0, '3'}, 3209 { "changeobs", no_argument, 0, 'O'}, 3121 3210 { "proxyport", required_argument, 0, 'R'}, 3122 3211 { "proxyhost", required_argument, 0, 'S'}, … … 3126 3215 {0,0,0,0}}; 3127 3216 #endif 3128 #define ARGOPT "-d:s:p:r:t:f:u:E:G:M:S:R:n:h3 "3217 #define ARGOPT "-d:s:p:r:t:f:u:E:G:M:S:R:n:h3O" 3129 3218 3130 3219 enum MODE { HTTP = 1, RTSP = 2, NTRIP1 = 3, AUTO = 4, END }; … … 3259 3348 args->rinex3 = 0; 3260 3349 args->nmea = 0; 3350 args->changeobs = 0; 3261 3351 args->proxyhost = 0; 3262 3352 args->proxyport = "2101"; … … 3285 3375 case 'n': args->nmea = optarg; break; 3286 3376 case 'R': args->proxyport = optarg; break; 3377 case 'O': args->changeobs = 1; break; 3287 3378 case 'h': help=1; break; 3288 3379 case 'M': … … 3357 3448 " -R " LONG_OPT("--proxyport ") "proxy port, optional (default 2101)\n" 3358 3449 " -n " LONG_OPT("--nmea ") "NMEA string for sending to server\n" 3450 " -O " LONG_OPT("--changeobs ") "Add observation type change header lines\n" 3359 3451 " -M " LONG_OPT("--mode ") "mode for data request\n" 3360 3452 " Valid modes are:\n" … … 3457 3549 Parser.gpsephemeris = args.gpsephemeris; 3458 3550 Parser.rinex3 = args.rinex3; 3551 Parser.changeobs = args.changeobs; 3459 3552 3460 3553 if(args.proxyhost) -
trunk/rtcm3torinex/lib/rtcm3torinex.h
r5332 r5358 36 36 #define PRN_GALILEO_START 71 37 37 #define PRN_GALILEO_END 100 38 #define PRN_GIOVE_START 101 39 #define PRN_GIOVE_END 102 38 40 #define PRN_SBAS_START 120 39 #define PRN_SBAS_END 138 40 #define PRN_GIOVE_START 139 41 #define PRN_GIOVE_END 140 42 #define PRN_COMPASS_START 141 43 #define PRN_COMPASS_END 170 41 #define PRN_SBAS_END 141 42 #define PRN_COMPASS_START 161 43 #define PRN_COMPASS_END 190 44 44 #define PRN_QZSS_START 193 45 45 #define PRN_QZSS_END 202 46 47 #define PRN_GALGIO_START PRN_GALILEO_START 48 #define PRN_GALGIO_END PRN_GIOVE_END 46 49 47 50 #define PRN_GLONASS_NUM (PRN_GLONASS_END-PRN_GLONASS_START+1) … … 470 473 /* For RINEX2 only field GPS is used */ 471 474 struct DataInfo info[RTCM3_MSM_NUMSYS]; 475 int datafields[RINEXENTRY_NUMBER]; /* for RTCM2 header */ 476 char fieldbuffer[6*RINEXENTRY_NUMBER+1]; 477 char fieldbufferSBAS[4*RINEXENTRY_NUMBER+1]; 478 char fieldbufferGPS[4*RINEXENTRY_NUMBER+1]; 479 char fieldbufferGLONASS[4*RINEXENTRY_NUMBER+1]; 480 char fieldbufferGALILEO[4*RINEXENTRY_NUMBER+1]; 481 char fieldbufferCOMPASS[4*RINEXENTRY_NUMBER+1]; 482 char fieldbufferQZSS[4*RINEXENTRY_NUMBER+1]; 483 int numdatafields; /* for RTCM2 */ 472 484 int validwarning; 473 485 int init; 474 486 int startflags; 475 487 int rinex3; 488 int changeobs; 476 489 const char * headerfile; 477 490 const char * glonassephemeris;
Note:
See TracChangeset
for help on using the changeset viewer.