Changeset 8812 in ntrip for trunk/BNC/src
- Timestamp:
- Sep 23, 2019, 1:03:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/ephEncoder.cpp
r8208 r8812 15 15 unsigned long long bitbuffer = 0; 16 16 int ura = indexFromAccuracy(eph._ura, eph.type()); 17 int L5Flag, SFlag; 18 17 19 if (eph.type() == t_eph::QZSS) { 18 20 GPSADDBITS(12, 1044) 19 GPSADDBITS(4, eph._prn.number())21 GPSADDBITS(4, eph._prn.number()) 20 22 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)) 27 26 GPSADDBITS(8, eph._IODE) 28 27 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)) 31 29 GPSADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 32 30 GPSADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29)) … … 36 34 GPSADDBITS(16, static_cast<int>(eph._TOEsec)>>4) 37 35 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)) 40 37 GPSADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29)) 41 38 GPSADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 42 39 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)) 49 43 GPSADDBITS(2,eph._L2Codes) 50 44 GPSADDBITS(10, eph._TOC.gpsw()) … … 55 49 GPSADDBITS(1, eph._fitInterval) 56 50 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 { 59 97 GPSADDBITS(12, 1019) 60 98 GPSADDBITS(6,eph._prn.number()) … … 62 100 GPSADDBITS(4, ura) 63 101 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)) 66 103 GPSADDBITS(8, eph._IODE) 67 104 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)) 74 108 GPSADDBITS(10, eph._IODC) 75 109 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)) 78 111 GPSADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 79 112 GPSADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29)) … … 83 116 GPSADDBITS(16, static_cast<int>(eph._TOEsec)>>4) 84 117 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)) 87 119 GPSADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29)) 88 120 GPSADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 89 121 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)) 94 124 GPSADDBITSFLOAT(8, eph._TGD, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 95 125 GPSADDBITS(6, eph._health) … … 190 220 GALILEOADDBITS(10, eph._IODnav) 191 221 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)) 194 223 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)) 201 227 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)) 204 229 GALILEOADDBITSFLOAT(32, eph._M0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 205 230 GALILEOADDBITSFLOAT(16, eph._Cuc, 1.0/static_cast<double>(1<<29)) … … 209 234 GALILEOADDBITS(14, eph._TOEsec/60) 210 235 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)) 213 237 GALILEOADDBITSFLOAT(16, eph._Cis, 1.0/static_cast<double>(1<<29)) 214 238 GALILEOADDBITSFLOAT(32, eph._i0, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<1)) 215 239 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)) 222 243 if(eph._inav) 223 244 { 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)) 226 246 GALILEOADDBITS(2, static_cast<int>(eph._E5bHS)) 227 247 GALILEOADDBITS(1, eph._e5bDataInValid ? 1 : 0) 228 248 GALILEOADDBITS(2, static_cast<int>(eph._E1_bHS)) 229 249 GALILEOADDBITS(1, eph._e1DataInValid ? 1 : 0) 230 } 231 else 232 { 250 } else { 233 251 GALILEOADDBITS(2, static_cast<int>(eph._E5aHS)) 234 252 GALILEOADDBITS(1, eph._e5aDataInValid ? 1 : 0) … … 304 322 BDSADDBITS(5, eph._AODE) 305 323 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)) 308 325 BDSADDBITSFLOAT(22, eph._clock_drift, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<20)) 309 326 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.