Changeset 8801 in ntrip for trunk/BNC/src/bncutils.cpp


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.