Changeset 10692 in ntrip
- Timestamp:
- Jul 8, 2025, 10:07:50 AM (5 months ago)
- Location:
- trunk/BNC/src
- Files:
-
- 4 edited
-
GPSDecoder.h (modified) (6 diffs)
-
RTCM/RTCM2Decoder.cpp (modified) (5 diffs)
-
RTCM3/RTCM3Decoder.cpp (modified) (10 diffs)
-
bncgetthread.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/GPSDecoder.h
r10691 r10692 62 62 struct t_typeInfo { 63 63 t_typeInfo() { 64 type = 0; 65 size = 0; 64 _type = 0; 65 _size = 0; 66 66 }; 67 int type; 68 size_t size; 67 int _type; 68 size_t _size; 69 69 }; 70 70 … … 74 74 75 75 t_antRefPoint() { 76 xx = yy = zz =height = 0.0;77 type = ARP; 78 height_f = false; 79 message = 0; 76 _xx = _yy = _zz = _height = 0.0; 77 _type = ARP; 78 _height_f = false; 79 _message = 0; 80 80 }; 81 81 82 double xx; 83 double yy; 84 double zz; 85 t_type type; 86 double height; 87 bool height_f; 88 int message; 82 double _xx; 83 double _yy; 84 double _zz; 85 t_type _type; 86 double _height; 87 bool _height_f; 88 int _message; 89 89 }; 90 90 … … 92 92 t_antInfo() { 93 93 }; 94 char descriptor[256]; 95 char serialnumber[256]; 94 char _descriptor[256]; 95 char _serialnumber[256]; 96 96 }; 97 97 … … 99 99 t_recInfo() { 100 100 }; 101 char descriptor[256]; 102 char serialnumber[256]; 103 char firmware[256]; 101 char _descriptor[256]; 102 char _serialnumber[256]; 103 char _firmware[256]; 104 104 }; 105 105 … … 107 107 public: 108 108 t_GloBiasInfo() { 109 clear();109 init(); 110 110 }; 111 bool operator==(const t_GloBiasInfo& biasInfo2) const { 112 if (staID == biasInfo2.staID && 113 indicator == biasInfo2.indicator && 114 L1C_value == biasInfo2.L1C_value && 115 L1P_value == biasInfo2.L1P_value && 116 L2C_value == biasInfo2.L2C_value && 117 L2P_value == biasInfo2.L2P_value ) { 111 bool operator!=(const t_GloBiasInfo& gloBiasInfo2) { 112 113 if (_staID != gloBiasInfo2._staID || 114 _indicator != gloBiasInfo2._indicator || 115 (fabs(_L1C_value - gloBiasInfo2._L1C_value) > 0.000000000001 ) || 116 (fabs(_L1P_value - gloBiasInfo2._L1P_value) > 0.000000000001 ) || 117 (fabs(_L2C_value - gloBiasInfo2._L2C_value) > 0.000000000001 ) || 118 (fabs(_L2P_value - gloBiasInfo2._L2P_value) > 0.000000000001 ) ) { 119 setChanged(true); 118 120 return true; 119 121 } 120 122 else { 123 setChanged(false); 121 124 return false; 122 125 } 123 126 } 124 127 125 void set(const t_GloBiasInfo& biasInfo) { 126 staID = biasInfo.staID; 127 indicator = biasInfo.indicator; 128 L1C_value = biasInfo.L1C_value; 129 L1P_value = biasInfo.L1P_value; 130 L2C_value = biasInfo.L2C_value; 131 L2P_value = biasInfo.L2P_value; 132 changed = true; 128 void set(const t_GloBiasInfo& gloBiasInfo) { 129 _staID = gloBiasInfo._staID; 130 _indicator = gloBiasInfo._indicator; 131 _L1C_value = gloBiasInfo._L1C_value; 132 _L1P_value = gloBiasInfo._L1P_value; 133 _L2C_value = gloBiasInfo._L2C_value; 134 _L2P_value = gloBiasInfo._L2P_value; 133 135 } 134 135 void clear() { 136 staID = 0; 137 indicator = 0; 138 L1C_value = 0.0; 139 L1P_value = 0.0; 140 L2C_value = 0.0; 141 L2P_value = 0.0; 142 changed = false; 136 void setChanged(bool changed) { 137 _changed = changed; 138 } 139 bool changed() {return _changed;}; 140 void init() { 141 _staID = 0; 142 _indicator = 1; 143 _L1C_value = 0.0; 144 _L1P_value = 0.0; 145 _L2C_value = 0.0; 146 _L2P_value = 0.0; 147 _changed = false; 143 148 } 144 149 QString toString() { 145 QString biasIndicator = (indicator == 1) ? QString("aligned") : QString("unaligned"); 150 QString biasIndicator = (_indicator == 1) ? QString("aligned") : QString("unaligned"); 146 151 QString biasesStr = 147 152 QString(": GLONASS L1/L2 Code-Phase Biases: staID=%1 indicator=%2 L1C=%3 L1P=%4 L2C=%5 L2P=%6") 148 .arg(staID).arg(biasIndicator) 149 .arg(L1C_value, 0, 'f', 2) 150 .arg(L1P_value, 0, 'f', 2) 151 .arg(L2C_value, 0, 'f', 2) 152 .arg(L2P_value, 0, 'f', 2); 153 .arg(_staID).arg(biasIndicator) 154 .arg(_L1C_value, 0, 'f', 2) 155 .arg(_L1P_value, 0, 'f', 2) 156 .arg(_L2C_value, 0, 'f', 2) 157 .arg(_L2P_value, 0, 'f', 2); 153 158 154 159 return biasesStr; 155 160 } 156 int staID; 157 int indicator; 158 double L1C_value; 159 double L1P_value; 160 double L2C_value; 161 double L2P_value; 162 bool changed; 161 162 int _staID; 163 int _indicator; 164 double _L1C_value; 165 double _L1P_value; 166 double _L2C_value; 167 double _L2P_value; 168 bool _changed; 163 169 164 170 … … 175 181 QList<t_rtcmCrs> _rtcmCrs; // RTCM CRS 176 182 QString _gloFrq; // GLONASS slot 177 t_GloBiasInfo _gloBias es; // RTCM GLO bias information message183 t_GloBiasInfo _gloBiasInfo; // RTCM GLO bias information message 178 184 bncRinex* _rnx; // RINEX writer 179 185 }; -
trunk/BNC/src/RTCM/RTCM2Decoder.cpp
r10688 r10692 118 118 } 119 119 120 // Store message number 120 // Store _message number 121 121 _typeList.push_back(t_typeInfo()); 122 _typeList.back().type = _PP.ID(); 122 _typeList.back()._type = _PP.ID(); 123 123 //_typeList.back().size = 0; 124 124 … … 210 210 _antList.push_back(t_antRefPoint()); 211 211 212 this->getStaCrd(_antList.back().xx, _antList.back().yy, _antList.back().zz); 213 214 _antList.back().type = t_antRefPoint::APC; 215 _antList.back().message = _PP.ID(); 212 this->getStaCrd(_antList.back()._xx, _antList.back()._yy, _antList.back()._zz); 213 214 _antList.back()._type = t_antRefPoint::APC; 215 _antList.back()._message = _PP.ID(); 216 216 } 217 217 } else if (_PP.ID() == 23) { … … 220 220 int serlen = strlen(_msg23.antSN.c_str()); 221 221 if ((antlen) && 222 (_antType.empty() || strncmp(_antType.back().descriptor, _msg23.antType.c_str(), antlen) != 0)) { 222 (_antType.empty() || strncmp(_antType.back()._descriptor, _msg23.antType.c_str(), antlen) != 0)) { 223 223 _antType.push_back(t_antInfo()); 224 memcpy(_antType.back().descriptor, _msg23.antType.c_str(), antlen); 225 _antType.back().descriptor[antlen] = 0; 224 memcpy(_antType.back()._descriptor, _msg23.antType.c_str(), antlen); 225 _antType.back()._descriptor[antlen] = 0; 226 226 if (serlen) { 227 memcpy(_antType.back().serialnumber, _msg23.antSN.c_str(), serlen); 228 _antType.back().serialnumber[serlen] = 0; 227 memcpy(_antType.back()._serialnumber, _msg23.antSN.c_str(), serlen); 228 _antType.back()._serialnumber[serlen] = 0; 229 229 } 230 230 } … … 234 234 _antList.push_back(t_antRefPoint()); 235 235 236 _antList.back().xx = _msg24.x; 237 _antList.back().yy = _msg24.y; 238 _antList.back().zz = _msg24.z; 239 240 _antList.back().height_f = true; 241 _antList.back().height = _msg24.h; 242 243 _antList.back().type = t_antRefPoint::ARP; 244 _antList.back().message = _PP.ID(); 236 _antList.back()._xx = _msg24.x; 237 _antList.back()._yy = _msg24.y; 238 _antList.back()._zz = _msg24.z; 239 240 _antList.back()._height_f = true; 241 _antList.back()._height = _msg24.h; 242 243 _antList.back()._type = t_antRefPoint::ARP; 244 _antList.back()._message = _PP.ID(); 245 245 } 246 246 } … … 265 265 currentGPSWeeks(refWeek, refSecs); 266 266 267 // Resolve receiver time of measurement (see RTCM 2.3, page 4-42, Message 18, Note 1)267 // Resolve receiver time of measurement (see RTCM 2.3, page 4-42, message 18, Note 1) 268 268 // ---------------------------------------------------------------------------------- 269 269 double hoursec_est = _msg2021.hoursec(); // estimated time of measurement -
trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
r10688 r10692 1958 1958 char *antserialnum; 1959 1959 char *receiver; 1960 char *recfirmware; 1960 char *rec_firmware; 1961 1961 char *recserialnum; 1962 1962 int type; … … 1975 1975 GETSTRING(antnum, antenna) 1976 1976 if ((antnum > -1 && antnum < 265) && 1977 (_antType.empty() || strncmp(_antType.back().descriptor, antenna, recnum) != 0)) { 1977 (_antType.empty() || strncmp(_antType.back()._descriptor, antenna, recnum) != 0)) { 1978 1978 _antType.push_back(t_antInfo()); 1979 memcpy(_antType.back().descriptor, antenna, antnum); 1980 _antType.back().descriptor[antnum] = 0; 1979 memcpy(_antType.back()._descriptor, antenna, antnum); 1980 _antType.back()._descriptor[antnum] = 0; 1981 1981 } 1982 1982 SKIPBITS(8) /* antenna setup ID */ … … 1984 1984 GETSTRING(antsernum, antserialnum) 1985 1985 if ((antsernum > -1 && antsernum < 265)) { 1986 memcpy(_antType.back().serialnumber, antserialnum, antsernum); 1987 _antType.back().serialnumber[antsernum] = 0; 1986 memcpy(_antType.back()._serialnumber, antserialnum, antsernum); 1987 _antType.back()._serialnumber[antsernum] = 0; 1988 1988 } 1989 1989 } … … 1991 1991 if (type == 1033) { 1992 1992 GETSTRING(recnum, receiver) 1993 GETSTRING(recfirnum, recfirmware) 1993 GETSTRING(recfirnum, rec_firmware) 1994 1994 GETSTRING(recsernum, recserialnum) 1995 1995 if ((recnum > -1 && recnum < 265) && 1996 (_recType.empty() || strncmp(_recType.back().descriptor, receiver, recnum) != 0)) { 1996 (_recType.empty() || strncmp(_recType.back()._descriptor, receiver, recnum) != 0)) { 1997 1997 _recType.push_back(t_recInfo()); 1998 memcpy(_recType.back().descriptor, receiver, recnum); 1999 _recType.back().descriptor[recnum] = 0; 1998 memcpy(_recType.back()._descriptor, receiver, recnum); 1999 _recType.back()._descriptor[recnum] = 0; 2000 2000 if (recfirnum > -1 && recfirnum < 265) { 2001 memcpy(_recType.back().firmware, recfirmware, recfirnum); 2002 _recType.back().firmware[recfirnum] = 0; 2001 memcpy(_recType.back()._firmware, rec_firmware, recfirnum); 2002 _recType.back()._firmware[recfirnum] = 0; 2003 2003 } 2004 2004 if (recsernum > -1 && recsernum < 265) { 2005 memcpy(_recType.back().serialnumber, recserialnum, recsernum); 2006 _recType.back().serialnumber[recsernum] = 0; 2005 memcpy(_recType.back()._serialnumber, recserialnum, recsernum); 2006 _recType.back()._serialnumber[recsernum] = 0; 2007 2007 } 2008 2008 } … … 2023 2023 GETBITS(type, 12) 2024 2024 _antList.push_back(t_antRefPoint()); 2025 _antList.back().type = t_antRefPoint::ARP; 2025 _antList.back()._type = t_antRefPoint::ARP; 2026 2026 SKIPBITS(22) 2027 2027 GETBITSSIGN(x, 38) 2028 _antList.back().xx = x * 1e-4; 2028 _antList.back()._xx = x * 1e-4; 2029 2029 SKIPBITS(2) 2030 2030 GETBITSSIGN(y, 38) 2031 _antList.back().yy = y * 1e-4; 2031 _antList.back()._yy = y * 1e-4; 2032 2032 SKIPBITS(2) 2033 2033 GETBITSSIGN(z, 38) 2034 _antList.back().zz = z * 1e-4; 2034 _antList.back()._zz = z * 1e-4; 2035 2035 if (type == 1006) { 2036 2036 double h; 2037 2037 GETBITS(h, 16) 2038 _antList.back().height = h * 1e-4; 2039 _antList.back().height_f = true; 2040 } 2041 _antList.back().message = type; 2038 _antList.back()._height = h * 1e-4; 2039 _antList.back()._height_f = true; 2040 } 2041 _antList.back()._message = type; 2042 2042 2043 2043 return true; … … 2047 2047 //////////////////////////////////////////////////////////////////////////// 2048 2048 bool RTCM3Decoder::DecodeGLONASSCodePhaseBiases(unsigned char* data, int size) { 2049 t_GloBiasInfo gloBiases; 2049 t_GloBiasInfo gloBiasInfo; 2050 int i = 0; 2050 2051 uint64_t numbits = 0, bitfield = 0; 2051 2052 … … 2054 2055 2055 2056 SKIPBITS(12) // Message Number 2056 GETBITS(gloBias es.staID, 12)2057 GETBITS(gloBias es.indicator, 1) // 0.. not aligned, 1.. aligned2057 GETBITS(gloBiasInfo._staID, 12) 2058 GETBITS(gloBiasInfo._indicator, 1) // 0.. not aligned, 1.. aligned 2058 2059 SKIPBITS(3) // reserved bits 2059 unsigned bitmask; 2060 unsigned int bitmask; 2060 2061 GETBITS(bitmask, 4) 2061 2062 bool L1C_valid = bitExtracted(unsigned(bitmask), 1, 0); … … 2065 2066 2066 2067 if (L1C_valid) { 2067 GETBITS(gloBiases.L1C_value, 16) 2068 GETBITSSIGN(i, 16) 2069 gloBiasInfo._L1C_value = i * 0.02; 2068 2070 } 2069 2071 if (L1P_valid) { 2070 GETBITS(gloBiases.L1P_value, 16) 2072 GETBITSSIGN(i, 16) 2073 gloBiasInfo._L1P_value = i * 0.02; 2071 2074 } 2072 2075 if (L2C_valid) { 2073 GETBITS(gloBiases.L2C_value, 16) 2076 GETBITSSIGN(i, 16) 2077 gloBiasInfo._L2C_value = i * 0.02; 2074 2078 } 2075 2079 if (L2P_valid) { 2076 GETBITS(gloBiases.L2P_value, 16) 2077 } 2078 2079 if (!(_gloBiases == gloBiases)) { 2080 _gloBiases.set(gloBiases); 2080 GETBITSSIGN(i, 16) 2081 gloBiasInfo._L2P_value = i * 0.02; 2082 } 2083 2084 if (_gloBiasInfo != gloBiasInfo) { 2085 _gloBiasInfo.set(gloBiasInfo); 2081 2086 } 2082 2087 … … 2251 2256 /* store the id and message size into the list of loaded blocks */ 2252 2257 _typeList.push_back(t_typeInfo()); 2253 _typeList.back().type = id; 2254 _typeList.back().size = _BlockSize -6; /* header + crc */ 2258 _typeList.back()._type = id; 2259 _typeList.back()._size = _BlockSize -6; /* header + crc */ 2255 2260 2256 2261 /* SSR I+II data handled in another function, already pass the … … 2274 2279 } 2275 2280 } 2276 else if (id >= 1070 && id <= 1 237) { /* MSM */2281 else if (id >= 1070 && id <= 1137) { /* MSM */ 2277 2282 if (DecodeRTCM3MSM(_Message, _BlockSize)) 2278 2283 decoded = true; -
trunk/BNC/src/bncgetthread.cpp
r10688 r10692 572 572 } 573 573 while (it.hasNext()) { 574 int rtcmType = it.next().type; 574 int rtcmType = it.next()._type; 575 575 if ((rtcmType >= 1001 && rtcmType <= 1004) || // legacy RTCM OBS 576 576 (rtcmType >= 1009 && rtcmType <= 1012) || // legacy RTCM OBS … … 818 818 // ------------------ 819 819 for (int ii = 0; ii < decoder()->_typeList.size(); ii++) { 820 QString type = QString("%1 ").arg(decoder()->_typeList[ii].type); 821 QString size = (decoder()->_typeList[ii].size) ? QString("(size %1)").arg(decoder()->_typeList[ii].size) : ""; 820 QString type = QString("%1 ").arg(decoder()->_typeList[ii]._type); 821 QString size = (decoder()->_typeList[ii]._size) ? QString("(size %1)").arg(decoder()->_typeList[ii]._size) : ""; 822 822 emit(newMessage(_staID + ": Received message type " + type.toLatin1() + size.toLatin1(), true)); 823 823 } … … 897 897 // ------------------------- 898 898 for (int ii = 0; ii < decoder()->_antType.size(); ii++) { 899 QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii].descriptor); 899 QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii]._descriptor); 900 900 emit(newMessage(_staID + ant1.toLatin1(), true)); 901 if (strlen(decoder()->_antType[ii].serialnumber)) { 902 QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii].serialnumber); 901 if (strlen(decoder()->_antType[ii]._serialnumber)) { 902 QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii]._serialnumber); 903 903 emit(newMessage(_staID + ant2.toLatin1(), true)); 904 904 } … … 909 909 for (int ii = 0; ii < decoder()->_antList.size(); ii++) { 910 910 QByteArray antT; 911 if (decoder()->_antList[ii].type == GPSDecoder::t_antRefPoint::ARP) { 911 if (decoder()->_antList[ii]._type == GPSDecoder::t_antRefPoint::ARP) { 912 912 antT = "ARP"; 913 } else if (decoder()->_antList[ii].type == GPSDecoder::t_antRefPoint::APC) { 913 } else if (decoder()->_antList[ii]._type == GPSDecoder::t_antRefPoint::APC) { 914 914 antT = "APC"; 915 915 } 916 916 QByteArray ant1, ant2, ant3; 917 ant1 = QString("%1 ").arg(decoder()->_antList[ii].xx, 0, 'f', 4).toLatin1(); 918 ant2 = QString("%1 ").arg(decoder()->_antList[ii].yy, 0, 'f', 4).toLatin1(); 919 ant3 = QString("%1 ").arg(decoder()->_antList[ii].zz, 0, 'f', 4).toLatin1(); 917 ant1 = QString("%1 ").arg(decoder()->_antList[ii]._xx, 0, 'f', 4).toLatin1(); 918 ant2 = QString("%1 ").arg(decoder()->_antList[ii]._yy, 0, 'f', 4).toLatin1(); 919 ant3 = QString("%1 ").arg(decoder()->_antList[ii]._zz, 0, 'f', 4).toLatin1(); 920 920 emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true)); 921 921 emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true)); 922 922 emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true)); 923 923 double hh = 0.0; 924 if (decoder()->_antList[ii].height_f) { 925 hh = decoder()->_antList[ii].height; 924 if (decoder()->_antList[ii]._height_f) { 925 hh = decoder()->_antList[ii]._height; 926 926 QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toLatin1(); 927 927 emit(newMessage( 928 928 _staID + ": Antenna height above marker " + ant4 + "m", true)); 929 929 } 930 emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 931 decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, hh, antT)); 930 emit(newAntCrd(_staID, decoder()->_antList[ii]._xx, 931 decoder()->_antList[ii]._yy, decoder()->_antList[ii]._zz, hh, antT)); 932 932 } 933 933 … … 935 935 // -------------------------- 936 936 for (int ii = 0; ii < decoder()->_recType.size(); ii++) { 937 QString rec1 = QString(": Receiver Descriptor: %1 ").arg(decoder()->_recType[ii].descriptor); 938 QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii].firmware); 939 QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii].serialnumber); 937 QString rec1 = QString(": Receiver Descriptor: %1 ").arg(decoder()->_recType[ii]._descriptor); 938 QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii]._firmware); 939 QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii]._serialnumber); 940 940 emit(newMessage(_staID + rec1.toLatin1(), true)); 941 941 emit(newMessage(_staID + rec2.toLatin1(), true)); … … 963 963 // RTCM GLONASS Code-Phase biases (MT 1230) 964 964 // ---------------------------------------- 965 if (decoder()->_gloBias es.changed) {966 QString gloCodePhaseBiases = decoder()->_gloBias es.toString();965 if (decoder()->_gloBiasInfo.changed()) { 966 QString gloCodePhaseBiases = decoder()->_gloBiasInfo.toString(); 967 967 emit(newMessage(_staID + gloCodePhaseBiases.toLatin1(), true)); 968 decoder()->_gloBiasInfo.setChanged(false); 968 969 } 969 970
Note:
See TracChangeset
for help on using the changeset viewer.
