Changeset 9201 in ntrip


Ignore:
Timestamp:
Nov 3, 2020, 10:06:30 AM (3 years ago)
Author:
stuerze
Message:

ephemeris checks + debugging info added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/RTCM3Decoder.cpp

    r9192 r9201  
    10461046    GETFLOATSIGN(eph._Cus,            16, 1.0 / (double )(1 << 29))
    10471047    GETFLOAT(eph._sqrt_A,             32, 1.0 / (double )(1 << 19))
    1048     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).toLatin1(), true));
     1052      return false;
     1053    }
    10491054    GETBITS(i, 16)
    10501055    i <<= 4;
     
    11011106    GETBITS(eph._almanac_health, 1) /* almanac healthy */
    11021107    GETBITS(eph._almanac_health_availablility_indicator, 1) /* almanac health ok */
    1103     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).toLatin1(), true));
     1112      return false;
     1113    }
    11041114    GETBITS(eph._P1, 2) /*  P1 */
    11051115    GETBITS(i, 5)
     
    11301140    GETFLOATSIGNM(eph._gamma,      11, 1.0 / (double )(1 << 30) / (double )(1 << 10))
    11311141    GETBITS(eph._M_P,  2) /* GLONASS-M P, */
    1132     GETBITS(eph._M_l3, 1) /*GLONASS-M ln (third string) */
    1133     GETFLOATSIGNM(eph._tau,        22, 1.0 / (double )(1 << 30))    /* GLONASS tau n(tb) */
     1142    GETBITS(eph._M_l3, 1) /* GLONASS-M ln (third string) */
     1143    GETFLOATSIGNM(eph._tau,        22, 1.0 / (double )(1 << 30))  /* GLONASS tau n(tb) */
    11341144    GETFLOATSIGNM(eph._M_delta_tau, 5, 1.0 / (double )(1 << 30))  /* GLONASS-M delta tau n(tb) */
    11351145    GETBITS(eph._E, 5)
     
    11371147    GETBITS(eph._M_FT,  4) /* GLONASS-M Ft */
    11381148    GETBITS(eph._M_NT, 11) /* GLONASS-M Nt */
    1139     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).toLatin1(), true));
     1152      return false;
     1153    }
    11401154    GETBITS(eph._M_M,   2) /* GLONASS-M M */
    11411155    GETBITS(eph._additional_data_availability, 1) /* GLONASS-M The Availability of Additional Data */
    1142     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).toLatin1(), true));
     1160      return false;
     1161    }
    11431162    GETBITS(eph._NA,  11) /* GLONASS-M Na */
    11441163    GETFLOATSIGNM(eph._tauC,       32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */
     
    11551174    eph._xv(2) = eph._y_pos * 1.e3;
    11561175    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()).toLatin1(), true));
     1179      return false;
     1180    }
    11571181    eph._xv(4) = eph._x_velocity * 1.e3;
    11581182    eph._xv(5) = eph._y_velocity * 1.e3;
    11591183    eph._xv(6) = eph._z_velocity * 1.e3;
    1160 
     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()).toLatin1(), true));
     1187      return false;
     1188    }
    11611189    GLOFreq[sv - 1] = 100 + eph._frequency_number ; /* store frequency for other users (MSM) */
    11621190    _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0);
     
    12031231    GETFLOATSIGN(eph._Cus,     16, 1.0 / (double )(1 << 29))
    12041232    GETFLOAT(eph._sqrt_A,      32, 1.0 / (double )(1 << 19))
    1205     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).toLatin1(), true));
     1237      return false;
     1238    }
    12061239    GETBITS(i, 16)
    12071240    i <<= 4;
     
    13121345    GETFLOAT(eph._e,            32, 1.0 / (double )(1 << 30) / (double )(1 << 3))
    13131346    GETFLOAT(eph._sqrt_A,       32, 1.0 / (double )(1 << 19))
    1314     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).toLatin1(), true));
     1351      return false;
     1352    }
    13151353    GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
    13161354    GETFLOATSIGN(eph._omega,    32, R2R_PI/(double)(1<<30)/(double)(1<< 1))
     
    13541392    GETFLOATSIGN(eph._y_pos, 30, 0.08)
    13551393    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()).toLatin1(), true));
     1399      return false;
     1400    }
    13561401    GETFLOATSIGN(eph._x_velocity, 17, 0.000625)
    13571402    GETFLOATSIGN(eph._y_velocity, 17, 0.000625)
     
    14101455    GETFLOATSIGN(eph._Cus,            16, 1.0 / (double )(1 << 29))
    14111456    GETFLOAT(eph._sqrt_A,             32, 1.0 / (double )(1 << 19))
    1412     if (eph._sqrt_A < 1000.0) {return false;}
    14131457    GETBITSFACTOR(eph._TOEsec, 14, 60)
    14141458    /* FIXME: overwrite value, copied from old code */
     
    14331477      GETBITS(eph._e1DataInValid, 1)
    14341478      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).toLatin1(), true));
    14351482        return false;
    14361483      }
    14371484      if ((eph._BGD_1_5A == 0.0 && fabs(eph._BGD_1_5B) > 1e-9) ||
    14381485          (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e-9)) {
     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).toLatin1(), true));
    14391489        return false;
    14401490      }
     
    14521502    }
    14531503    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    }
    14541511
    14551512    emit newGalileoEph(eph);
     
    14981555    GETFLOATSIGN(eph._Cus,     18, 1.0 / (double )(1 << 30) / (double )(1 << 1))
    14991556    GETFLOAT(eph._sqrt_A,      32, 1.0 / (double )(1 << 19))
    1500     if (eph._sqrt_A < 1000.0) {return false;}
     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).toLatin1(), true));
     1561      return false;
     1562    }
    15011563    GETBITS(i, 17)
    15021564    i <<= 3;
     
    17081770          case 1045:
    17091771          case 1046:
    1710             // reject 1045/1046 from JAXA RTKLIB encoded stations
    17111772            if (_staID.contains("AIRA") || _staID.contains("STK2") ||
    17121773                _staID.contains("CCJ2") || _staID.contains("SYOG")) {
     1774              emit(newMessage(
     1775                   QString("%1: Block temporary %2 from JAXA RTKLIB encoded stations!")
     1776                       .arg(_staID).arg(id).toLatin1(), true));
    17131777              break;
    17141778            }
Note: See TracChangeset for help on using the changeset viewer.