Changeset 1092 in ntrip for trunk


Ignore:
Timestamp:
Sep 2, 2008, 9:45:48 AM (16 years ago)
Author:
stoecker
Message:

added BNC adaptions

Location:
trunk/rtcm3torinex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/rtcm3torinex/rtcm3torinex.c

    r1091 r1092  
    11/*
    22  Converter for RTCM3 data to RINEX.
    3   $Id: rtcm3torinex.c,v 1.30 2008/09/01 07:47:15 stoecker Exp $
     3  $Id: rtcm3torinex.c,v 1.15 2008/08/15 17:00:03 weber Exp $
    44  Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
    55
     
    5151
    5252/* CVS revision and version */
    53 static char revisionstr[] = "$Revision: 1.30 $";
     53static char revisionstr[] = "$Revision: 1.15 $";
    5454
    5555#ifndef COMPILEDATE
     
    237237}
    238238
    239 static void updatetime(int *week, int *tow, int tk, int fixnumleap)
     239void updatetime(int *week, int *tow, int tk, int fixnumleap)
    240240{
    241241  int y,m,d,k,l, nul;
     
    283283
    284284    GETBITS(type,12)
     285#ifndef NO_RTCM3_MAIN
     286    handle->typeList[handle->typeSize] = type;           /* RTCM message types */
     287    if(handle->typeSize < 100) {handle->typeSize += 1;}  /* RTCM message types */
     288#endif /* NO_RTCM3_MAIN */
    285289    switch(type)
    286290    {
     
    303307        if(sv & 2)
    304308          ge->flags |= GPSEPHF_L2CACODE;
    305         GETFLOATSIGN(ge->IDOT, 14, PI/(double)(1<<30)/(double)(1<<13))
     309        GETFLOATSIGN(ge->IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
    306310        GETBITS(ge->IODE, 8)
    307311        GETBITS(ge->TOC, 16)
     
    312316        GETBITS(ge->IODC, 10)
    313317        GETFLOATSIGN(ge->Crs, 16, 1.0/(double)(1<<5))
    314         GETFLOATSIGN(ge->Delta_n, 16, PI/(double)(1<<30)/(double)(1<<13))
    315         GETFLOATSIGN(ge->M0, 32, PI/(double)(1<<30)/(double)(1<<1))
     318        GETFLOATSIGN(ge->Delta_n, 16, R2R_PI/(double)(1<<30)/(double)(1<<13))
     319        GETFLOATSIGN(ge->M0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    316320        GETFLOATSIGN(ge->Cuc, 16, 1.0/(double)(1<<29))
    317321        GETFLOAT(ge->e, 32, 1.0/(double)(1<<30)/(double)(1<<3))
     
    322326
    323327        GETFLOATSIGN(ge->Cic, 16, 1.0/(double)(1<<29))
    324         GETFLOATSIGN(ge->OMEGA0, 32, PI/(double)(1<<30)/(double)(1<<1))
     328        GETFLOATSIGN(ge->OMEGA0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    325329        GETFLOATSIGN(ge->Cis, 16, 1.0/(double)(1<<29))
    326         GETFLOATSIGN(ge->i0, 32, PI/(double)(1<<30)/(double)(1<<1))
     330        GETFLOATSIGN(ge->i0, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
    327331        GETFLOATSIGN(ge->Crc, 16, 1.0/(double)(1<<5))
    328         GETFLOATSIGN(ge->omega, 32, PI/(double)(1<<30)/(double)(1<<1))
    329         GETFLOATSIGN(ge->OMEGADOT, 24, PI/(double)(1<<30)/(double)(1<<13))
     332        GETFLOATSIGN(ge->omega, 32, R2R_PI/(double)(1<<30)/(double)(1<<1))
     333        GETFLOATSIGN(ge->OMEGADOT, 24, R2R_PI/(double)(1<<30)/(double)(1<<13))
    330334        GETFLOATSIGN(ge->TGD, 8, 1.0/(double)(1<<30)/(double)(1<<1))
    331335        GETBITS(ge->SVhealth, 6)
     
    772776};
    773777
    774 static void converttime(struct converttimeinfo *c, int week, int tow)
     778void converttime(struct converttimeinfo *c, int week, int tow)
    775779{
    776780  int i, k, doy, j; /* temporary variables */
     
    842846}
    843847
     848#ifdef NO_RTCM3_MAIN
     849#define NUMSTARTSKIP 1
     850#else
    844851#define NUMSTARTSKIP 3
     852#endif
     853
    845854void HandleHeader(struct RTCM3ParserData *Parser)
    846855{
     856#ifdef NO_RTCM3_MAIN
     857  int i;
     858  if(Parser->rinex3)
     859  {
     860#define CHECKFLAGSNEW(a, b, c) \
     861    { \
     862      Parser->dataflag##a[Parser->numdatatypes##a] = GNSSDF_##b##DATA; \
     863      Parser->datapos##a[Parser->numdatatypes##a] = GNSSENTRY_##b##DATA; \
     864      ++Parser->numdatatypes##a; \
     865    }
     866
     867    CHECKFLAGSNEW(GPS, C1,  C1C)
     868    CHECKFLAGSNEW(GPS, L1C, L1C)
     869    CHECKFLAGSNEW(GPS, D1C, D1C)
     870    CHECKFLAGSNEW(GPS, S1C, S1C)
     871    CHECKFLAGSNEW(GPS, P1,  C1P)
     872    CHECKFLAGSNEW(GPS, L1P, L1P)
     873    CHECKFLAGSNEW(GPS, D1P, D1P)
     874    CHECKFLAGSNEW(GPS, S1P, S1P)
     875    CHECKFLAGSNEW(GPS, P2,  C2P)
     876    CHECKFLAGSNEW(GPS, L2P, L2P)
     877    CHECKFLAGSNEW(GPS, D2P, D2P)
     878    CHECKFLAGSNEW(GPS, S2P, S2P)
     879    CHECKFLAGSNEW(GPS, C2,  C2X)
     880    CHECKFLAGSNEW(GPS, L2C, L2X)
     881    CHECKFLAGSNEW(GPS, D2C, D2X)
     882    CHECKFLAGSNEW(GPS, S2C, S2X)
     883    CHECKFLAGSNEW(GLO, C1,  C1C)
     884    CHECKFLAGSNEW(GLO, L1C, L1C)
     885    CHECKFLAGSNEW(GLO, D1C, D1C)
     886    CHECKFLAGSNEW(GLO, S1C, S1C)
     887    CHECKFLAGSNEW(GLO, P1,  C1P)
     888    CHECKFLAGSNEW(GLO, L1P, L1P)
     889    CHECKFLAGSNEW(GLO, D1P, D1P)
     890    CHECKFLAGSNEW(GLO, S1P, S1P)
     891    CHECKFLAGSNEW(GLO, P2,  C2P)
     892    CHECKFLAGSNEW(GLO, L2P, L2P)
     893    CHECKFLAGSNEW(GLO, D2P, D2P)
     894    CHECKFLAGSNEW(GLO, S2P, S2P)
     895    CHECKFLAGSNEW(GLO, C2,  C2C)
     896    CHECKFLAGSNEW(GLO, L2C, L2C)
     897    CHECKFLAGSNEW(GLO, D2C, D2C)
     898    CHECKFLAGSNEW(GLO, S2C, S2C)
     899  }
     900  else
     901  {
     902#define CHECKFLAGS(a, b) \
     903    { \
     904      if(data[RINEXENTRY_##b##DATA]) \
     905      { \
     906        Parser->dataflagGPS[data[RINEXENTRY_##b##DATA]-1] = GNSSDF_##a##DATA; \
     907        Parser->dataposGPS[data[RINEXENTRY_##b##DATA]-1] = GNSSENTRY_##a##DATA; \
     908      } \
     909      else \
     910      { \
     911        Parser->dataflag[Parser->numdatatypesGPS] = GNSSDF_##a##DATA; \
     912        Parser->datapos[Parser->numdatatypesGPS] = GNSSENTRY_##a##DATA; \
     913        data[RINEXENTRY_##b##DATA] = ++Parser->numdatatypesGPS; \
     914      } \
     915    }
     916
     917    int data[RINEXENTRY_NUMBER];
     918    for(i = 0; i < RINEXENTRY_NUMBER; ++i) data[i] = 0;
     919
     920    CHECKFLAGS(C1,C1)
     921    CHECKFLAGS(C2,C2)
     922    CHECKFLAGS(P1,P1)
     923    CHECKFLAGS(P2,P2)
     924    CHECKFLAGS(L1C,L1)
     925    CHECKFLAGS(L1P,L1)
     926    CHECKFLAGS(L2C,L2)
     927    CHECKFLAGS(L2P,L2)
     928    CHECKFLAGS(D1C,D1)
     929    CHECKFLAGS(D1P,D1)
     930    CHECKFLAGS(D2C,D2)
     931    CHECKFLAGS(D2P,D2)
     932    CHECKFLAGS(S1C,S1)
     933    CHECKFLAGS(S1P,S1)
     934    CHECKFLAGS(S2C,S2)
     935    CHECKFLAGS(S2P,S2)
     936  }
     937#else /* NO_RTCM3_MAIN */
    847938  struct HeaderData hdata;
    848939  char thebuffer[MAXHEADERBUFFERSIZE];
     
    11351226  }
    11361227
    1137 #ifndef NO_RTCM3_MAIN
    11381228  for(i = 0; i < hdata.numheaders; ++i)
    11391229  {
     
    15321622
    15331623#ifndef NO_RTCM3_MAIN
    1534 static char datestr[]     = "$Date: 2008/09/01 07:47:15 $";
     1624static char datestr[]     = "$Date: 2008/08/15 17:00:03 $";
    15351625
    15361626/* The string, which is send as agent in HTTP request */
  • trunk/rtcm3torinex/rtcm3torinex.h

    r502 r1092  
    44/*
    55  Converter for RTCM3 data to RINEX.
    6   $Id: rtcm3torinex.h,v 1.6 2007/01/15 13:01:40 stoecker Exp $
    7   Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@alberding.eu>
     6  $Id: rtcm3torinex.h,v 1.11 2008/08/09 23:58:23 weber Exp $
     7  Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu>
    88
    99  This program is free software; you can redistribute it and/or modify
     
    115115#define GPSEPHF_VALIDATED      (1<<3) /* data is completely valid */
    116116
    117 #define PI          3.1415926535898
     117#define R2R_PI          3.1415926535898
    118118
    119119struct gpsephemeris {
     
    194194  int    lastlockl1[64];
    195195  int    lastlockl2[64];
     196#ifndef NO_RTCM3_MAIN
     197  int    typeSize;       /* RTCM message types */
     198  int    typeList[101];  /* RTCM message types */
     199#endif /* NO_RTCM3_MAIN */
    196200  int    datapos[RINEXENTRY_NUMBER];
    197201  int    dataflag[RINEXENTRY_NUMBER];
Note: See TracChangeset for help on using the changeset viewer.