Changeset 2756 in ntrip for trunk/rtcm3torinex


Ignore:
Timestamp:
Dec 1, 2010, 3:26:47 PM (10 years ago)
Author:
stoecker
Message:

first test of Galileo ephemeris type 1045

Location:
trunk/rtcm3torinex/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/rtcm3torinex/lib/rtcm3torinex.c

    r2699 r2756  
    140140  LOADBITS(a) \
    141141  b = (bitfield<<(64-numbits))>>(64-(a)); \
     142  numbits -= (a); \
     143}
     144
     145/* extract bits from data stream
     146   b = variable to store result, a = number of bits */
     147#define GETBITSFACTOR(b, a, c) \
     148{ \
     149  LOADBITS(a) \
     150  b = ((bitfield<<(sizeof(bitfield)*8-numbits))>>(sizeof(bitfield)*8-(a)))*(c); \
    142151  numbits -= (a); \
    143152}
     
    397406
    398407        ret = 1019;
     408      }
     409      break;
     410    case 1045:
     411      {
     412        struct galileoephemeris *ge;
     413        int sv;
     414
     415        ge = &handle->ephemerisGALILEO;
     416        memset(ge, 0, sizeof(*ge));
     417
     418        GETBITS(sv, 6)
     419        ge->satellite = sv;
     420        GETBITS(ge->Week, 12)
     421        GETBITS(ge->IODnav, 10)
     422        GETBITS(ge->SISA, 8)
     423        GETFLOATSIGN(ge->IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     424        GETBITSFACTOR(ge->TOC, 14, 60)
     425        GETFLOATSIGN(ge->clock_driftrate, 6, 1.0/(double)(1<<30)/(double)(1<<29))
     426        GETFLOATSIGN(ge->clock_drift, 21, 1.0/(double)(1<<30)/(double)(1<<16))
     427        GETFLOATSIGN(ge->clock_bias, 31, 1.0/(double)(1<<30)/(double)(1<<4))
     428        GETFLOATSIGN(ge->Crs, 16, 1.0/(double)(1<<5))
     429        GETFLOATSIGN(ge->Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
     430        GETFLOATSIGN(ge->M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     431        GETFLOATSIGN(ge->Cuc, 16, 1.0/(double)(1<<29))
     432        GETFLOAT(ge->e, 32, 1.0/(double)(1<<30)/(double)(1<<3))
     433        GETFLOATSIGN(ge->Cus, 16, 1.0/(double)(1<<29))
     434        GETFLOAT(ge->sqrt_A, 32, 1.0/(double)(1<<19))
     435        GETBITSFACTOR(ge->TOE, 14, 60)
     436        GETFLOATSIGN(ge->Cic, 16, 1.0/(double)(1<<29))
     437        GETFLOATSIGN(ge->OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     438        GETFLOATSIGN(ge->Cis, 16, 1.0/(double)(1<<29))
     439        GETFLOATSIGN(ge->i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     440        GETFLOATSIGN(ge->Crc, 16, 1.0/(double)(1<<5))
     441        GETFLOATSIGN(ge->omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     442        GETFLOATSIGN(ge->OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
     443        GETFLOATSIGN(ge->BGD_1_5A, 10, 1.0/(double)(1<<30)/(double)(1<<2))
     444        GETBITS(ge->E5aHS, 2)
     445        GETBITS(sv, 1)
     446        if(sv)
     447          ge->flags |= GALEPHF_E5ADINVALID;
     448        ret = 1045;
    399449      }
    400450      break;
  • trunk/rtcm3torinex/lib/rtcm3torinex.h

    r2699 r2756  
    256256};
    257257
     258#define GALEPHF_E5ADINVALID     (1<<0) /* E5aDVS set invalid */
     259
    258260#define GLOEPHF_UNHEALTHY       (1<<0) /* set if unhealty satellite, f2b78 */
    259261#define GLOEPHF_ALMANACHEALTHOK (1<<1) /* set if ALM health is available */
     
    287289};
    288290
     291struct galileoephemeris {
     292  int    flags;            /* GALEPHF_xxx */
     293  int    satellite;        /* SV ID */
     294  int    IODnav;
     295  int    TOC;              /* [s] */
     296  int    TOE;              /* [s] */
     297  double clock_bias;       /* [s] */
     298  double clock_drift;      /* [s/s] */
     299  double clock_driftrate;  /* [s/s^2] */
     300  double Crs;              /* [m] */
     301  double Delta_n;          /* [rad/s] */
     302  double M0;               /* [rad] */
     303  double Cuc;              /* [rad] */
     304  double e;
     305  double Cus;              /* [rad] */
     306  double sqrt_A;           /* [m^0.5] */
     307  double Cic;              /* [rad] */
     308  double OMEGA0;           /* [rad] */
     309  double Cis;              /* [rad] */
     310  double i0;               /* [rad] */
     311  double Crc;              /* [m] */
     312  double omega;            /* [rad] */
     313  double OMEGADOT;         /* [rad/s] */
     314  double IDOT;             /* [rad/s] */
     315  double BGD_1_5A;         /* [s] */
     316  int    Week;
     317  int    SISA;
     318  int    E5aHS;
     319};
     320
    289321struct RTCM3ParserData {
    290322  unsigned char Message[2048]; /* input-buffer */
     
    296328  struct gnssdata Data;
    297329  struct gpsephemeris ephemerisGPS;
     330  struct galileoephemeris ephemerisGALILEO;
    298331  struct glonassephemeris ephemerisGLONASS;
    299332  struct gnssdata DataNew;
Note: See TracChangeset for help on using the changeset viewer.