Changeset 5368 in ntrip for trunk/BNC/src/RTCM/GPSDecoder.cpp


Ignore:
Timestamp:
Aug 29, 2013, 5:18:41 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM/GPSDecoder.cpp

    r5367 r5368  
    105105  }
    106106
    107   int ie = 0;
    108   switch(rnxStr[0].toAscii()) {
    109   case 'C': ie += GNSSENTRY_CODE;    break;
    110   case 'L': ie += GNSSENTRY_PHASE;   break;
    111   case 'D': ie += GNSSENTRY_DOPPLER; break;
    112   case 'S': ie += GNSSENTRY_SNR;     break;
    113   default: return;
     107  int ie = iEntry(rnxStr, rnxVers);
     108
     109  if (ie != -1) {
     110    _codetype[ie] = rnxStr.mid(1);
     111    _measdata[ie] = value;
    114112  }
    115   switch(rnxStr[1].toAscii()) {
    116   case '1':
    117     switch(rnxStr[2].toAscii()) {
    118     default:
    119     case 'C':                     ie += GNSSENTRY_TYPEC1;    break;
    120     case 'P': case 'W': case 'Y': ie += GNSSENTRY_TYPEP1;    break;
    121     case 'A': case 'B':
    122     case 'S': case 'L': case 'X': ie += GNSSENTRY_TYPEC1;    break;
    123     case 'Z':                     ie += GNSSENTRY_TYPECSAIF; break;
    124     }
    125     break;
    126   case '2':
    127     switch(rnxStr[2].toAscii()) {
    128     default:
    129     case 'P': case 'W': case 'Y':           ie += GNSSENTRY_TYPEP2;  break;
    130     case 'C': case 'S': case 'L': case 'X': ie += GNSSENTRY_TYPEC2;  break;
    131     case 'I':                               ie += GNSSENTRY_TYPEC5B; break;
    132     }
    133     break;
    134   case '5':
    135     ie += GNSSENTRY_TYPEC5;   break;
    136   case '6':
    137     ie += GNSSENTRY_TYPEC6;   break;
    138   case '7':
    139     ie += GNSSENTRY_TYPEC5B;  break;
    140   case '8':
    141     ie += GNSSENTRY_TYPEC5AB; break;
    142   }
    143 
    144   _codetype[ie] = rnxStr.mid(1);
    145   _measdata[ie] = value;
    146113}
    147114
     
    161128//////////////////////////////////////////////////////////////////////////////
    162129int t_obs::iEntry(QString rnxStr, float rnxVers) const {
    163 
    164130  if (rnxVers < 3.0) {
    165131    if      (rnxStr == "C1") rnxStr = "C1C";
     
    168134    else if (rnxStr == "P2") rnxStr = "C2P";
    169135  }
    170 
    171   for (int ie = 0; ie <  GNSSENTRY_NUMBER; ie++) {
    172     if (rnxStr.mid(1) == _codetype[ie]) {
    173       if      (rnxStr[0] == 'C') {
    174         return ie + GNSSENTRY_CODE;
    175       }
    176       else if (rnxStr[0] == 'L') {
    177         return ie + GNSSENTRY_PHASE;
    178       }
    179       else if (rnxStr[0] == 'D') {
    180         return ie + GNSSENTRY_DOPPLER;
    181       }
    182       else if (rnxStr[0] == 'S') {
    183         return ie + GNSSENTRY_SNR;
    184       }
    185       else {
    186         return -1;
    187       }
     136  int res = 0;
     137  switch(rnxStr[0].toAscii())
     138  {
     139  case 'C': res += GNSSENTRY_CODE; break;
     140  case 'L': res += GNSSENTRY_PHASE; break;
     141  case 'D': res += GNSSENTRY_DOPPLER; break;
     142  case 'S': res += GNSSENTRY_SNR; break;
     143  default:
     144    return -1;
     145  }
     146  switch(rnxStr[1].toAscii())
     147  {
     148  case '1':
     149    switch(rnxStr[2].toAscii())
     150    {
     151    default:
     152    case 'C': res += GNSSENTRY_TYPEC1; break;
     153    case 'P': case'W': case 'Y': res += GNSSENTRY_TYPEP1; break;
     154    case 'A': case'B':
     155    case 'S': case'L': case 'X': res += GNSSENTRY_TYPEC1; break;
     156    case 'Z': res += GNSSENTRY_TYPECSAIF; break;
    188157    }
     158    break;
     159  case '2':
     160    switch(rnxStr[2].toAscii())
     161    {
     162    default:
     163    case 'P': case 'W': case 'Y': res += GNSSENTRY_TYPEP2; break;
     164    case 'C': case 'S': case 'L': case 'X': res += GNSSENTRY_TYPEC2; break;
     165    case 'I': res += GNSSENTRY_TYPEC5B; break;
     166    }
     167    break;
     168  case '5':
     169    res += GNSSENTRY_TYPEC5;
     170    break;
     171  case '6':
     172    res += GNSSENTRY_TYPEC6;
     173    break;
     174  case '7':
     175    res += GNSSENTRY_TYPEC5B;
     176    break;
     177  case '8':
     178    res += GNSSENTRY_TYPEC5AB;
     179    break;
    189180  }
    190   return -1;
     181  return res;
    191182}
    192183
     
    201192    case GNSSENTRY_SNR:     str[0] = 'S'; break;
    202193  }
    203   if (!_codetype[iEntry].isEmpty()) {
    204     str[1] = _codetype[iEntry][0];
    205     str[2] = _codetype[iEntry][1];
    206   }
     194  str += _codetype[iEntry];
    207195  return str.trimmed();
    208196}
Note: See TracChangeset for help on using the changeset viewer.