Changeset 6792 in ntrip for trunk/BNC/src/ephemeris.cpp


Ignore:
Timestamp:
Apr 22, 2015, 2:51:30 PM (9 years ago)
Author:
stuerze
Message:

some complements with respect to Galileo navigation messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/ephemeris.cpp

    r6756 r6792  
    446446
    447447  _TOEsec   = _TOC.gpssec();
    448   ////  _TOEsec   = ee->TOE;  //// TODO:
     448
    449449  _Cic      = ee->Cic;
    450450  _OMEGA0   = ee->OMEGA0;
     
    462462  _E5aHS    = ee->E5aHS;
    463463  _E5bHS    = ee->E5bHS;
     464  _E1_bHS   = ee->E1_HS;
    464465  _BGD_1_5A = ee->BGD_1_5A;
    465466  _BGD_1_5B = ee->BGD_1_5B;
     
    808809  // ------------
    809810  int fieldLen = 19;
    810 
     811  double SVhealth = 0.0;
     812  double datasource = 0.0;
    811813  int pos[4];
    812814  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
     
    893895
    894896    else if ( iLine == 5 ) {
    895       if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
    896            readDbl(line, pos[2], fieldLen, _TOEweek) ) {
    897         _checkState = bad;
    898         return;
     897      if ( readDbl(line, pos[0], fieldLen, _IDOT      ) ||
     898           readDbl(line, pos[1], fieldLen, datasource) ||
     899           readDbl(line, pos[2], fieldLen, _TOEweek   ) ) {
     900        _checkState = bad;
     901        return;
     902      } else {
     903        if        (int(datasource) & (1<<8)) {
     904          _flags |= GALEPHF_FNAV;
     905        } else if (int(datasource) & (1<<9)) {
     906          _flags |= GALEPHF_INAV;
     907        }
    899908      }
    900909    }
     
    902911    else if ( iLine == 6 ) {
    903912      if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
    904            readDbl(line, pos[1], fieldLen, _E5aHS   ) ||
     913           readDbl(line, pos[1], fieldLen,  SVhealth) ||
    905914           readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
    906915           readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
    907916        _checkState = bad;
    908917        return;
     918      } else {
     919        // Bit 0
     920        if (int(SVhealth) & (1<<0)) {
     921          _flags |= GALEPHF_E1DINVALID;
     922        }
     923        // Bit 1-2
     924        _E1_bHS = double((int(SVhealth) >> 1) & 0x3);
     925        // Bit 3
     926        if (int(SVhealth) & (1<<3)) {
     927          _flags |= GALEPHF_E5ADINVALID;
     928        }
     929        // Bit 4-5
     930        _E5aHS = double((int(SVhealth) >> 4) & 0x3);
     931        // Bit 6
     932        if (int(SVhealth) & (1<<6)) {
     933          _flags |= GALEPHF_E5BDINVALID;
     934        }
     935        // Bit 7-8
     936        _E5bHS = double((int(SVhealth) >> 7) & 0x3);
    909937      }
    910938    }
     
    10971125    .arg(_OMEGADOT, 19, 'e', 12);
    10981126
    1099   int dataSource = 0;
    1100   double HS = 0.0;
    1101   if      ( (_flags & GALEPHF_INAV) == GALEPHF_INAV ) {
    1102     dataSource |= (1<<0);
    1103     dataSource |= (1<<9);
    1104     HS = _E5bHS;
    1105   }
    1106   else if ( (_flags & GALEPHF_FNAV) == GALEPHF_FNAV ) {
     1127  int    dataSource = 0;
     1128  int    SVhealth   = 0;
     1129  double BGD_1_5A   = _BGD_1_5A;
     1130  double BGD_1_5B   = _BGD_1_5B;
     1131  if      ((_flags & GALEPHF_FNAV) == GALEPHF_FNAV) {
    11071132    dataSource |= (1<<1);
    11081133    dataSource |= (1<<8);
    1109     HS = _E5aHS;
    1110   }
     1134    BGD_1_5B = 0.0;
     1135    // SVhealth
     1136    //   Bit 3  : E5a DVS
     1137    if ((_flags & GALEPHF_E5ADINVALID) == GALEPHF_E5ADINVALID) {
     1138      SVhealth |= (1<<3);
     1139    }
     1140    //   Bit 4-5: E5a HS
     1141    if (_E5aHS == 1.0) {
     1142      SVhealth |= (1<<4);
     1143    }
     1144    else if (_E5aHS == 2.0) {
     1145      SVhealth |= (1<<5);
     1146    }
     1147    else if (_E5aHS  == 3.0) {
     1148      SVhealth |= (1<<4);
     1149      SVhealth |= (1<<5);
     1150    }
     1151  }
     1152  else if ((_flags & GALEPHF_INAV) == GALEPHF_INAV) {
     1153    dataSource |= (1<<0);
     1154    dataSource |= (1<<2);
     1155    dataSource |= (1<<9);
     1156    // SVhealth
     1157    //   Bit 0  : E1-B DVS
     1158    if ((_flags & GALEPHF_E1DINVALID) == GALEPHF_E1DINVALID) {
     1159      SVhealth |= (1<<0);
     1160    }
     1161    //   Bit 1-2: E1-B HS
     1162    if      (_E1_bHS == 1.0) {
     1163      SVhealth |= (1<<1);
     1164    }
     1165    else if (_E1_bHS == 2.0) {
     1166      SVhealth |= (1<<2);
     1167    }
     1168    else if (_E1_bHS  == 3.0) {
     1169      SVhealth |= (1<<1);
     1170      SVhealth |= (1<<2);
     1171    }
     1172    //   Bit 6  : E5b DVS
     1173    if ((_flags & GALEPHF_E1DINVALID) == GALEPHF_E1DINVALID) {
     1174      SVhealth |= (1<<6);
     1175    }
     1176    //   Bit 7-8: E5b HS
     1177    if      (_E5bHS == 1.0) {
     1178      SVhealth |= (1<<7);
     1179    }
     1180    else if (_E5bHS == 2.0) {
     1181      SVhealth |= (1<<8);
     1182    }
     1183    else if (_E5bHS  == 3.0) {
     1184      SVhealth |= (1<<7);
     1185      SVhealth |= (1<<8);
     1186    }
     1187  }
     1188
    11111189  out << QString(fmt)
    11121190    .arg(_IDOT,              19, 'e', 12)
     
    11151193    .arg(0.0,                19, 'e', 12);
    11161194
    1117   out << QString(fmt)
    1118     .arg(_SISA,     19, 'e', 12)
    1119     .arg(HS,        19, 'e', 12)
    1120     .arg(_BGD_1_5A, 19, 'e', 12)
    1121     .arg(_BGD_1_5B, 19, 'e', 12);
     1195  double SISA = -1.0;
     1196  if ((_SISA >= 0) && (_SISA <= 49)) {
     1197    SISA = _SISA / 100.0;
     1198  }
     1199  if((_SISA >= 50) && (_SISA <= 74)) {
     1200    SISA = (50 + (_SISA - 50.0) * 2.0) / 100.0;
     1201  }
     1202  if((_SISA >= 75) && (_SISA <= 99)) {
     1203    SISA = 1.0 + (_SISA - 75.0) * 0.04;
     1204  }
     1205  if((_SISA >= 100) && (_SISA <= 125)) {
     1206    SISA = 2.0 + (_SISA - 100.0) * 0.16;
     1207  }
     1208  out << QString(fmt)
     1209    .arg(SISA,             19, 'e', 12)
     1210    .arg(double(SVhealth), 19, 'e', 12)
     1211    .arg(BGD_1_5A,         19, 'e', 12)
     1212    .arg(BGD_1_5B,         19, 'e', 12);
    11221213
    11231214  out << QString(fmt)
     
    17041795    .arg(0.0,                               19, 'e', 12);
    17051796
    1706   double ura = _URA; // RINEX file input
     1797  // RINEX file input
     1798  double ura = _URA;
     1799  // RTCM stream input
    17071800  if ((_URAI <  6) && (_URAI >= 0)) {
    17081801    ura = ceil(10.0 * pow(2.0, ((double)_URAI/2.0) + 1.0)) / 10.0;
     
    17221815  }
    17231816  out << QString(fmt)
    1724     .arg(tots,         19, 'e', 12)
     1817    .arg(tots,          19, 'e', 12)
    17251818    .arg(double(_AODC), 19, 'e', 12)
    17261819    .arg("",            19, QChar(' '))
Note: See TracChangeset for help on using the changeset viewer.