Changeset 8801 in ntrip


Ignore:
Timestamp:
Sep 20, 2019, 2:46:25 PM (5 years ago)
Author:
stuerze
Message:

IRNSS support is added in RTCM3 decoder, RTCM signal mapping IDs for GLONASS and BDS are updated/extended

Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r8783 r8801  
    243243        {GPS_WAVELENGTH_L1, "1P"},
    244244        {GPS_WAVELENGTH_L1, "1W"},
    245         {0.0, 0}/*{GPS_WAVELENGTH_L1,"1Y"}*/,
     245        {0.0, 0},
    246246        {0.0, 0},
    247247        {0.0, 0},
     
    249249        {GPS_WAVELENGTH_L2, "2P"},
    250250        {GPS_WAVELENGTH_L2, "2W"},
    251         {0.0, 0}/*{GPS_WAVELENGTH_L2,"2Y"}*/,
     251        {0.0, 0},
    252252        {0.0, 0},
    253253        {0.0, 0},
     
    288288        {1.0, "2C"},
    289289        {1.0, "2P"},
    290         {0.0, 0},
    291         {0.0, 0},
    292         {0.0, 0},
    293         {0.0, 0},
    294         {0.0, 0},
    295         {0.0, 0},
    296         {0.0, 0},
    297         {0.0, 0},
    298         {0.0, 0},
     290        {GLO_WAVELENGTH_L1a, "4A"},
     291        {GLO_WAVELENGTH_L1a, "4B"},
     292        {GLO_WAVELENGTH_L1a, "4X"},
     293        {GLO_WAVELENGTH_L2a, "6A"},
     294        {GLO_WAVELENGTH_L2a, "6B"},
     295        {GLO_WAVELENGTH_L2a, "6X"},
     296        {GLO_WAVELENGTH_L3,  "3I"},
     297        {GLO_WAVELENGTH_L3,  "3Q"},
     298        {GLO_WAVELENGTH_L3,  "3X"},
    299299        {0.0, 0},
    300300        {0.0, 0},
     
    316316static struct CodeData gal[RTCM3_MSM_NUMSIG] = {
    317317        {0.0, 0},
    318         {GAL_WAVELENGTH_E1, "1C"},
    319         {GAL_WAVELENGTH_E1, "1A"},
    320         {GAL_WAVELENGTH_E1, "1B"},
    321         {GAL_WAVELENGTH_E1, "1X"},
    322         {GAL_WAVELENGTH_E1, "1Z"},
    323         {0.0, 0},
    324         {GAL_WAVELENGTH_E6, "6C"},
    325         {GAL_WAVELENGTH_E6, "6A"},
    326         {GAL_WAVELENGTH_E6, "6B"},
    327         {GAL_WAVELENGTH_E6, "6X"},
    328         {GAL_WAVELENGTH_E6, "6Z"},
     318        {GAL_WAVELENGTH_E1,  "1C"},
     319        {GAL_WAVELENGTH_E1,  "1A"},
     320        {GAL_WAVELENGTH_E1,  "1B"},
     321        {GAL_WAVELENGTH_E1,  "1X"},
     322        {GAL_WAVELENGTH_E1,  "1Z"},
     323        {0.0, 0},
     324        {GAL_WAVELENGTH_E6,  "6C"},
     325        {GAL_WAVELENGTH_E6,  "6A"},
     326        {GAL_WAVELENGTH_E6,  "6B"},
     327        {GAL_WAVELENGTH_E6,  "6X"},
     328        {GAL_WAVELENGTH_E6,  "6Z"},
    329329        {0.0, 0},
    330330        {GAL_WAVELENGTH_E5B, "7I"},
     
    332332        {GAL_WAVELENGTH_E5B, "7X"},
    333333        {0.0, 0},
    334         {GAL_WAVELENGTH_E5AB, "8I"},
    335         {GAL_WAVELENGTH_E5AB, "8Q"},
    336         {GAL_WAVELENGTH_E5AB, "8X"},
     334        {GAL_WAVELENGTH_E5AB,"8I"},
     335        {GAL_WAVELENGTH_E5AB,"8Q"},
     336        {GAL_WAVELENGTH_E5AB,"8X"},
    337337        {0.0, 0},
    338338        {GAL_WAVELENGTH_E5A, "5I"},
     
    346346        {0.0, 0},
    347347        {0.0, 0},
    348         {0.0, 0},
     348        {0.0, 0}
    349349    };
    350350
     
    406406        {0.0, 0},
    407407        {0.0, 0},
    408         {0.0, 0},
    409         {0.0, 0},
    410         {0.0, 0},
    411         {0.0, 0},
    412         {0.0, 0},
    413         {0.0, 0},
    414         {0.0, 0},
    415         {0.0, 0},
    416         {0.0, 0},
     408        {BDS_WAVELENGTH_B1C, "1D"},
     409        {BDS_WAVELENGTH_B1C, "1P"},
     410        {BDS_WAVELENGTH_B1C, "1X"},
     411        {0.0, 0},
     412        {0.0, 0},
     413        {0.0, 0},
     414        {BDS_WAVELENGTH_B2a, "5D"},
     415        {BDS_WAVELENGTH_B2a, "5P"},
     416        {BDS_WAVELENGTH_B2a, "5X"},
    417417        {0.0, 0},
    418418        {0.0, 0},
     
    465465//
    466466////////////////////////////////////////////////////////////////////////////
    467 bool RTCM3Decoder::DecodeRTCM3MSM(unsigned char* data, int size)
    468     {
     467bool RTCM3Decoder::DecodeRTCM3MSM(unsigned char* data, int size) {
    469468  bool decoded = false;
    470469  int type, syncf, i;
     
    525524    int sigmask, numsat = 0, numsig = 0;
    526525    uint64_t satmask, cellmask, ui;
    527     double rrmod[RTCM3_MSM_NUMSAT];
    528     int rrint[RTCM3_MSM_NUMSAT], rdop[RTCM3_MSM_NUMSAT],
    529         extsat[RTCM3_MSM_NUMSAT];
    530     int ll[RTCM3_MSM_NUMCELLS]/*, hc[RTCM3_MSM_NUMCELLS]*/;
    531     double cnr[RTCM3_MSM_NUMCELLS];
    532     double cp[RTCM3_MSM_NUMCELLS], psr[RTCM3_MSM_NUMCELLS],
    533         dop[RTCM3_MSM_NUMCELLS];
     526    // satellite data
     527    double rrmod[RTCM3_MSM_NUMSAT]; // GNSS sat rough ranges modulo 1 millisecond
     528    int    rrint[RTCM3_MSM_NUMSAT]; // number of integer msecs in GNSS sat rough ranges
     529    int    rdop[RTCM3_MSM_NUMSAT];  // GNSS sat rough phase range rates
     530    int    extsat[RTCM3_MSM_NUMSAT];// extended sat info
     531    // signal data
     532    int    ll[RTCM3_MSM_NUMCELLS];  // lock time indicator
     533    /*int    hc[RTCM3_MSM_NUMCELLS];*/  // half cycle ambiguity indicator
     534    double cnr[RTCM3_MSM_NUMCELLS]; // signal cnr
     535    double cp[RTCM3_MSM_NUMCELLS];  // fine phase range data
     536    double psr[RTCM3_MSM_NUMCELLS]; // fine psr
     537    double dop[RTCM3_MSM_NUMCELLS]; // fine phase range rates
    534538
    535539    SKIPBITS(3 + 7 + 2 + 2 + 1 + 3)
     
    547551    i = numsat * numsig;
    548552    GETBITS64(cellmask, (unsigned )i)
    549 
     553    // satellite data
    550554    switch (type % 10) {
    551555      case 1:
     
    575579        break;
    576580    }
    577 
     581    // signal data
    578582    int numcells = numsat * numsig;
    579583    /** Drop anything which exceeds our cell limit. Increase limit definition
     
    726730              {
    727731                int k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1];
    728                 if (extsat[numsat] < 14) {
    729                   k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1] = 100 + extsat[numsat]
    730                       - 7;
     732                if (extsat[numsat] < 14) { // channel number is available as extended info for MSM5/7
     733                  k = GLOFreq[RTCM3_MSM_NUMSAT - i - 1] = 100 + extsat[numsat] - 7;
    731734                }
    732                 if (k)
    733                   cd.wl = (
    734                       cd.wl == 0.0 ?
    735                           GLO_WAVELENGTH_L1(k - 100) :
    736                           GLO_WAVELENGTH_L2(k - 100));
    737                 else
     735                if (k) {
     736                  if      (cd.wl == 0.0) {
     737                    cd.wl = GLO_WAVELENGTH_L1(k - 100);
     738                  }
     739                  else if (cd.wl == 1.0) {
     740                    cd.wl = GLO_WAVELENGTH_L2(k - 100);
     741                  }
     742                }
     743                else if (!k && cd.wl <= 1) {
    738744                  cd.code = 0;
     745                }
    739746              }
    740747              break;
     
    754761                if (psr[count] > -1.0 / (1 << 10)) {
    755762                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    756                       + (rrmod[numsat]) * LIGHTSPEED / 1000.0;
     763                                + (rrmod[numsat]) * LIGHTSPEED / 1000.0;
    757764                  frqObs->_codeValid = true;
    758765                }
     
    761768                if (cp[count] > -1.0 / (1 << 8)) {
    762769                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    763                       + (rrmod[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
     770                                 + (rrmod[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    764771                  frqObs->_phaseValid = true;
    765772                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    771778                if (psr[count] > -1.0 / (1 << 10)) {
    772779                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    773                       + (rrmod[numsat]) * LIGHTSPEED / 1000.0;
     780                                + (rrmod[numsat]) * LIGHTSPEED / 1000.0;
    774781                  frqObs->_codeValid = true;
    775782                }
    776 
    777783                if (cp[count] > -1.0 / (1 << 8)) {
    778784                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    779                       + rrmod[numsat] * LIGHTSPEED / 1000.0 / cd.wl;
     785                                 + rrmod[numsat] * LIGHTSPEED / 1000.0 / cd.wl;
    780786                  frqObs->_phaseValid = true;
    781787                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    787793                if (psr[count] > -1.0 / (1 << 10)) {
    788794                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    789                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
     795                                + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
    790796                  frqObs->_codeValid = true;
    791797                }
    792 
    793798                if (cp[count] > -1.0 / (1 << 8)) {
    794799                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    795                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0
    796                           / cd.wl;
     800                                 + (rrmod[numsat] +  rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    797801                  frqObs->_phaseValid = true;
    798802                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    800804                  frqObs->_slipCounter = ll[count];
    801805                }
    802 
    803806                frqObs->_snr = cnr[count];
    804807                frqObs->_snrValid = true;
     
    807810                if (psr[count] > -1.0 / (1 << 10)) {
    808811                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    809                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
     812                                + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
    810813                  frqObs->_codeValid = true;
    811814                }
    812 
    813815                if (cp[count] > -1.0 / (1 << 8)) {
    814816                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    815                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0
    816                           / cd.wl;
     817                                 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    817818                  frqObs->_phaseValid = true;
    818819                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    820821                  frqObs->_slipCounter = ll[count];
    821822                }
    822 
    823823                frqObs->_snr = cnr[count];
    824824                frqObs->_snrValid = true;
    825 
    826825                if (dop[count] > -1.6384) {
    827826                  frqObs->_doppler = -(dop[count] + rdop[numsat]) / cd.wl;
     
    832831                if (psr[count] > -1.0 / (1 << 10)) {
    833832                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    834                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
     833                                + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
    835834                  frqObs->_codeValid = true;
    836835                }
    837 
    838836                if (cp[count] > -1.0 / (1 << 8)) {
    839837                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    840                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0
    841                           / cd.wl;
     838                                 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    842839                  frqObs->_phaseValid = true;
    843840                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    852849                if (psr[count] > -1.0 / (1 << 10)) {
    853850                  frqObs->_code = psr[count] * LIGHTSPEED / 1000.0
    854                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
     851                                + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0;
    855852                  frqObs->_codeValid = true;
    856853                }
    857 
    858854                if (cp[count] > -1.0 / (1 << 8)) {
    859855                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
    860                       + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0
    861                           / cd.wl;
     856                                 + (rrmod[numsat] + rrint[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    862857                  frqObs->_phaseValid = true;
    863858                  frqObs->_lockTime = lti2sec(type,ll[count]);
     
    879874        }
    880875      }
    881       if (CurrentObs._obs.size() > 0)
     876      if (CurrentObs._obs.size() > 0) {
    882877        _CurrentObsList.push_back(CurrentObs);
     878      }
    883879    }
    884880  }
     
    11181114    GETBITS(i, 1)
    11191115    tk += i * 30;
    1120     eph._tki = tk < 3 * 60 * 60 ? tk - 3 * 60 * 60 + 86400 : tk - 3 * 60 * 60;
     1116    eph._tki = tk - 3*60*60;
     1117    if(eph._tki < 0.0) {
     1118      eph._tki += 86400.0;
     1119    }
    11211120    GETBITS(eph._health, 1) /* MSB of Bn*/
    11221121    GETBITS(eph._P2, 1)  /* P2 */
  • trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_rtcm.h

    r8760 r8801  
    108108  CLOCKORBIT_NUMQZSS=10,
    109109  CLOCKORBIT_NUMSBAS=38,
    110   CLOCKORBIT_NUMBDS=37,
     110  CLOCKORBIT_NUMBDS=63,
    111111  CLOCKORBIT_NUMBIAS=100,
    112112  CLOCKORBIT_NUMIONOLAYERS=4,
     
    236236  CODETYPE_BDS_B2a_D         = 12,
    237237  CODETYPE_BDS_B2a_P         = 13,
    238   CODETYPE_BDS_B2a_DP        = 14
     238  CODETYPE_BDS_B2a_DP        = 14,
     239
     240  CODETYPE_IRNSS_S_SPS       = 8,
     241  CODETYPE_IRNSS_L5_SPS      = 22
    239242};
    240243
     
    372375
    373376/* return size of resulting data or 0 in case of an error */
    374 size_t MakeClockOrbit(const struct ClockOrbit *co, enum ClockOrbitType type,
     377size_t MakeClockOrbit(/*const*/ struct ClockOrbit *co, enum ClockOrbitType type,
    375378       int moremessagesfollow, char *buffer, size_t size);
    376379size_t MakeCodeBias(const struct CodeBias *b, enum CodeBiasType type,
  • trunk/BNC/src/RTCM3/gnss.h

    r8783 r8801  
    2626#define GNSS_H
    2727
    28 #define LIGHTSPEED         2.99792458e8    /* m/sec */
    29 #define GPS_FREQU_L1       1575420000.0  /* Hz */
    30 #define GPS_FREQU_L2       1227600000.0  /* Hz */
    31 #define GPS_FREQU_L5       1176450000.0  /* Hz */
    32 #define GPS_WAVELENGTH_L1  (LIGHTSPEED / GPS_FREQU_L1) /* m */
    33 #define GPS_WAVELENGTH_L2  (LIGHTSPEED / GPS_FREQU_L2) /* m */
    34 #define GPS_WAVELENGTH_L5  (LIGHTSPEED / GPS_FREQU_L5) /* m */
     28#define LIGHTSPEED          2.99792458e8    /* m/sec */
     29#define GPS_FREQU_L1        1575420000.0  /* Hz */
     30#define GPS_FREQU_L2        1227600000.0  /* Hz */
     31#define GPS_FREQU_L5        1176450000.0  /* Hz */
     32#define GPS_WAVELENGTH_L1   (LIGHTSPEED / GPS_FREQU_L1) /* m */
     33#define GPS_WAVELENGTH_L2   (LIGHTSPEED / GPS_FREQU_L2) /* m */
     34#define GPS_WAVELENGTH_L5   (LIGHTSPEED / GPS_FREQU_L5) /* m */
    3535
    36 #define GLO_FREQU_L1_BASE  1602000000.0  /* Hz */
    37 #define GLO_FREQU_L2_BASE  1246000000.0  /* Hz */
    38 #define GLO_FREQU_L1_STEP      562500.0  /* Hz */
    39 #define GLO_FREQU_L2_STEP      437500.0  /* Hz */
    40 #define GLO_FREQU_L1(a)      (GLO_FREQU_L1_BASE+(a)*GLO_FREQU_L1_STEP)
    41 #define GLO_FREQU_L2(a)      (GLO_FREQU_L2_BASE+(a)*GLO_FREQU_L2_STEP)
     36#define GLO_FREQU_L1_BASE   1602000000.0  /* Hz */
     37#define GLO_FREQU_L2_BASE   1246000000.0  /* Hz */
     38#define GLO_FREQU_L1_STEP       562500.0  /* Hz */
     39#define GLO_FREQU_L2_STEP       437500.0  /* Hz */
     40#define GLO_FREQU_L1(a)     (GLO_FREQU_L1_BASE+(a)*GLO_FREQU_L1_STEP)
     41#define GLO_FREQU_L2(a)     (GLO_FREQU_L2_BASE+(a)*GLO_FREQU_L2_STEP)
     42#define GLO_FREQU_L1a       1600995000.0  /* Hz */
     43#define GLO_FREQU_L2a       1248060000.0  /* Hz */
     44#define GLO_FREQU_L3        1202025000.0  /* Hz */
    4245#define GLO_WAVELENGTH_L1(a) (LIGHTSPEED / GLO_FREQU_L1(a)) /* m */
    4346#define GLO_WAVELENGTH_L2(a) (LIGHTSPEED / GLO_FREQU_L2(a)) /* m */
     47#define GLO_WAVELENGTH_L1a   (LIGHTSPEED / GLO_FREQU_L1a)   /* m */
     48#define GLO_WAVELENGTH_L2a   (LIGHTSPEED / GLO_FREQU_L2a)   /* m */
     49#define GLO_WAVELENGTH_L3    (LIGHTSPEED / GLO_FREQU_L3)    /* m */
    4450
    45 #define GAL_FREQU_E1       1575420000.0  /* Hz */
    46 #define GAL_FREQU_E5A      1176450000.0  /* Hz */
    47 #define GAL_FREQU_E5AB     1191795000.0  /* Hz */
    48 #define GAL_FREQU_E5B      1207140000.0  /* Hz */
    49 #define GAL_FREQU_E6       1278750000.0  /* Hz */
    50 #define GAL_WAVELENGTH_E1     (LIGHTSPEED / GAL_FREQU_E1) /* m */
    51 #define GAL_WAVELENGTH_E5A    (LIGHTSPEED / GAL_FREQU_E5A) /* m */
    52 #define GAL_WAVELENGTH_E5AB   (LIGHTSPEED / GAL_FREQU_E5AB) /* m */
    53 #define GAL_WAVELENGTH_E5B    (LIGHTSPEED / GAL_FREQU_E5B) /* m */
    54 #define GAL_WAVELENGTH_E6     (LIGHTSPEED / GAL_FREQU_E6) /* m */
     51#define GAL_FREQU_E1        1575420000.0  /* Hz */
     52#define GAL_FREQU_E5A       1176450000.0  /* Hz */
     53#define GAL_FREQU_E5AB      1191795000.0  /* Hz */
     54#define GAL_FREQU_E5B       1207140000.0  /* Hz */
     55#define GAL_FREQU_E6        1278750000.0  /* Hz */
     56#define GAL_WAVELENGTH_E1   (LIGHTSPEED / GAL_FREQU_E1) /* m */
     57#define GAL_WAVELENGTH_E5A  (LIGHTSPEED / GAL_FREQU_E5A) /* m */
     58#define GAL_WAVELENGTH_E5AB (LIGHTSPEED / GAL_FREQU_E5AB)/* m */
     59#define GAL_WAVELENGTH_E5B  (LIGHTSPEED / GAL_FREQU_E5B) /* m */
     60#define GAL_WAVELENGTH_E6   (LIGHTSPEED / GAL_FREQU_E6) /* m */
    5561
    56 #define QZSS_FREQU_L1       1575420000.0  /* Hz */
    57 #define QZSS_FREQU_L2       1227600000.0  /* Hz */
    58 #define QZSS_FREQU_L5       1176450000.0  /* Hz */
    59 #define QZSS_FREQU_L6      1278750000.0 /* Hz */
     62#define QZSS_FREQU_L1       1575420000.0 /* Hz */
     63#define QZSS_FREQU_L2       1227600000.0 /* Hz */
     64#define QZSS_FREQU_L5       1176450000.0 /* Hz */
     65#define QZSS_FREQU_L6       1278750000.0 /* Hz */
    6066#define QZSS_WAVELENGTH_L1  (LIGHTSPEED / QZSS_FREQU_L1) /* m */
    6167#define QZSS_WAVELENGTH_L2  (LIGHTSPEED / QZSS_FREQU_L2) /* m */
     
    6369#define QZSS_WAVELENGTH_L6  (LIGHTSPEED / QZSS_FREQU_L6) /* m */
    6470
    65 #define BDS_FREQU_B1       1561098000.0  /* Hz */
    66 #define BDS_FREQU_B2       1207140000.0  /* Hz */
    67 #define BDS_FREQU_B3       1268520000.0  /* Hz */
    68 #define BDS_WAVELENGTH_B1  (LIGHTSPEED / BDS_FREQU_B1) /* m */
    69 #define BDS_WAVELENGTH_B2  (LIGHTSPEED / BDS_FREQU_B2) /* m */
    70 #define BDS_WAVELENGTH_B3  (LIGHTSPEED / BDS_FREQU_B3) /* m */
     71#define BDS_FREQU_B1        1561098000.0  /* Hz */
     72#define BDS_FREQU_B2        1207140000.0  /* Hz */
     73#define BDS_FREQU_B3        1268520000.0  /* Hz */
     74#define BDS_FREQU_B1C       1575420000.0  /* Hz */
     75#define BDS_FREQU_B2a       1176450000.0  /* Hz */
     76#define BDS_WAVELENGTH_B1   (LIGHTSPEED / BDS_FREQU_B1)  /* m */
     77#define BDS_WAVELENGTH_B2   (LIGHTSPEED / BDS_FREQU_B2)  /* m */
     78#define BDS_WAVELENGTH_B3   (LIGHTSPEED / BDS_FREQU_B3)  /* m */
     79#define BDS_WAVELENGTH_B1C  (LIGHTSPEED / BDS_FREQU_B1C) /* m */
     80#define BDS_WAVELENGTH_B2a  (LIGHTSPEED / BDS_FREQU_B2a) /* m */
    7181
    72 #define IRNSS_FREQU_L5     1176450000.0 /* Hz */
    73 #define IRNSS_FREQU_S      2492028000.0 /* Hz */
     82#define IRNSS_FREQU_L5      1176450000.0 /* Hz */
     83#define IRNSS_FREQU_S       2492028000.0 /* Hz */
    7484#define IRNSS_WAVELENGTH_L5 (LIGHTSPEED / IRNSS_FREQU_L5) /* m */
    7585#define IRNSS_WAVELENGTH_S  (LIGHTSPEED / IRNSS_FREQU_S)  /* m */
  • trunk/BNC/src/bncutils.cpp

    r8790 r8801  
    173173    }
    174174  }
    175 
    176175}
    177176
     
    810809
    811810double accuracyFromIndex(int index, t_eph::e_type type) {
     811double accuracy = -1.0;
    812812
    813813  if (type == t_eph::GPS ||
     
    817817    if ((index >= 0) && (index <= 6)) {
    818818      if (index == 3) {
    819         return  ceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;
     819        accuracy =  ceil(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;
    820820      }
    821821      else {
    822         return floor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;
     822        accuracy = floor(10.0 * pow(2.0, (double(index) / 2.0) + 1.0)) / 10.0;
    823823      }
    824824    }
    825825    else if ((index > 6) && (index <= 15)) {
    826       return (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0;
     826      accuracy = (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0;
    827827    }
    828828    else {
    829       return 8192.0;
     829      accuracy = 8192.0;
    830830    }
    831831  }
    832832  else if (type == t_eph::Galileo) {
    833 
    834833    if ((index >= 0) && (index <= 49)) {
    835       return (double(index) / 100.0);
     834      accuracy = (double(index) / 100.0);
    836835    }
    837836    else if ((index > 49) && (index <= 74)) {
    838       return (50.0 + (double(index) - 50.0) * 2.0) / 100.0;
     837      accuracy = (50.0 + (double(index) - 50.0) * 2.0) / 100.0;
    839838    }
    840839    else if ((index > 74) && (index <= 99)) {
    841       return 1.0 + (double(index) - 75.0) * 0.04;
     840      accuracy = 1.0 + (double(index) - 75.0) * 0.04;
    842841    }
    843842    else if ((index > 99) && (index <= 125)) {
    844       return 2.0 + (double(index) - 100.0) * 0.16;
     843      accuracy = 2.0 + (double(index) - 100.0) * 0.16;
    845844    }
    846845    else {
    847       return -1.0;
     846      accuracy = -1.0;
    848847    }
    849848  }
     
    851850    if ((index >= 0) && (index <= 6)) {
    852851      if      (index == 1) {
    853         return 2.8;
     852        accuracy = 2.8;
    854853      }
    855854      else if (index == 3) {
    856         return 5.7;
     855        accuracy = 5.7;
    857856      }
    858857      else if (index == 5) {
    859         return 11.3;
     858        accuracy = 11.3;
    860859      }
    861860      else {
    862         return pow(2, 1 + index / 2);
     861        accuracy = pow(2, 1 + index / 2);
    863862      }
    864863    }
    865864    else if ((index > 6) && (index <= 15)) {
    866       return pow(2, index - 1);
    867     }
    868   }
    869 
    870   return double(index);
     865      accuracy = pow(2, index - 2);
     866    }
     867  }
     868  return accuracy;
    871869}
    872870
Note: See TracChangeset for help on using the changeset viewer.