Changeset 1841 in ntrip for trunk/BNS/RTCM


Ignore:
Timestamp:
May 13, 2009, 12:24:37 AM (16 years ago)
Author:
weber
Message:

* empty log message *

Location:
trunk/BNS/RTCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/RTCM/clock_orbit_rtcm.c

    r1831 r1841  
    33        Name:           clock_orbit_rtcm.c
    44        Project:        RTCM3
    5         Version:        $Id: clock_orbit_rtcm.c,v 1.13 2009/05/06 14:02:39 stoecker Exp $
     5        Version:        $Id: clock_orbit_rtcm.c,v 1.7 2009/05/12 13:19:03 stoecker Exp $
    66        Authors:        Dirk Stöcker
    77        Description:    state space approach for RTCM3
     
    147147  if(co->NumberOfGPSSat && co->ClockDataSupplied && co->OrbitDataSupplied
    148148  && (type == COTYPE_AUTO || type == COTYPE_GPSCOMBINED)
    149   && co->NumberOfGPSSat < 28)
     149  /*&& co->NumberOfGPSSat <= 28*/)
    150150  {
    151151    gpsco = 1; gpsor = 0; gpscl = 0;
     
    178178    T_GPS_EPOCH_TIME(co->GPSEpochTime)
    179179    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    180     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     180    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    181181    --mmi;
    182182    T_RESERVED5
     
    206206    T_GPS_EPOCH_TIME(co->GPSEpochTime)
    207207    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    208     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     208    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    209209    --mmi;
    210210    T_RESERVED5
     
    221221  if(gpsco)
    222222  {
    223     INITBLOCK
    224     T_MESSAGE_NUMBER(COTYPE_GPSCOMBINED)
    225     T_GPS_EPOCH_TIME(co->GPSEpochTime)
    226     T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    227     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
    228     --mmi;
    229     T_RESERVED5
    230     T_NO_OF_SATELLITES(co->NumberOfGPSSat)
    231     for(i = 0; i < co->NumberOfGPSSat; ++i)
    232     {
    233       T_GPS_SATELLITE_ID(co->Sat[i].ID)
    234       T_GPS_IODE(co->Sat[i].IOD)
    235       T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    236       T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    237       T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    238       T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    239       T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    240       T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    241       T_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    242       T_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    243       T_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
    244       T_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    245       T_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    246       T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
    247       T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
    248       T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
    249     }
    250     ENDBLOCK
     223    int nums, left, start = 0;
     224    nums = co->NumberOfGPSSat;
     225    if(nums > 28) /* split block when more than 28 sats */
     226    {
     227      left = nums - 28;
     228      nums = 28;
     229    }
     230    while(nums)
     231    {
     232      INITBLOCK
     233      T_MESSAGE_NUMBER(COTYPE_GPSCOMBINED)
     234      T_GPS_EPOCH_TIME(co->GPSEpochTime)
     235      T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
     236      T_MULTIPLE_MESSAGE_INDICATOR(/*mmi || */ left ? 1 : 0)
     237      --mmi;
     238      T_RESERVED5
     239      T_NO_OF_SATELLITES(nums)
     240      for(i = start; i < start+nums; ++i)
     241      {
     242        T_GPS_SATELLITE_ID(co->Sat[i].ID)
     243        T_GPS_IODE(co->Sat[i].IOD)
     244        T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
     245        T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
     246        T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
     247        T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
     248        T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
     249        T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
     250        T_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
     251        T_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
     252        T_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
     253        T_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
     254        T_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
     255        T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
     256        T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
     257        T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
     258      }
     259      ENDBLOCK
     260      start += nums;
     261      nums = left;
     262      left = 0;
     263    }
    251264  }
    252265  if(gpshr)
     
    256269    T_GPS_EPOCH_TIME(co->GPSEpochTime)
    257270    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    258     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     271    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    259272    --mmi;
    260273    T_RESERVED5
     
    272285    T_MESSAGE_NUMBER(COTYPE_GPSURA)
    273286    T_GPS_EPOCH_TIME(co->GPSEpochTime)
    274     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     287    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    275288    --mmi;
    276289    T_RESERVED5
     
    289302    T_GLONASS_EPOCH_TIME(co->GLONASSEpochTime)
    290303    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    291     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     304    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    292305    --mmi;
    293306    T_RESERVED5
     
    318331    T_GLONASS_EPOCH_TIME(co->GLONASSEpochTime)
    319332    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    320     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     333    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    321334    --mmi;
    322335    T_RESERVED5
     
    339352    T_GLONASS_EPOCH_TIME(co->GLONASSEpochTime)
    340353    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    341     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     354    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    342355    --mmi;
    343356    T_RESERVED5
     
    371384    T_GLONASS_EPOCH_TIME(co->GLONASSEpochTime)
    372385    T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
    373     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     386    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    374387    --mmi;
    375388    T_RESERVED5
     
    388401    T_MESSAGE_NUMBER(COTYPE_GLONASSURA)
    389402    T_GLONASS_EPOCH_TIME(co->GLONASSEpochTime)
    390     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     403    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    391404    --mmi;
    392405    T_RESERVED5
     
    425438    T_GPS_EPOCH_TIME(b->GPSEpochTime)
    426439    T_SSR_UPDATE_INTERVAL(b->UpdateInterval)
    427     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     440    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    428441    --mmi;
    429442    T_RESERVED5
     
    447460    T_GPS_EPOCH_TIME(b->GLONASSEpochTime)
    448461    T_SSR_UPDATE_INTERVAL(b->UpdateInterval)
    449     T_MULTIPLE_MESSAGE_INDICATOR(mmi ? 1 :0)
     462    T_MULTIPLE_MESSAGE_INDICATOR(/*mmi ? 1 :*/0)
    450463    --mmi;
    451464    T_RESERVED5
     
    512525#define G_MESSAGE_NUMBER(a)              GETBITS(a, 12) /* DF002 */
    513526#define G_RESERVED5                      SKIPBITS(5)    /* DF001 */
    514 #define G_GPS_SATELLITE_ID(a)            {int temp; GETBITS(temp, 6) \
    515  if(a && a != temp) return GCOBR_DATAMISMATCH; a = temp;}  /* DF068 */
     527#define G_GPS_SATELLITE_ID(a)            GETBITS(a, 6)  /* DF068 */
    516528#define G_GPS_IODE(a)                    GETBITS(a, 8)  /* DF071 */
    517529#define G_GLONASS_IOD(a)                 GETBITS(a, 8)  /* DF237 */
     
    538550#define G_GALILEO_SIGNAL_IDENTIFIER(a)   GETBITS(a, 5)
    539551#define G_CODE_BIAS(a)                   GETFLOATSIGN(a, 14, 1/100.0)
    540 #define G_GLONASS_SATELLITE_ID(a)        {int temp; GETBITS(temp, 5) \
    541  if(a && a != temp) return GCOBR_DATAMISMATCH; a = temp;}
     552#define G_GLONASS_SATELLITE_ID(a)        GETBITS(a, 5)
    542553
    543554#define G_GPS_EPOCH_TIME(a, b)           {int temp; GETBITS(temp, 20) \
     
    545556#define G_GLONASS_EPOCH_TIME(a, b)       {int temp; GETBITS(temp, 17) \
    546557 if(b && a != temp) return GCOBR_TIMEMISMATCH; a = temp;}
    547 #define G_NO_OF_SATELLITES(a)            {int temp; GETBITS(temp, 6) \
    548  if(a && a != temp) return GCOBR_DATAMISMATCH; a = temp;}
     558#define G_NO_OF_SATELLITES(a)            GETBITS(a, 6)
    549559#define G_MULTIPLE_MESSAGE_INDICATOR(a)  GETBITS(a, 1)
    550560#define G_SSR_URA(a)                     GETBITS(a, 4)
     
    552562#define G_SSR_UPDATE_INTERVAL(a)         GETBITS(a, 4)
    553563
    554 #ifdef OLD
    555 enum OldClockOrbitType { OLDCOTYPE_GPSORBIT=4050, OLDCOTYPE_GPSCLOCK=4051,
    556      OLDCOTYPE_GLONASSORBIT=4053, OLDCOTYPE_GLONASSCLOCK=4054,
    557      OLDCOTYPE_GPSCOMBINED=4056, OLDCOTYPE_GLONASSCOMBINED=4057};
    558 enum OldBiasType { OLDBTYPE_GPS=4052, OLDBTYPE_GLONASS=4055};
    559 #define OLD_G_RESERVED6                      SKIPBITS(6)    /* DF001 */
    560 #define OLD_G_GLONASS_SATELLITE_ID(a)        {int temp; GETBITS(temp, 6) \
    561  if(a && a != temp) return GCOBR_DATAMISMATCH; a = temp;}
    562 #define OLD_G_NO_OF_SATELLITES(a)            {int temp; GETBITS(temp, 5) \
    563  if(a && a != temp) return GCOBR_DATAMISMATCH; a = temp;}
    564 #define OLD_G_DELTA_RADIAL(a)                GETFLOATSIGN(a, 20, 1/1000.0)
    565 #define OLD_G_DELTA_ALONG_TRACK(a)           GETFLOATSIGN(a, 20, 1/1000.0)
    566 #define OLD_G_DELTA_CROSS_TRACK(a)           GETFLOATSIGN(a, 20, 1/1000.0)
    567 #define OLD_G_DELTA_DOT_RADIAL(a)            GETFLOATSIGN(a, 20, 1/100000.0)
    568 #define OLD_G_DELTA_DOT_ALONG_TRACK(a)       GETFLOATSIGN(a, 20, 1/100000.0)
    569 #define OLD_G_DELTA_DOT_CROSS_TRACK(a)       GETFLOATSIGN(a, 20, 1/100000.0)
    570 #define OLD_G_DELTA_DOT_DOT_RADIAL(a)        GETFLOATSIGN(a, 20, 1/5000000.0)
    571 #define OLD_G_DELTA_DOT_DOT_ALONG_TRACK(a)   GETFLOATSIGN(a, 20, 1/5000000.0)
    572 #define OLD_G_DELTA_DOT_DOT_CROSS_TRACK(a)   GETFLOATSIGN(a, 20, 1/5000000.0)
    573 #define OLD_G_DELTA_A0(a)                    GETFLOATSIGN(a, 20, 1/1000.0)
    574 #define OLD_G_DELTA_A1(a)                    GETFLOATSIGN(a, 20, 1/100000.0)
    575 #define OLD_G_DELTA_A2(a)                    GETFLOATSIGN(a, 20, 1/5000000.0)
    576 #define OLD_G_CODE_BIAS(a)                   GETFLOATSIGN(a, 20, 1/100.0)
    577 #endif
    578 
    579564enum GCOB_RETURN GetClockOrbitBias(struct ClockOrbit *co, struct Bias *b,
    580565const char *buffer, size_t size, int *bytesused)
    581566{
    582   int type, mmi=0, i, j, h, rs;
     567  int type, mmi=0, i, j, h, rs, nums, pos, id;
    583568  size_t sizeofrtcmblock;
    584569  const char *blockstart = buffer;
     
    617602    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    618603    G_RESERVED5
    619     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    620     if(co->OrbitDataSupplied&1)
    621       return GCOBR_DATAMISMATCH;
     604    G_NO_OF_SATELLITES(nums)
    622605    co->OrbitDataSupplied |= 1;
    623606#ifdef DEBUG
    624607fprintf(stderr, "epochtime %d ui %d mmi %d sats %d\n",co->GPSEpochTime,co->UpdateInterval,mmi,co->NumberOfGPSSat);
    625608#endif
    626     for(i = 0; i < co->NumberOfGPSSat; ++i)
    627     {
    628       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    629       G_GPS_IODE(co->Sat[i].IOD)
    630       G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    631       G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    632       G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    633       G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    634       G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    635       G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    636       G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    637       G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    638       G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
     609    for(i = 0; i < nums; ++i)
     610    {
     611      G_GPS_SATELLITE_ID(id)
     612      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     613        ;
     614      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     615      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     616      co->Sat[pos].ID = id;
     617
     618      G_GPS_IODE(co->Sat[pos].IOD)
     619      G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
     620      G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
     621      G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
     622      G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
     623      G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
     624      G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
     625      G_DELTA_DOT_DOT_RADIAL(co->Sat[pos].Orbit.DotDotDeltaRadial)
     626      G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDotDeltaAlongTrack)
     627      G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDotDeltaCrossTrack)
    639628      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    640629      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    641630#ifdef DEBUG
    642631fprintf(stderr, "id %2d iod %3d dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f dr %8.3f da %8.3f dc %8.3f rp %d rd %d\n",
    643 co->Sat[i].ID,co->Sat[i].IOD,co->Sat[i].Orbit.DeltaRadial,
    644 co->Sat[i].Orbit.DeltaAlongTrack,co->Sat[i].Orbit.DeltaCrossTrack,
    645 co->Sat[i].Orbit.DotDeltaRadial,
    646 co->Sat[i].Orbit.DotDeltaAlongTrack,
    647 co->Sat[i].Orbit.DotDeltaCrossTrack,
    648 co->Sat[i].Orbit.DotDotDeltaRadial,
    649 co->Sat[i].Orbit.DotDotDeltaAlongTrack,
    650 co->Sat[i].Orbit.DotDotDeltaCrossTrack,
     632co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial,
     633co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack,
     634co->Sat[pos].Orbit.DotDeltaRadial,
     635co->Sat[pos].Orbit.DotDeltaAlongTrack,
     636co->Sat[pos].Orbit.DotDeltaCrossTrack,
     637co->Sat[pos].Orbit.DotDotDeltaRadial,
     638co->Sat[pos].Orbit.DotDotDeltaAlongTrack,
     639co->Sat[pos].Orbit.DotDotDeltaCrossTrack,
    651640co->SatRefPoint,
    652641co->SatRefDatum);
     
    662651    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    663652    G_RESERVED5
    664     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    665     if(co->ClockDataSupplied & 1)
    666       return GCOBR_DATAMISMATCH;
     653    G_NO_OF_SATELLITES(nums)
    667654    co->ClockDataSupplied |= 1;
    668     for(i = 0; i < co->NumberOfGPSSat; ++i)
    669     {
    670       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    671       G_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
    672       G_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
    673       G_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
     655    for(i = 0; i < nums; ++i)
     656    {
     657      G_GPS_SATELLITE_ID(id)
     658      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     659        ;
     660      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     661      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     662      co->Sat[pos].ID = id;
     663
     664      G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
     665      G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
     666      G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
    674667    }
    675668    break;
     
    682675    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    683676    G_RESERVED5
    684     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    685     if((co->ClockDataSupplied&1) || (co->OrbitDataSupplied&1))
    686       return GCOBR_DATAMISMATCH;
     677    G_NO_OF_SATELLITES(nums)
    687678    co->OrbitDataSupplied |= 1;
    688679    co->ClockDataSupplied |= 1;
    689     for(i = 0; i < co->NumberOfGPSSat; ++i)
    690     {
    691       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    692       G_GPS_IODE(co->Sat[i].IOD)
    693       G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    694       G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    695       G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    696       G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    697       G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    698       G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    699       G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    700       G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    701       G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
     680    for(i = 0; i < nums; ++i)
     681    {
     682      G_GPS_SATELLITE_ID(id)
     683      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     684        ;
     685      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     686      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     687      co->Sat[pos].ID = id;
     688
     689      G_GPS_IODE(co->Sat[pos].IOD)
     690      G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
     691      G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
     692      G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
     693      G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
     694      G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
     695      G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
     696      G_DELTA_DOT_DOT_RADIAL(co->Sat[pos].Orbit.DotDotDeltaRadial)
     697      G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDotDeltaAlongTrack)
     698      G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDotDeltaCrossTrack)
    702699      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    703700      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    704       G_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
    705       G_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
    706       G_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
     701      G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
     702      G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
     703      G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
    707704    }
    708705    break;
     
    714711    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    715712    G_RESERVED5
    716     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    717     if(co->URADataSupplied&1)
    718       return GCOBR_DATAMISMATCH;
     713    G_NO_OF_SATELLITES(nums)
    719714    co->URADataSupplied |= 1;
    720     for(i = 0; i < co->NumberOfGPSSat; ++i)
    721     {
    722       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    723       G_SSR_URA(co->Sat[i].URA)
     715    for(i = 0; i < nums; ++i)
     716    {
     717      G_GPS_SATELLITE_ID(id)
     718      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     719        ;
     720      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     721      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     722      co->Sat[pos].ID = id;
     723
     724      G_SSR_URA(co->Sat[pos].URA)
    724725    }
    725726    break;
     
    732733    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    733734    G_RESERVED5
    734     G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    735     if(co->HRDataSupplied&1)
    736       return GCOBR_DATAMISMATCH;
     735    G_NO_OF_SATELLITES(nums)
    737736    co->HRDataSupplied |= 1;
    738     for(i = 0; i < co->NumberOfGPSSat; ++i)
    739     {
    740       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    741       G_HR_CLOCK_CORRECTION(co->Sat[i].hrclock)
     737    for(i = 0; i < nums; ++i)
     738    {
     739      G_GPS_SATELLITE_ID(id)
     740      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     741        ;
     742      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     743      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     744      co->Sat[pos].ID = id;
     745
     746      G_HR_CLOCK_CORRECTION(co->Sat[pos].hrclock)
    742747    }
    743748    break;
     
    748753    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    749754    G_RESERVED5
    750     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    751     if(co->OrbitDataSupplied&2)
    752       return GCOBR_DATAMISMATCH;
     755    G_NO_OF_SATELLITES(nums)
    753756    co->OrbitDataSupplied |= 2;
    754     for(i = CLOCKORBIT_NUMGPS;
    755     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    756     {
    757       G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    758       G_GLONASS_IOD(co->Sat[i].IOD)
    759       G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    760       G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    761       G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    762       G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    763       G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    764       G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    765       G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    766       G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    767       G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
     757    for(i = 0; i < nums; ++i)
     758    {
     759      G_GLONASS_SATELLITE_ID(id)
     760      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     761        ;
     762      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     763      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     764      co->Sat[pos].ID = id;
     765
     766      G_GLONASS_SATELLITE_ID(co->Sat[pos].ID)
     767      G_GLONASS_IOD(co->Sat[pos].IOD)
     768      G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
     769      G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
     770      G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
     771      G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
     772      G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
     773      G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
     774      G_DELTA_DOT_DOT_RADIAL(co->Sat[pos].Orbit.DotDotDeltaRadial)
     775      G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDotDeltaAlongTrack)
     776      G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDotDeltaCrossTrack)
    768777      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    769778      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
     
    776785    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    777786    G_RESERVED5
    778     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    779     if(co->ClockDataSupplied&2)
    780       return GCOBR_DATAMISMATCH;
     787    G_NO_OF_SATELLITES(nums)
    781788    co->ClockDataSupplied |= 2;
    782     for(i = CLOCKORBIT_NUMGPS;
    783     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    784     {
    785       G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    786       G_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
    787       G_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
    788       G_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
     789    for(i = 0; i < nums; ++i)
     790    {
     791      G_GLONASS_SATELLITE_ID(id)
     792      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     793        ;
     794      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     795      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     796      co->Sat[pos].ID = id;
     797
     798      G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
     799      G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
     800      G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
    789801    }
    790802    break;
     
    795807    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    796808    G_RESERVED5
    797     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    798     if((co->ClockDataSupplied&2) || (co->OrbitDataSupplied&2))
    799       return GCOBR_DATAMISMATCH;
     809    G_NO_OF_SATELLITES(nums)
    800810    co->OrbitDataSupplied |= 2;
    801811    co->ClockDataSupplied |= 2;
    802     for(i = CLOCKORBIT_NUMGPS;
    803     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    804     {
    805       G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    806       G_GLONASS_IOD(co->Sat[i].IOD)
    807       G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    808       G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    809       G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    810       G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    811       G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    812       G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    813       G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    814       G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    815       G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
     812    for(i = 0; i < nums; ++i)
     813    {
     814      G_GLONASS_SATELLITE_ID(id)
     815      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     816        ;
     817      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     818      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     819      co->Sat[pos].ID = id;
     820
     821      G_GLONASS_IOD(co->Sat[pos].IOD)
     822      G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
     823      G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
     824      G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
     825      G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
     826      G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
     827      G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
     828      G_DELTA_DOT_DOT_RADIAL(co->Sat[pos].Orbit.DotDotDeltaRadial)
     829      G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDotDeltaAlongTrack)
     830      G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDotDeltaCrossTrack)
    816831      G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    817832      G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    818       G_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
    819       G_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
    820       G_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
     833      G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
     834      G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
     835      G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
    821836    }
    822837    break;
     
    826841    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    827842    G_RESERVED5
    828     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    829     if(co->URADataSupplied&2)
    830       return GCOBR_DATAMISMATCH;
     843    G_NO_OF_SATELLITES(nums)
    831844    co->URADataSupplied |= 2;
    832     for(i = CLOCKORBIT_NUMGPS;
    833     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    834     {
    835       G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    836       G_SSR_URA(co->Sat[i].URA)
     845    for(i = 0; i < nums; ++i)
     846    {
     847      G_GLONASS_SATELLITE_ID(id)
     848      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     849        ;
     850      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     851      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     852      co->Sat[pos].ID = id;
     853
     854      G_SSR_URA(co->Sat[pos].URA)
    837855    }
    838856    break;
     
    843861    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    844862    G_RESERVED5
    845     G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    846     if(co->HRDataSupplied&2)
    847       return GCOBR_DATAMISMATCH;
     863    G_NO_OF_SATELLITES(nums)
    848864    co->HRDataSupplied |= 2;
    849     for(i = CLOCKORBIT_NUMGPS;
    850     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    851     {
    852       G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    853       G_HR_CLOCK_CORRECTION(co->Sat[i].hrclock)
     865    for(i = 0; i < nums; ++i)
     866    {
     867      G_GLONASS_SATELLITE_ID(id)
     868      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     869        ;
     870      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     871      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     872      co->Sat[pos].ID = id;
     873
     874      G_HR_CLOCK_CORRECTION(co->Sat[pos].hrclock)
    854875    }
    855876    break;
     
    860881    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    861882    G_RESERVED5
    862     G_NO_OF_SATELLITES(b->NumberOfGPSSat)
    863     for(i = 0; i < b->NumberOfGPSSat; ++i)
    864     {
    865       G_GPS_SATELLITE_ID(b->Sat[i].ID)
    866       G_NO_OF_CODE_BIASES(b->Sat[i].NumberOfCodeBiases)
    867       for(j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j)
     883    G_NO_OF_SATELLITES(nums)
     884    for(i = 0; i < nums; ++i)
     885    {
     886      G_GPS_SATELLITE_ID(id)
     887      for(pos = 0; pos < co->NumberOfGPSSat && co->Sat[pos].ID != id; ++pos)
     888        ;
     889      if(pos >= CLOCKORBIT_NUMGPS) return GCOBR_DATAMISMATCH;
     890      else if(pos == co->NumberOfGPSSat) ++co->NumberOfGPSSat;
     891      co->Sat[pos].ID = id;
     892
     893      G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases)
     894      for(j = 0; j < b->Sat[pos].NumberOfCodeBiases; ++j)
    868895      {
    869         G_GPS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
    870         G_CODE_BIAS(b->Sat[i].Biases[j].Bias)
     896        G_GPS_SIGNAL_IDENTIFIER(b->Sat[pos].Biases[j].Type)
     897        G_CODE_BIAS(b->Sat[pos].Biases[j].Bias)
    871898      }
    872899    }
     
    878905    G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    879906    G_RESERVED5
    880     G_NO_OF_SATELLITES(b->NumberOfGLONASSSat)
    881     for(i = CLOCKORBIT_NUMGPS;
    882     i < CLOCKORBIT_NUMGPS+b->NumberOfGLONASSSat; ++i)
    883     {
    884       G_GLONASS_SATELLITE_ID(b->Sat[i].ID)
    885       G_NO_OF_CODE_BIASES(b->Sat[i].NumberOfCodeBiases)
    886       for(j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j)
     907    G_NO_OF_SATELLITES(nums)
     908    for(i = 0; i < nums; ++i)
     909    {
     910      G_GLONASS_SATELLITE_ID(id)
     911      for(pos = CLOCKORBIT_NUMGPS; pos < co->NumberOfGLONASSSat && co->Sat[pos].ID != id; ++pos)
     912        ;
     913      if(pos >= CLOCKORBIT_NUMGPS+CLOCKORBIT_NUMGLONASS) return GCOBR_DATAMISMATCH;
     914      else if(pos == co->NumberOfGLONASSSat) ++co->NumberOfGLONASSSat;
     915      co->Sat[pos].ID = id;
     916
     917      G_NO_OF_CODE_BIASES(b->Sat[pos].NumberOfCodeBiases)
     918      for(j = 0; j < b->Sat[pos].NumberOfCodeBiases; ++j)
    887919      {
    888         G_GLONASS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
    889         G_CODE_BIAS(b->Sat[i].Biases[j].Bias)
     920        G_GLONASS_SIGNAL_IDENTIFIER(b->Sat[pos].Biases[j].Type)
     921        G_CODE_BIAS(b->Sat[pos].Biases[j].Bias)
    890922      }
    891923    }
    892924    break;
    893 #ifdef OLD
    894   case OLDCOTYPE_GPSORBIT:
    895     if(!co) return GCOBR_NOCLOCKORBITPARAMETER;
    896     G_GPS_EPOCH_TIME(co->GPSEpochTime, co->NumberOfGPSSat)
    897     co->epochGPS[co->epochSize] = co->GPSEpochTime;   /* Weber, for latency */
    898     if(co->epochSize < 100) {co->epochSize += 1;}     /* Weber, for latency */
    899     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    900     OLD_G_RESERVED6
    901     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    902     if(co->OrbitDataSupplied&1)
    903       return GCOBR_DATAMISMATCH;
    904     co->OrbitDataSupplied |= 1;
    905     for(i = 0; i < co->NumberOfGPSSat; ++i)
    906     {
    907       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    908       G_GPS_IODE(co->Sat[i].IOD)
    909       OLD_G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    910       OLD_G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    911       OLD_G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    912       OLD_G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    913       OLD_G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    914       OLD_G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    915       OLD_G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    916       OLD_G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    917       OLD_G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
    918       G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    919       G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    920     }
    921     break;
    922   case OLDCOTYPE_GPSCLOCK:
    923     if(!co) return GCOBR_NOCLOCKORBITPARAMETER;
    924     G_GPS_EPOCH_TIME(co->GPSEpochTime, co->NumberOfGPSSat)
    925     co->epochGPS[co->epochSize] = co->GPSEpochTime;   /* Weber, for latency */
    926     if(co->epochSize < 100) {co->epochSize += 1;}     /* Weber, for latency */
    927     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    928     OLD_G_RESERVED6
    929     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    930     if(co->ClockDataSupplied&1)
    931       return GCOBR_DATAMISMATCH;
    932     co->ClockDataSupplied |= 1;
    933     for(i = 0; i < co->NumberOfGPSSat; ++i)
    934     {
    935       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    936       G_GPS_IODE(co->Sat[i].IOD)
    937       OLD_G_DELTA_A0(co->Sat[i].Clock.DeltaA0)
    938       OLD_G_DELTA_A1(co->Sat[i].Clock.DeltaA1)
    939       OLD_G_DELTA_A2(co->Sat[i].Clock.DeltaA2)
    940     }
    941     break;
    942   case OLDCOTYPE_GPSCOMBINED:
    943     if(!co) return -5;
    944     G_GPS_EPOCH_TIME(co->GPSEpochTime, co->NumberOfGPSSat)
    945     co->epochGPS[co->epochSize] = co->GPSEpochTime;   /* Weber, for latency */
    946     if(co->epochSize < 100) {co->epochSize += 1;}     /* Weber, for latency */
    947     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    948     OLD_G_RESERVED6
    949     OLD_G_NO_OF_SATELLITES(co->NumberOfGPSSat)
    950     if((co->ClockDataSupplied&1) || (co->OrbitDataSupplied&1))
    951       return GCOBR_DATAMISMATCH;
    952     co->OrbitDataSupplied |= 1;
    953     co->ClockDataSupplied |= 1;
    954     for(i = 0; i < co->NumberOfGPSSat; ++i)
    955     {
    956       G_GPS_SATELLITE_ID(co->Sat[i].ID)
    957       G_GPS_IODE(co->Sat[i].IOD)
    958       OLD_G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    959       OLD_G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    960       OLD_G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    961       OLD_G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    962       OLD_G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    963       OLD_G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    964       OLD_G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    965       OLD_G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    966       OLD_G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
    967       G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    968       G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    969       OLD_G_DELTA_A0(co->Sat[i].Clock.DeltaA0)
    970       OLD_G_DELTA_A1(co->Sat[i].Clock.DeltaA1)
    971       OLD_G_DELTA_A2(co->Sat[i].Clock.DeltaA2)
    972     }
    973     break;
    974   case OLDCOTYPE_GLONASSORBIT:
    975     if(!co) return GCOBR_NOCLOCKORBITPARAMETER;
    976     G_GLONASS_EPOCH_TIME(co->GLONASSEpochTime, co->NumberOfGLONASSSat)
    977     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    978     OLD_G_RESERVED6
    979     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    980     if(co->OrbitDataSupplied&2)
    981       return GCOBR_DATAMISMATCH;
    982     co->OrbitDataSupplied |= 2;
    983     for(i = CLOCKORBIT_NUMGPS;
    984     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    985     {
    986       OLD_G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    987       G_GLONASS_IOD(co->Sat[i].IOD)
    988       OLD_G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    989       OLD_G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    990       OLD_G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    991       OLD_G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    992       OLD_G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    993       OLD_G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    994       OLD_G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    995       OLD_G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    996       OLD_G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
    997       G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    998       G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    999     }
    1000     break;
    1001   case OLDCOTYPE_GLONASSCLOCK:
    1002     if(!co) return GCOBR_NOCLOCKORBITPARAMETER;
    1003     G_GLONASS_EPOCH_TIME(co->GLONASSEpochTime, co->NumberOfGLONASSSat)
    1004     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    1005     OLD_G_RESERVED6
    1006     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    1007     if(co->ClockDataSupplied&2)
    1008       return GCOBR_DATAMISMATCH;
    1009     co->ClockDataSupplied |= 2;
    1010     for(i = CLOCKORBIT_NUMGPS;
    1011     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    1012     {
    1013       OLD_G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    1014       G_GLONASS_IOD(co->Sat[i].IOD)
    1015       OLD_G_DELTA_A0(co->Sat[i].Clock.DeltaA0)
    1016       OLD_G_DELTA_A1(co->Sat[i].Clock.DeltaA1)
    1017       OLD_G_DELTA_A2(co->Sat[i].Clock.DeltaA2)
    1018     }
    1019     break;
    1020   case OLDCOTYPE_GLONASSCOMBINED:
    1021     if(!co) return GCOBR_NOCLOCKORBITPARAMETER;
    1022     G_GLONASS_EPOCH_TIME(co->GLONASSEpochTime, co->NumberOfGLONASSSat)
    1023     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    1024     OLD_G_RESERVED6
    1025     OLD_G_NO_OF_SATELLITES(co->NumberOfGLONASSSat)
    1026     if((co->ClockDataSupplied&2) || (co->OrbitDataSupplied&2))
    1027       return GCOBR_DATAMISMATCH;
    1028     co->OrbitDataSupplied |= 2;
    1029     co->ClockDataSupplied |= 2;
    1030     for(i = CLOCKORBIT_NUMGPS;
    1031     i < CLOCKORBIT_NUMGPS+co->NumberOfGLONASSSat; ++i)
    1032     {
    1033       OLD_G_GLONASS_SATELLITE_ID(co->Sat[i].ID)
    1034       G_GLONASS_IOD(co->Sat[i].IOD)
    1035       OLD_G_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
    1036       OLD_G_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
    1037       OLD_G_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
    1038       OLD_G_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
    1039       OLD_G_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
    1040       OLD_G_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
    1041       OLD_G_DELTA_DOT_DOT_RADIAL(co->Sat[i].Orbit.DotDotDeltaRadial)
    1042       OLD_G_DELTA_DOT_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDotDeltaAlongTrack)
    1043       OLD_G_DELTA_DOT_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDotDeltaCrossTrack)
    1044       G_SATELLITE_REFERENCE_POINT(co->SatRefPoint)
    1045       G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
    1046       OLD_G_DELTA_A0(co->Sat[i].Clock.DeltaA0)
    1047       OLD_G_DELTA_A1(co->Sat[i].Clock.DeltaA1)
    1048       OLD_G_DELTA_A2(co->Sat[i].Clock.DeltaA2)
    1049     }
    1050     break;
    1051   case OLDBTYPE_GPS:
    1052     if(!b) return GCOBR_NOBIASPARAMETER;
    1053     G_GPS_EPOCH_TIME(b->GPSEpochTime, co->NumberOfGPSSat)
    1054     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    1055     OLD_G_RESERVED6
    1056     OLD_G_NO_OF_SATELLITES(b->NumberOfGPSSat)
    1057     for(i = 0; i < b->NumberOfGPSSat; ++i)
    1058     {
    1059       G_GPS_SATELLITE_ID(b->Sat[i].ID)
    1060       G_NO_OF_CODE_BIASES(b->Sat[i].NumberOfCodeBiases)
    1061       for(j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j)
    1062       {
    1063         G_GPS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
    1064         OLD_G_CODE_BIAS(b->Sat[i].Biases[j].Bias)
    1065       }
    1066     }
    1067     break;
    1068   case OLDBTYPE_GLONASS:
    1069     if(!b) return GCOBR_NOBIASPARAMETER;
    1070     G_GPS_EPOCH_TIME(b->GLONASSEpochTime, co->NumberOfGLONASSSat)
    1071     G_MULTIPLE_MESSAGE_INDICATOR(mmi)
    1072     OLD_G_RESERVED6
    1073     OLD_G_NO_OF_SATELLITES(b->NumberOfGLONASSSat)
    1074     for(i = CLOCKORBIT_NUMGPS;
    1075     i < CLOCKORBIT_NUMGPS+b->NumberOfGLONASSSat; ++i)
    1076     {
    1077       OLD_G_GLONASS_SATELLITE_ID(b->Sat[i].ID)
    1078       G_NO_OF_CODE_BIASES(b->Sat[i].NumberOfCodeBiases)
    1079       for(j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j)
    1080       {
    1081         G_GLONASS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
    1082         OLD_G_CODE_BIAS(b->Sat[i].Biases[j].Bias)
    1083       }
    1084     }
    1085     break;
    1086 #endif
    1087925  default:
    1088926    return GCOBR_UNKNOWNTYPE;
  • trunk/BNS/RTCM/clock_orbit_rtcm.h

    r1809 r1841  
    66        Name:           clock_orbit_rtcm.h
    77        Project:        RTCM3
    8         Version:        $Id: clock_orbit_rtcm.h,v 1.4 2009/04/24 08:36:34 stoecker Exp $
     8        Version:        $Id: clock_orbit_rtcm.h,v 1.5 2009/05/12 13:19:03 stoecker Exp $
    99        Authors:        Dirk Stöcker
    1010        Description:    state space approach for RTCM3
     
    1616enum SatelliteReferencePoint { POINT_IONOFREE=0, POINT_CENTER=1 };
    1717enum ClockOrbitType {
    18      COTYPE_GPSORBIT=3001, COTYPE_GPSCLOCK=3002,
    19      COTYPE_GPSCOMBINED=3004, COTYPE_GPSURA=3005, COTYPE_GPSHR=3006,
     18     COTYPE_GPSORBIT=1057, COTYPE_GPSCLOCK=1058,
     19     COTYPE_GPSCOMBINED=1060, COTYPE_GPSURA=1061, COTYPE_GPSHR=1062,
    2020
    21      COTYPE_GLONASSORBIT=3007, COTYPE_GLONASSCLOCK=3008,
    22      COTYPE_GLONASSCOMBINED=3010, COTYPE_GLONASSURA=3011, COTYPE_GLONASSHR=3012,
     21     COTYPE_GLONASSORBIT=1063, COTYPE_GLONASSCLOCK=1064,
     22     COTYPE_GLONASSCOMBINED=1066, COTYPE_GLONASSURA=1067, COTYPE_GLONASSHR=1068,
    2323
    2424     COTYPE_AUTO=0 };
    25 enum BiasType { BTYPE_GPS=3003, BTYPE_GLONASS=3009, BTYPE_AUTO = 0 };
     25enum BiasType { BTYPE_GPS=1059, BTYPE_GLONASS=1065, BTYPE_AUTO = 0 };
    2626
    2727enum COR_CONSTANTS {
Note: See TracChangeset for help on using the changeset viewer.