Changeset 10534 in ntrip for trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
- Timestamp:
- Sep 17, 2024, 4:56:38 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r10236 r10534 53 53 #include "bncutils.h" 54 54 #include "bncsettings.h" 55 #include "bnctime.h" 56 #include "crs.h" 55 57 56 58 using namespace std; … … 481 483 sys = 'J'; 482 484 } 483 else if (type >= 1101 && type <= 1 007) {485 else if (type >= 1101 && type <= 1107) { 484 486 sys = 'S'; 485 487 } … … 1730 1732 GETBITSSIGN(z, 38) 1731 1733 _antList.back().zz = z * 1e-4; 1732 if (type == 1006) 1733 { 1734 if (type == 1006) { 1734 1735 double h; 1735 1736 GETBITS(h, 16) … … 1741 1742 return true; 1742 1743 } 1744 1745 // 1746 //////////////////////////////////////////////////////////////////////////// 1747 bool RTCM3Decoder::DecodeServiceCRS(unsigned char* data, int size) { 1748 t_serviceCrs serviceCrs; 1749 int servicecrsnum = -1; 1750 1751 uint64_t numbits = 0, bitfield = 0; 1752 1753 data += 3; // header 1754 size -= 6; // header + crc 1755 1756 SKIPBITS(12) // Message Number 1757 1758 GETBITS(servicecrsnum, 5) 1759 if (servicecrsnum > -1 && servicecrsnum <= 31) { 1760 for(int i = 0; i < servicecrsnum; i++) { 1761 GETBITS(serviceCrs._name[i], 8); 1762 } 1763 serviceCrs._name[servicecrsnum] = 0; 1764 } 1765 if (_serviceCrs.empty() || 1766 (strncmp(_serviceCrs.back()._name, serviceCrs._name, servicecrsnum) != 0)) { 1767 _serviceCrs.push_back(serviceCrs); 1768 GETFLOAT(_serviceCrs.back()._CE, 16, 1/100.0) 1769 _serviceCrs.back().setCoordinateEpochFromCE(); 1770 _serviceCrs.back().print(); 1771 } 1772 return true; 1773 1774 } 1775 1776 // 1777 //////////////////////////////////////////////////////////////////////////// 1778 bool RTCM3Decoder::DecodeRTCMCRS(unsigned char* data, int size) { 1779 1780 t_rtcmCrs rtcmCrs; 1781 int rtcmcrsnum = -1; 1782 1783 uint64_t numbits = 0, bitfield = 0; 1784 1785 data += 3; // header 1786 size -= 6; // header + crc 1787 1788 SKIPBITS(12) // Message Number 1789 GETBITS(rtcmcrsnum, 5) 1790 if (rtcmcrsnum > -1 && rtcmcrsnum <= 31) { 1791 for(int i = 0; i < rtcmcrsnum; i++) { 1792 GETBITS(rtcmCrs._name[i], 8); 1793 } 1794 rtcmCrs._name[rtcmcrsnum] = 0; 1795 } 1796 if (_rtcmCrs.empty() || 1797 (strncmp(_rtcmCrs.back()._name, rtcmCrs._name, rtcmcrsnum) != 0)) { 1798 _rtcmCrs.push_back(rtcmCrs); 1799 1800 GETBITS(_rtcmCrs.back()._anchor, 1) 1801 GETBITS(_rtcmCrs.back()._plateNumber, 5) 1802 1803 int dblinksnum = 0; 1804 GETBITS(dblinksnum, 3) 1805 for (int i = 0; i < dblinksnum; i++) { 1806 int dblinknum = -1; 1807 char dblinkname[31]; 1808 GETBITS(dblinknum, 5) 1809 if (dblinknum > -1 && dblinknum <= 31) { 1810 for(int i = 0; i < dblinknum; i++) { 1811 GETBITS(dblinkname[i], 8); 1812 } 1813 dblinkname[dblinknum] = 0; 1814 _rtcmCrs.back()._databaseLinks.append(QString("%1").arg(dblinkname)); 1815 } 1816 } 1817 _rtcmCrs.back().print(); 1818 } 1819 1820 return true; 1821 } 1822 1823 1824 //////////////////////////////////////////////////////////////////////////// 1825 bool RTCM3Decoder::DecodeHelmertTrafoParameters(unsigned char* data, int size) { 1826 1827 t_helmertPar helmertPar; 1828 int sourcenum = -1; 1829 int targetnum = -1; 1830 1831 uint64_t numbits = 0, bitfield = 0; 1832 data += 3; // header 1833 size -= 6; // header + crc 1834 1835 SKIPBITS(12) // Message Number 1836 GETBITS(sourcenum, 5) 1837 if (sourcenum > -1 && sourcenum <= 31) { 1838 for(int i = 0; i < sourcenum; i++) { 1839 GETBITS(helmertPar._sourceName[i], 8); 1840 } 1841 helmertPar._sourceName[sourcenum] = 0; 1842 } 1843 GETBITS(targetnum, 5) 1844 if (targetnum > -1 && targetnum <= 31) { 1845 for(int i = 0; i < targetnum; i++) { 1846 GETBITS(helmertPar._targetName[i], 8); 1847 } 1848 helmertPar._targetName[targetnum] = 0; 1849 } 1850 GETBITS(helmertPar._sysIdentNum, 8) 1851 GETBITS(helmertPar._utilTrafoMessageIndicator, 10) 1852 int mjd; 1853 GETBITS(mjd, 16) 1854 helmertPar._t0 = mjd + 44244; 1855 1856 // delete old parameter entries if available 1857 if (!_helmertPar.empty()) { 1858 QList<t_helmertPar>::iterator it = _helmertPar.begin(); 1859 while (it != _helmertPar.end()) { 1860 (helmertPar == *it) ? it = _helmertPar.erase(it) : ++it; 1861 } 1862 } 1863 _helmertPar.push_back(helmertPar); 1864 1865 GETFLOATSIGN(_helmertPar.back()._dx, 23, 0.001) 1866 GETFLOATSIGN(_helmertPar.back()._dy, 23, 0.001) 1867 GETFLOATSIGN(_helmertPar.back()._dz, 23, 0.001) 1868 GETFLOATSIGN(_helmertPar.back()._ox, 32, 0.00002) 1869 GETFLOATSIGN(_helmertPar.back()._oy, 32, 0.00002) 1870 GETFLOATSIGN(_helmertPar.back()._oz, 32, 0.00002) 1871 GETFLOATSIGN(_helmertPar.back()._sc, 25, 0.00001) 1872 GETFLOATSIGN(_helmertPar.back()._dxr, 17, 0.00002) 1873 GETFLOATSIGN(_helmertPar.back()._dyr, 17, 0.00002) 1874 GETFLOATSIGN(_helmertPar.back()._dzr, 17, 0.00002) 1875 GETFLOATSIGN(_helmertPar.back()._oxr, 17, 0.0000004) 1876 GETFLOATSIGN(_helmertPar.back()._oyr, 17, 0.0000004) 1877 GETFLOATSIGN(_helmertPar.back()._ozr, 17, 0.0000004) 1878 GETFLOATSIGN(_helmertPar.back()._scr, 14, 0.0000002) 1879 1880 _helmertPar.back().print(); 1881 1882 return true; 1883 } 1884 1743 1885 1744 1886 // … … 1853 1995 DecodeAntennaPosition(_Message, _BlockSize); 1854 1996 break; 1997 case 1300: 1998 DecodeServiceCRS(_Message, _BlockSize); 1999 break; 2000 case 1301: 2001 DecodeHelmertTrafoParameters(_Message, _BlockSize); 2002 break; 2003 case 1302: 2004 case 35: 2005 DecodeRTCMCRS(_Message, _BlockSize); 2006 break; 1855 2007 } 1856 2008 } 1857 2009 } 1858 2010 } 2011 /* 2012 for (int ii = 0; ii < _helmertParList.size(); ii++) { 2013 _helmertParList[ii].print(); 2014 }*/ 1859 2015 return decoded ? success : failure; 1860 2016 } 1861 ;1862 2017 1863 2018 //
Note:
See TracChangeset
for help on using the changeset viewer.