⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 structs.h

📁 GPS导航定位程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/****************************************************************************
* This include file contains definitions of the main structures used in the
* GPS Builder-2 software.
****************************************************************************/

/*
 * Channel accumulation data.
 */

typedef struct
{
    int IP;                                             /* I (prompt arm). */
    int QP;                                             /* Q (prompt arm). */
    int ID;                                           /* I (dithered arm). */
    int QD;                                           /* Q (dithered arm). */
    long IDataBit;                                 /* I (prompt+dithered). */
    long I_Prompt;                                             /* IP + ID. */
    long Q_Prompt;                                             /* QP + QD. */ 
    unsigned long I2_Plus_Q2;                  /* I_Prompt^2 + Q_Prompt^2. */ 
    unsigned _1ms_epoch;                 /* Instantaneous 1ms epoch count. */
    unsigned _20ms_epoch;               /* Instantaneous 20ms epoch count. */
 } accumstruc;

/*
 * Almanac data.
 */

typedef struct
{
    logical vflg;         /* 0=No Info, 1=Valid Almanac, 2=Nonexistent SV. */
    int almhlth;                                   /* Almanac health code. */
    int refweek;                              /* Reference time, GPS week. */
    float toa;                      /* Reference time, seconds of refweek. */
    float ecc;                                    /* Orbital eccentricity. */
    float inclin;                        /* Orbital inclination (radians). */
    float rora;                  /* Rate of right ascension (radians/sec). */
    float sqrta;                /* SQRT(orbital semimajor axis in meters). */
    float ratoa;                 /* Right ascension at ref time (radians). */
    float argpg;             /* Argument of perigee at ref time (radians). */
    float manom;                    /* Mean anomaly at ref time (radians). */
    float  af0;                 /* Clock correction at ref time (seconds). */
    float  af1;                 /* Clock correction rate (seconds/second). */
} almstruc;

/*
 * Channel control block.  One for each allocated satellite tracking channel. 
 */

typedef struct
{
    int channel;                                        /* Channel number. */
    unsigned SV;               /* Current allocated SV, 0=channel is idle. */
    unsigned _SATCNTL;                                /* Register address. */
    unsigned _CARRIER_DCO_INCR_HIGH;                  /* Register address. */
    unsigned _CARRIER_DCO_INCR_LOW;                   /* Register address. */
    unsigned _CODE_DCO_INCR_HIGH;                     /* Register address. */
    unsigned _CODE_DCO_INCR_LOW;                      /* Register address. */
    unsigned _EPOCH_LOAD;                             /* Register address. */
    unsigned _EPOCH_CHECK;                            /* Register address. */
    unsigned _EPOCH_COUNT;                            /* Register address. */
    unsigned _CODE_PHASE;                             /* Register address. */
    unsigned _CODE_DCO_PHASE;                         /* Register address. */
    unsigned _I_PROMPT;                               /* Register address. */
    unsigned _Q_PROMPT;                               /* Register address. */
    unsigned _I_TRACK;                                /* Register address. */
    unsigned _Q_TRACK;                                /* Register address. */
    unsigned _CARRIER_CYCLE_COUNTER_HIGH;             /* Register address. */
    unsigned _CARRIER_CYCLE_COUNTER_LOW;              /* Register address. */
    unsigned _CARRIER_DCO_PHASE;                      /* Register address. */
    unsigned _ACCUM_RESET;                            /* Register address. */
    unsigned long CARRDCO;         /* Hardware carrier DCO increment * 16. */
    unsigned long CODEDCO;            /* Hardware code DCO increment * 32. */
    unsigned long pCARRDCO;        /* Hardware carrier DCO increment * 16. */
    unsigned long pCODEDCO;           /* Hardware code DCO increment * 32. */
    int CurrDoppBinIndex;      /* Index of Doppler bin now being searched. */
    long CodeDoppBin;              /* Code DCO adjustment per Doppler bin. */
    long CarrDoppBin;           /* Carrier DCO adjustment per Doppler bin. */
    long TotalCodeMovement;   /* Code srchd in curr Dopp bin, 1/512 chips. */
    unsigned iNXTACCUM;     /* Index of next available accumulation entry. */
    unsigned iCURACCUM;     /* Index of last accumulation entry processed. */
    unsigned AccumPending;  /* How many accums. are pending in the buffer. */
    accumstruc ACCUM[NACCUM];           /* Accumulation data from channel. */
    unsigned _1MS_EPOCH_SLEW;              /* Error in 1-ms epoch counter. */
    unsigned _20MS_EPOCH_SLEW;            /* Error in 20-ms epoch counter. */
    long EML;                        /* Current Early - Late accumulation. */
    unsigned NEML;              /* # samples contained in EML accumulator. */
    long EMLOLD;          /* Early - Late accum. at previous filter cycle. */
    long IM1;                                  /* I, previous millisecond. */
    long QM1;                                  /* Q, previous millisecond. */
    long wdot_c;                   /* Carrier frequency dot, carrier loop. */
    long phase_error;                      /* Carrier phase, carrier loop. */
    long avg_phase_change;                 /* Carrier phase change per ms. */    
    long CdLI;                      /* Code lock indicator, Av(I**2+Q**2). */
    long CrfrLI;                      /* Carrier frequency lock indicator. */
    unsigned coasting;        /* Remaining # ms to coast before unlocking. */
    logical corlk;                /* 1=Correlation lock has been achieved. */
    logical carfrlk;        /* 1=Carrier frequency lock has been achieved. */
    logical bitlk;                        /* 1=Bit sync has been achieved. */
    int BitNumber;                          /* Bit number within subframe. */
    logical FrameSync;                   /* 1=Frame sync has been achieved */
    logical FrameSyncAndTIC;           /* 1=TIC occurred since frame sync. */
    logical LostLockDuringLastTIC;        /* 1=lost code or carrier lock . */
    logical LostCodeLockDuringLastTIC;                /* 1=lost code lock. */
    logical LostCarrierLockDuringLastTIC;          /* 1=lost carrier lock. */
    long IPSUM20;               /* Sum of I over current & 19 previous ms. */
    long DBINTEG[20];           /* ABS(20-ms I integrals), 1-ms 20 epochs. */
    int nDBINTEG;            /* Number of samples in DBINTEG, up to a max. */
    int BESTEPOCH;                          /* Index of biggest DBINTEG[]. */
    unsigned long BESTSUM;                  /* Value of biggest DBINTEG[]. */
    unsigned BadDataCntr;    /* # data decode errors since last good data. */
    unsigned long wordbuff[FRAME_SIZE_PLUS_2]; /* Buffer for 12 GPS words. */
    unsigned long codeph;  /* Code phase, this TIC, units 1/512 of a chip. */
    unsigned long old_codeph; /* Code phase, prev TIC, "    "    " "   ".  */
    unsigned carrdcophase;  /* Carr phase, this TIC, units PI/512 radians. */
    unsigned prevcarrdcophase; /* Carr phase, prev TIC, "    "       "   . */
} chanstruc;

/*
 * Checkpoint structure.
 */

#define NCKPT 16                                 /* # of remembered ckpts. */

typedef struct
{
    unsigned UserCheckpoint;                 /* User checkpoint #, 0=none. */
    char ProcName[16];                   /* Proc name @ ckpt, 15 char max. */
    int TaskNum;                                    /* CurrentTask @ ckpt. */
} CKPTstruc;

/*
 * Receiver clock model structure.
 */

typedef struct
{
    /* Note BOT = beginning of time = continuous GPS atomic time since
       midnight Jan 5/Jan 6, 1980, Universal Coordinated Time (UTC).
       Zwk, Zsec are estimated once from the user's computer time when the
       software starts and are never changed.  Receiver time at TIC=n is
       computed by adding n*0.0999999 seconds to this starting point. */

    int Zwk;                  /* Estimated time at TIC=0, weeks since BOT. */
    double Zsec;            /* Estimated time at TIC=0, seconds since BOT. */
    double VARClkError;             /* Last est. of clk err variance, ppm. */
    int DoppFromClk;                 /* L1 doppler shift due to clock, Hz. */

    /* RCOwk, RCOsec is the estimated rcvr clock offset (RCO) from GPS time
       (defined as Receiver time - Receiver clock offset = GPS time).
       RCOtic is the TIC for which the RCO is applicable.  For a nearby
       TIC, GPS time = Receiver time - RCO - (TIC-RCOtic)*0.0999999*RCOrate */

    int RCOwk;                            /* Receiver clock offset, weeks. */
    double RCOsec;                      /* Receiver clock offset, seconds. */
    unsigned long RCOtic;     /* RCO time of applicability (0=none), TICs. */
    double RCOrate;                     /* RCO change, seconds per second. */
} clockmodelstruc;

/*
 * Differential corrections.
 */

typedef struct 
{ 
    unsigned vflg;                           /* 1=correction valid, 0=not. */
    unsigned mzcount;                                 /* Modified Z-count. */
    int dontuse;           /* =1: Don't use the SV or this correction set. */
    float prc;                                  /* Pseudorange correction. */
    float rrc;                             /* Pseudorange rate correction. */
    int iod;                                   /* Issue of ephemeris data. */
    float DiffPropCorr;            /* Differential propagation correction. */
} diffcorstruc;

/*
 * Delta differential corrections.
 */

typedef struct
{ 
    unsigned vflg;                           /* 1=correction valid, 0=not. */
    unsigned mzcount;                                 /* Modified Z-count. */
    int dontuse;           /* =1: Don't use the SV or this correction set. */
    float dprc;                           /* Delta pseudorange correction. */
    float drrc;                      /* Delta pseudorange rate correction. */
    int iod;                                   /* Issue of ephemeris data. */
} ddiffcorstruc;

/*
 * DGPS beacon structure (RTCM-104 differential corrections).
 */
 
typedef struct
{
    diffcorstruc DC[MAXSATELLITES];                      /* Defined above. */
    ddiffcorstruc DDC[MAXSATELLITES];                    /* Defined above. */
    int hlth;                              /* RTCM-104 beacon health code. */
    int sig;                         /* 0=No beacon signal for 30 seconds. */
    int data;                          /* 0=No beacon data for 30 seconds. */
    int sync;                      /* 1=RTCM frame sync has been achieved. */
    int typ;                      /* Type of last RTCM-104 frame received. */
    int frm;              /* Seq num of last RTCM-104 frame (modulo 1000). */
    int id;                                 /* RTCM-104 beacon station ID. */
    char msg[91];                        /* RTCM-104 Type 16 message text. */
    int pos;                         /* 1=Beacon position is known, 0=not. */
    double lat;                       /* Beacon WGS-84 latitude, if known. */
    double lon;                      /* Beacon WGS-84 longitude, if known. */
    double hgt;               /* Beacon WGS-84 ellipsoid height, if known. */
    int RptBrate;          /* MSK bit rate as reported by beacon receiver. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -