Changeset 8812 in ntrip for trunk/BNC/src


Ignore:
Timestamp:
Sep 23, 2019, 1:03:19 PM (5 years ago)
Author:
stuerze
Message:

IRNSS support is added in RTCM3 ephemeris encoder

File:
1 edited

Legend:

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

    r8208 r8812  
    1515  unsigned long long bitbuffer = 0;
    1616  int ura = indexFromAccuracy(eph._ura, eph.type());
     17  int L5Flag, SFlag;
     18
    1719  if (eph.type() == t_eph::QZSS) {
    1820    GPSADDBITS(12, 1044)
    19     GPSADDBITS(4,eph._prn.number())
     21    GPSADDBITS(4, eph._prn.number())
    2022    GPSADDBITS(16, static_cast<int>(eph._TOC.gpssec())>>4)
    21     GPSADDBITSFLOAT(8, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)
    22     /static_cast<double>(1<<25))
    23     GPSADDBITSFLOAT(16, eph._clock_drift, 1.0/static_cast<double>(1<<30)
    24     /static_cast<double>(1<<13))
    25     GPSADDBITSFLOAT(22, eph._clock_bias, 1.0/static_cast<double>(1<<30)
    26     /static_cast<double>(1<<1))
     23    GPSADDBITSFLOAT(8, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<25))
     24    GPSADDBITSFLOAT(16, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     25    GPSADDBITSFLOAT(22, eph._clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    2726    GPSADDBITS(8, eph._IODE)
    2827    GPSADDBITSFLOAT(16, eph._Crs, 1.0/static_cast<double>(1<<5))
    29     GPSADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)
    30     /static_cast<double>(1<<13))
     28    GPSADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    3129    GPSADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    3230    GPSADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29))
     
    3634    GPSADDBITS(16, static_cast<int>(eph._TOEsec)>>4)
    3735    GPSADDBITSFLOAT(16, eph._Cic, 1.0/static_cast<double>(1<<29))
    38     GPSADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)
    39     /static_cast<double>(1<<1))
     36    GPSADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    4037    GPSADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29))
    4138    GPSADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    4239    GPSADDBITSFLOAT(16, eph._Crc, 1.0/static_cast<double>(1<<5))
    43     GPSADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)
    44     /static_cast<double>(1<<1))
    45     GPSADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)
    46     /static_cast<double>(1<<13))
    47     GPSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)
    48     /static_cast<double>(1<<13))
     40    GPSADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     41    GPSADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     42    GPSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    4943    GPSADDBITS(2,eph._L2Codes)
    5044    GPSADDBITS(10, eph._TOC.gpsw())
     
    5549    GPSADDBITS(1, eph._fitInterval)
    5650    GPSADDBITS(3, 0) /* padding */
    57   }
    58   else {
     51  } else if (eph.type() == t_eph::IRNSS) {
     52    GPSADDBITS(12, 29)
     53    GPSADDBITS(6, eph._prn.number())
     54    GPSADDBITS(10, eph._TOC.gpsw())
     55    GPSADDBITSFLOAT(22, eph._clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     56    GPSADDBITSFLOAT(16, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     57    GPSADDBITSFLOAT(8, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<25))
     58    GPSADDBITS(4, ura)
     59    GPSADDBITS(16, static_cast<int>(eph._TOC.gpssec())>>4)
     60    GPSADDBITSFLOAT(8, eph._TGD, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     61    GPSADDBITSFLOAT(22, eph._Delta_n, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<11))
     62    GPSADDBITS(8, eph._IODE) // Issue Of Data Ephemeris and Clock
     63    GPSADDBITS(10, 0) /* padding */
     64    if        (eph._health == 0.0) {
     65      L5Flag = 0;
     66      SFlag  = 0;
     67    } else if (eph._health == 1.0) {
     68      L5Flag = 0;
     69      SFlag  = 1;
     70    } else if (eph._health == 2.0) {
     71      L5Flag = 1;
     72      SFlag  = 0;
     73    } else if (eph._health == 3.0) {
     74      L5Flag = 1;
     75      SFlag  = 1;
     76    }
     77    GPSADDBITS(1, L5Flag)
     78    GPSADDBITS(1, SFlag)
     79    GPSADDBITSFLOAT(15, eph._Cuc, 1.0/static_cast<double>(1<<28))
     80    GPSADDBITSFLOAT(15, eph._Cus, 1.0/static_cast<double>(1<<28))
     81    GPSADDBITSFLOAT(15, eph._Cic, 1.0/static_cast<double>(1<<28))
     82    GPSADDBITSFLOAT(15, eph._Cis, 1.0/static_cast<double>(1<<28))
     83    GPSADDBITSFLOAT(15, eph._Crc, 1.0/static_cast<double>(1<< 4))
     84    GPSADDBITSFLOAT(15, eph._Crs, 1.0/static_cast<double>(1<< 4))
     85    GPSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     86    GPSADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     87    GPSADDBITS(16, static_cast<int>(eph._TOEsec)>>4)
     88    GPSADDBITSFLOAT(32, eph._e, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<3))
     89    GPSADDBITSFLOAT(32, eph._sqrt_A, 1.0/static_cast<double>(1<<19))
     90    GPSADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     91    GPSADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     92    GPSADDBITSFLOAT(22, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<11))
     93    GPSADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     94    GPSADDBITS(2, 0) /* padding */
     95    GPSADDBITS(2, 0) /* padding */
     96  } else {
    5997    GPSADDBITS(12, 1019)
    6098    GPSADDBITS(6,eph._prn.number())
     
    62100    GPSADDBITS(4, ura)
    63101    GPSADDBITS(2,eph._L2Codes)
    64     GPSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)
    65     /static_cast<double>(1<<13))
     102    GPSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    66103    GPSADDBITS(8, eph._IODE)
    67104    GPSADDBITS(16, static_cast<int>(eph._TOC.gpssec())>>4)
    68     GPSADDBITSFLOAT(8, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)
    69     /static_cast<double>(1<<25))
    70     GPSADDBITSFLOAT(16, eph._clock_drift, 1.0/static_cast<double>(1<<30)
    71     /static_cast<double>(1<<13))
    72     GPSADDBITSFLOAT(22, eph._clock_bias, 1.0/static_cast<double>(1<<30)
    73     /static_cast<double>(1<<1))
     105    GPSADDBITSFLOAT(8, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<25))
     106    GPSADDBITSFLOAT(16, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     107    GPSADDBITSFLOAT(22, eph._clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    74108    GPSADDBITS(10, eph._IODC)
    75109    GPSADDBITSFLOAT(16, eph._Crs, 1.0/static_cast<double>(1<<5))
    76     GPSADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)
    77     /static_cast<double>(1<<13))
     110    GPSADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    78111    GPSADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    79112    GPSADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29))
     
    83116    GPSADDBITS(16, static_cast<int>(eph._TOEsec)>>4)
    84117    GPSADDBITSFLOAT(16, eph._Cic, 1.0/static_cast<double>(1<<29))
    85     GPSADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)
    86     /static_cast<double>(1<<1))
     118    GPSADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    87119    GPSADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29))
    88120    GPSADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    89121    GPSADDBITSFLOAT(16, eph._Crc, 1.0/static_cast<double>(1<<5))
    90     GPSADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)
    91     /static_cast<double>(1<<1))
    92     GPSADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)
    93     /static_cast<double>(1<<13))
     122    GPSADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     123    GPSADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    94124    GPSADDBITSFLOAT(8, eph._TGD, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    95125    GPSADDBITS(6, eph._health)
     
    190220  GALILEOADDBITS(10, eph._IODnav)
    191221  GALILEOADDBITS(8, SISA)
    192   GALILEOADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)
    193   /static_cast<double>(1<<13))
     222  GALILEOADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    194223  GALILEOADDBITS(14, eph._TOC.gpssec()/60)
    195   GALILEOADDBITSFLOAT(6, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)
    196   /static_cast<double>(1<<29))
    197   GALILEOADDBITSFLOAT(21, eph._clock_drift, 1.0/static_cast<double>(1<<30)
    198   /static_cast<double>(1<<16))
    199   GALILEOADDBITSFLOAT(31, eph._clock_bias, 1.0/static_cast<double>(1<<30)
    200   /static_cast<double>(1<<4))
     224  GALILEOADDBITSFLOAT(6, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<29))
     225  GALILEOADDBITSFLOAT(21, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<16))
     226  GALILEOADDBITSFLOAT(31, eph._clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<4))
    201227  GALILEOADDBITSFLOAT(16, eph._Crs, 1.0/static_cast<double>(1<<5))
    202   GALILEOADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)
    203   /static_cast<double>(1<<13))
     228  GALILEOADDBITSFLOAT(16, eph._Delta_n, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    204229  GALILEOADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    205230  GALILEOADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29))
     
    209234  GALILEOADDBITS(14, eph._TOEsec/60)
    210235  GALILEOADDBITSFLOAT(16, eph._Cic, 1.0/static_cast<double>(1<<29))
    211   GALILEOADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)
    212   /static_cast<double>(1<<1))
     236  GALILEOADDBITSFLOAT(32, eph._OMEGA0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    213237  GALILEOADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29))
    214238  GALILEOADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
    215239  GALILEOADDBITSFLOAT(16, eph._Crc, 1.0/static_cast<double>(1<<5))
    216   GALILEOADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)
    217   /static_cast<double>(1<<1))
    218   GALILEOADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)
    219   /static_cast<double>(1<<13))
    220   GALILEOADDBITSFLOAT(10, eph._BGD_1_5A, 1.0/static_cast<double>(1<<30)
    221   /static_cast<double>(1<<2))
     240  GALILEOADDBITSFLOAT(32, eph._omega, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1))
     241  GALILEOADDBITSFLOAT(24, eph._OMEGADOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
     242  GALILEOADDBITSFLOAT(10, eph._BGD_1_5A, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<2))
    222243  if(eph._inav)
    223244  {
    224     GALILEOADDBITSFLOAT(10, eph._BGD_1_5B, 1.0/static_cast<double>(1<<30)
    225     /static_cast<double>(1<<2))
     245    GALILEOADDBITSFLOAT(10, eph._BGD_1_5B, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<2))
    226246    GALILEOADDBITS(2, static_cast<int>(eph._E5bHS))
    227247    GALILEOADDBITS(1, eph._e5bDataInValid ? 1 : 0)
    228248    GALILEOADDBITS(2, static_cast<int>(eph._E1_bHS))
    229249    GALILEOADDBITS(1, eph._e1DataInValid ? 1 : 0)
    230   }
    231   else
    232   {
     250  } else {
    233251    GALILEOADDBITS(2, static_cast<int>(eph._E5aHS))
    234252    GALILEOADDBITS(1,  eph._e5aDataInValid ? 1 : 0)
     
    304322  BDSADDBITS(5, eph._AODE)
    305323  BDSADDBITS(17, static_cast<int>(eph._TOC.bdssec())>>3)
    306   BDSADDBITSFLOAT(11, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)
    307       /static_cast<double>(1<<30)/static_cast<double>(1<<6))
     324  BDSADDBITSFLOAT(11, eph._clock_driftrate, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<30)/static_cast<double>(1<<6))
    308325  BDSADDBITSFLOAT(22, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<20))
    309326  BDSADDBITSFLOAT(24, eph._clock_bias, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<3))
Note: See TracChangeset for help on using the changeset viewer.