Changeset 9205 in ntrip for branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp
 Timestamp:
 Nov 3, 2020, 1:15:38 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp
r9193 r9205 936 936 if ((i & ((1 << 20)  1)) != 0x80000) { 937 937 frqObs>_code = l1range * 0.02; 938 frqObs>_phase = (l1range * 0.02 + i * 0.0005) 939 / GLO_WAVELENGTH_L1(freq  7); 938 frqObs>_phase = (l1range * 0.02 + i * 0.0005) / GLO_WAVELENGTH_L1(freq  7); 940 939 frqObs>_codeValid = frqObs>_phaseValid = true; 941 940 } … … 1047 1046 GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29)) 1048 1047 GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19)) 1049 if (eph._sqrt_A < 1000.0) {return false;} 1048 if (eph._sqrt_A < 1000.0) { 1049 emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!") 1050 .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()) 1051 .arg(eph._sqrt_A,10,'F',3).toAscii(), true)); 1052 return false; 1053 } 1050 1054 GETBITS(i, 16) 1051 1055 i <<= 4; … … 1102 1106 GETBITS(eph._almanac_health, 1) /* almanac healthy */ 1103 1107 GETBITS(eph._almanac_health_availablility_indicator, 1) /* almanac health ok */ 1104 if (eph._almanac_health_availablility_indicator == 0.0) {return false;} 1108 if (eph._almanac_health_availablility_indicator == 0.0) { 1109 emit(newMessage(QString("%1: Block %2 (%3): ALM = %4: missing data!") 1110 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()) 1111 .arg(eph._almanac_health_availablility_indicator).toAscii(), true)); 1112 return false; 1113 } 1105 1114 GETBITS(eph._P1, 2) /* P1 */ 1106 1115 GETBITS(i, 5) … … 1138 1147 GETBITS(eph._M_FT, 4) /* GLONASSM Ft */ 1139 1148 GETBITS(eph._M_NT, 11) /* GLONASSM Nt */ 1140 if (eph._M_NT == 0.0) {return false;} 1149 if (eph._M_NT == 0.0) { 1150 emit(newMessage(QString("%1: Block %2 (%3): NT = %4: missing data!") 1151 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()).arg(eph._M_NT,4).toAscii(), true)); 1152 return false; 1153 } 1141 1154 GETBITS(eph._M_M, 2) /* GLONASSM M */ 1142 1155 GETBITS(eph._additional_data_availability, 1) /* GLONASSM The Availability of Additional Data */ 1143 if (eph._additional_data_availability == 0.0) {return false;} 1156 if (eph._additional_data_availability == 0.0) { 1157 emit(newMessage(QString("%1: Block %2 (%3): ADD = %4: missing data!") 1158 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()) 1159 .arg(eph._additional_data_availability).toAscii(), true)); 1160 return false; 1161 } 1144 1162 GETBITS(eph._NA, 11) /* GLONASSM Na */ 1145 1163 GETFLOATSIGNM(eph._tauC, 32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */ … … 1156 1174 eph._xv(2) = eph._y_pos * 1.e3; 1157 1175 eph._xv(3) = eph._z_pos * 1.e3; 1176 if (eph._xv.Rows(1,3).NormFrobenius() < 1.0) { 1177 emit(newMessage(QString("%1: Block %2 (%3): zero position!") 1178 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()).toAscii(), true)); 1179 return false; 1180 } 1158 1181 eph._xv(4) = eph._x_velocity * 1.e3; 1159 1182 eph._xv(5) = eph._y_velocity * 1.e3; 1160 1183 eph._xv(6) = eph._z_velocity * 1.e3; 1161 1184 if (eph._xv.Rows(4,6).NormFrobenius() < 1.0) { 1185 emit(newMessage(QString("%1: Block %2 (%3): zero velocity!") 1186 .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str()).toAscii(), true)); 1187 return false; 1188 } 1162 1189 GLOFreq[sv  1] = 100 + eph._frequency_number ; /* store frequency for other users (MSM) */ 1163 1190 _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0); … … 1204 1231 GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29)) 1205 1232 GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19)) 1206 if (eph._sqrt_A < 1000.0) {return false;} 1233 if (eph._sqrt_A < 1000.0) { 1234 emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!") 1235 .arg(_staID).arg(1044,4).arg(eph._prn.toString().c_str()) 1236 .arg(eph._sqrt_A,10,'F',3).toAscii(), true)); 1237 return false; 1238 } 1207 1239 GETBITS(i, 16) 1208 1240 i <<= 4; … … 1313 1345 GETFLOAT(eph._e, 32, 1.0 / (double )(1 << 30) / (double )(1 << 3)) 1314 1346 GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19)) 1315 if (eph._sqrt_A < 1000.0) {return false;} 1347 if (eph._sqrt_A < 1000.0) { 1348 emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!") 1349 .arg(_staID).arg(1041,4).arg(eph._prn.toString().c_str()) 1350 .arg(eph._sqrt_A,10,'F',3).toAscii(), true)); 1351 return false; 1352 } 1316 1353 GETFLOATSIGN(eph._OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<< 1)) 1317 1354 GETFLOATSIGN(eph._omega, 32, R2R_PI/(double)(1<<30)/(double)(1<< 1)) … … 1355 1392 GETFLOATSIGN(eph._y_pos, 30, 0.08) 1356 1393 GETFLOATSIGN(eph._z_pos, 25, 0.4) 1394 ColumnVector pos(3); 1395 pos(1) = eph._x_pos; pos(2) = eph._y_pos; pos(3) = eph._z_pos; 1396 if (pos.NormFrobenius() < 1.0) { 1397 emit(newMessage(QString("%1: Block %2 (%3): zero position!") 1398 .arg(_staID).arg(1043,4).arg(eph._prn.toString().c_str()).toAscii(), true)); 1399 return false; 1400 } 1357 1401 GETFLOATSIGN(eph._x_velocity, 17, 0.000625) 1358 1402 GETFLOATSIGN(eph._y_velocity, 17, 0.000625) … … 1411 1455 GETFLOATSIGN(eph._Cus, 16, 1.0 / (double )(1 << 29)) 1412 1456 GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19)) 1413 if (eph._sqrt_A < 1000.0) {return false;}1414 1457 GETBITSFACTOR(eph._TOEsec, 14, 60) 1415 1458 /* FIXME: overwrite value, copied from old code */ … … 1434 1477 GETBITS(eph._e1DataInValid, 1) 1435 1478 if (eph._E5bHS != eph._E1_bHS) { 1479 emit(newMessage(QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!") 1480 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1481 .arg(eph._E5bHS).arg(eph._E1_bHS).toAscii(), true)); 1436 1482 return false; 1437 1483 } 1438 1484 if ((eph._BGD_1_5A == 0.0 && fabs(eph._BGD_1_5B) > 1e9)  1439 1485 (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e9)) { 1486 emit(newMessage(QString("%1: Block %2 (%3) BGD_15a = %4 BGD_15b = %5: inconsistent BGD!") 1487 .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str()) 1488 .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toAscii(), true)); 1440 1489 return false; 1441 1490 } … … 1453 1502 } 1454 1503 eph._TOT = 0.9999e9; 1504 1505 if (eph._sqrt_A < 1000.0) { 1506 emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!") 1507 .arg(_staID).arg(eph._inav? 1046 : 1045,4).arg(eph._prn.toString().c_str()) 1508 .arg(eph._sqrt_A,10,'F',3).toLatin1(), true)); 1509 return false; 1510 } 1455 1511 1456 1512 emit newGalileoEph(eph); … … 1499 1555 GETFLOATSIGN(eph._Cus, 18, 1.0 / (double )(1 << 30) / (double )(1 << 1)) 1500 1556 GETFLOAT(eph._sqrt_A, 32, 1.0 / (double )(1 << 19)) 1501 if (eph._sqrt_A < 1000.0) {return false;} 1502 GETBITS(i, 17) 1557 if (eph._sqrt_A < 1000.0) { 1558 emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!") 1559 .arg(_staID).arg(1042,4).arg(eph._prn.toString().c_str()) 1560 .arg(eph._sqrt_A,10,'F',3).toAscii(), true)); 1561 return false; 1562 } 1563 GETBITS(i, 17) 1503 1564 i <<= 3; 1504 1565 eph._TOEsec = i; … … 1692 1753 case 1045: 1693 1754 case 1046: 1694 // reject 1045/1046 from JAXA RTKLIB encoded stations1695 1755 if (_staID.contains("AIRA")  _staID.contains("STK2")  1696 1756 _staID.contains("CCJ2")  _staID.contains("SYOG")) { 1757 emit(newMessage(QString("%1: Block temporary %2 from JAXA RTKLIB encoded stations!") 1758 .arg(_staID).arg(id).toAscii(), true)); 1697 1759 break; 1698 1760 } … … 1725 1787 uint32_t RTCM3Decoder::CRC24(long size, const unsigned char *buf) { 1726 1788 uint32_t crc = 0; 1727 int i; 1728 1729 while (size) { 1789 int ii; 1790 while (size) { 1730 1791 crc ^= (*buf++) << (16); 1731 for (i = 0; i < 8;i++) {1792 for (ii = 0; ii < 8; ii++) { 1732 1793 crc <<= 1; 1733 1794 if (crc & 0x1000000)
Note:
See TracChangeset
for help on using the changeset viewer.