Changeset 6799 in ntrip for trunk/BNC/src/RTCM3/ephEncoder.cpp


Ignore:
Timestamp:
Apr 28, 2015, 4:17:15 PM (9 years ago)
Author:
stuerze
Message:

simplification and harmonization of the conversion from accuracy indices into metric values and vice versa

File:
1 edited

Legend:

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

    r6635 r6799  
    4545  int numbits = 0;
    4646  unsigned long long bitbuffer = 0;
    47   if (eph._ura <= 2.40){
    48     eph._ura = 0;
    49   }
    50   else if (eph._ura <= 3.40){
    51     eph._ura = 1;
    52   }
    53   else if (eph._ura <= 6.85){
    54     eph._ura = 2;
    55   }
    56   else if (eph._ura <= 9.65){
    57     eph._ura = 3;
    58   }
    59   else if (eph._ura <= 13.65){
    60     eph._ura = 4;
    61   }
    62   else if (eph._ura <= 24.00){
    63     eph._ura = 5;
    64   }
    65   else if (eph._ura <= 48.00){
    66     eph._ura = 6;
    67   }
    68   else if (eph._ura <= 96.00){
    69     eph._ura = 7;
    70   }
    71   else if (eph._ura <= 192.00){
    72     eph._ura = 8;
    73   }
    74   else if (eph._ura <= 384.00){
    75     eph._ura = 9;
    76   }
    77   else if (eph._ura <= 768.00){
    78     eph._ura = 10;
    79   }
    80   else if (eph._ura <= 1536.00){
    81     eph._ura = 11;
    82   }
    83   else if (eph._ura <= 1536.00){
    84     eph._ura = 12;
    85   }
    86   else if (eph._ura <= 2072.00){
    87     eph._ura = 13;
    88   }
    89   else if (eph._ura <= 6144.00){
    90     eph._ura = 14;
    91   }
    92   else{
    93     eph._ura = 15;
    94   }
    95 
     47  eph._ura = indexFromAccuracy(eph._ura, eph.type());
    9648  GPSADDBITS(12, 1019)
    9749  if (eph._prn.system() == 'J') {
     
    256208  buffer= buffer+3;
    257209
     210  eph._SISA = indexFromAccuracy(eph._SISA, eph.type());
     211
    258212  bool inav = ( (eph._flags & GALEPHF_INAV) == GALEPHF_INAV );
    259 
    260213  GALILEOADDBITS(12, inav ? 1046 : 1045)
    261214  GALILEOADDBITS(6, eph._prn.number())
     
    340293  buffer= buffer+3;
    341294
     295  eph._ura = indexFromAccuracy(eph._ura, eph.type());
    342296  SBASADDBITS(12, 1043)
    343297  SBASADDBITS(6, eph._prn.number()-20)
     
    388342  buffer= buffer+3;
    389343
     344  eph._URA = indexFromAccuracy(eph._URA, eph.type());
    390345  BDSADDBITS(12, RTCM3ID_BDS)
    391346  BDSADDBITS(6, eph._prn.number())
    392347  BDSADDBITS(13, eph._TOC_bdt.gpsw() - 1356.0)
    393   BDSADDBITS(4, eph._URAI);
     348  BDSADDBITS(4, eph._URA);
    394349  BDSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
    395350  BDSADDBITS(5, eph._AODE)
Note: See TracChangeset for help on using the changeset viewer.