Changeset 9205 in ntrip
 Timestamp:
 Nov 3, 2020, 1:15:38 PM (2 years ago)
 Location:
 branches/BNC_2.12/src
 Files:

 2 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) 
branches/BNC_2.12/src/bncephuser.cpp
r9200 r9205 206 206 } 207 207 double rr = xc.Rows(1,3).norm_Frobenius(); 208 double rv = vv.norm_Frobenius(); 208 209 209 const double MINDIST = 2.e7; 210 210 const double MAXDIST = 6.e7; 211 211 if (rr < MINDIST  rr > MAXDIST  std::isnan(rr)) { 212 eph>setCheckState(t_eph::bad);213 return;214 }215 if (eph>type() == t_eph::GLONASS && rv < 1.0) {216 212 eph>setCheckState(t_eph::bad); 217 213 return; … … 224 220 QDateTime now = currentDateAndTimeGPS(); 225 221 bncTime currentTime(now.toString(Qt::ISODate).toStdString()); 226 double dt = fabs(currentTime  toc);222 double dt = currentTime  toc; 227 223 228 224 // update interval: 2h, data sets are valid for 4 hours 229 if (eph>type() == t_eph::GPS && dt > 4*3600) {225 if (eph>type() == t_eph::GPS && (dt > 4*3600.0  dt < 2*3600.0)) { 230 226 eph>setCheckState(t_eph::outdated); 231 227 return; 232 228 } 233 229 // update interval: 3h, data sets are valid for 4 hours 234 else if (eph>type() == t_eph::Galileo && dt > 4*3600) {230 else if (eph>type() == t_eph::Galileo && (dt > 4*3600.0  dt < 0.0)) { 235 231 eph>setCheckState(t_eph::outdated); 236 232 return; 237 233 } 238 234 // updated every 30 minutes 239 else if (eph>type() == t_eph::GLONASS && dt > 2*3600) {235 else if (eph>type() == t_eph::GLONASS && (dt > 1*3600.0  dt < 1800.0)) { 240 236 eph>setCheckState(t_eph::outdated); 241 237 return; 242 238 } 243 239 // orbit parameters are valid for 7200 seconds (minimum) 244 else if (eph>type() == t_eph::QZSS && dt > 3*3600) {240 else if (eph>type() == t_eph::QZSS && (dt > 2*3600.0  dt < 1*3600.0)) { 245 241 eph>setCheckState(t_eph::outdated); 246 242 return; 247 243 } 248 244 // maximum update interval: 300 sec 249 else if (eph>type() == t_eph::SBAS && dt > 1*3600) {245 else if (eph>type() == t_eph::SBAS && (dt > 600  dt < 300)) { 250 246 eph>setCheckState(t_eph::outdated); 251 247 return; 252 248 } 253 249 // updates 1h (GEO) up to 6 hours nonGEO 254 else if (eph>type() == t_eph::BDS && dt > 6*3600) {250 else if (eph>type() == t_eph::BDS && (dt > 6*3600  dt < 0.0)) { 255 251 eph>setCheckState(t_eph::outdated); 256 252 return; 257 253 } 258 254 // update interval: up to 24 hours 259 else if (eph>type() == t_eph::IRNSS && dt > 24*3600) {255 else if (eph>type() == t_eph::IRNSS && fabs(dt > 24*3600)) { 260 256 eph>setCheckState(t_eph::outdated); 261 257 return; … … 281 277 282 278 // some lines to allow update of ephemeris data sets after outage 283 if (eph>type() == t_eph::GPS && dt > 4*3600) { 284 ephL>setCheckState(t_eph::outdated); 285 return; 286 } 287 else if (eph>type() == t_eph::Galileo && dt > 4*3600) { 288 ephL>setCheckState(t_eph::outdated); 289 return; 290 } 291 else if (eph>type() == t_eph::GLONASS && dt > 2*3600) { 292 ephL>setCheckState(t_eph::outdated); 293 return; 294 } 295 else if (eph>type() == t_eph::QZSS && dt > 3*3600) { 296 ephL>setCheckState(t_eph::outdated); 297 return; 298 } 299 else if (eph>type() == t_eph::SBAS && dt > 3600) { 300 ephL>setCheckState(t_eph::outdated); 301 return; 302 } 279 // update interval: 2h, 280 if (eph>type() == t_eph::GPS && dt > 2*3600) { 281 ephL>setCheckState(t_eph::outdated); 282 return; 283 } 284 // update interval: 3h, 285 else if (eph>type() == t_eph::Galileo && dt > 3*3600) { 286 ephL>setCheckState(t_eph::outdated); 287 return; 288 } 289 // updated every 30 minutes 290 else if (eph>type() == t_eph::GLONASS && dt > 1800) { 291 ephL>setCheckState(t_eph::outdated); 292 return; 293 } 294 // updated every ? 295 else if (eph>type() == t_eph::QZSS && dt > 2*3600) { 296 ephL>setCheckState(t_eph::outdated); 297 return; 298 } 299 // maximum update interval: 300 sec 300 else if (eph>type() == t_eph::SBAS && dt > 300) { 301 ephL>setCheckState(t_eph::outdated); 302 return; 303 } 304 // updates 1h (GEO) up to 6 hours nonGEO 303 305 else if (eph>type() == t_eph::BDS && dt > 6*3600) { 304 306 ephL>setCheckState(t_eph::outdated); 305 307 return; 306 308 } 309 // update interval: up to 24 hours 307 310 else if (eph>type() == t_eph::IRNSS && dt > 24*3600) { 308 311 ephL>setCheckState(t_eph::outdated);
Note:
See TracChangeset
for help on using the changeset viewer.