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

📄 gps_io.h

📁 GPS数据处理源代码
💻 H
字号:
/* GPS_IO.H - header file for GPS_IO.C */

#ifndef GPS_IO_INCLUDE
#define GPS_IO_INCLUDE


#include <stdio.h>

/* file version */
#define B_VERSION 1.01


/* receiver types */
#define B_GENERIC 0        /* generic receiver (ranges,phase,phase rate) */
#define B_MX4200  1        /* magnavox 4200 */
#define B_ASHP12  2        /* ashtech pcode */
#define TRIM_4000 3        /* trimble ca-code */
#define B_NOVATEL 4        /* novatel rx. */
#define B_MOTOROLA 5       /* Motorola receivers */
#define B_RINEX   6         /* rinex format */
#define B_FURUNO  7
#define B_NAVSTAR 8

/* & values for mben.status */
#define B_CYCLESLIP 1

/* structures */

typedef struct                   /* time (same as 'tm' type in time.h) */

{
     short month;                /* 0-11 */
     short day;                  /* 1-31 */
     short year;                 /* year-1900 (eg. 92) */
     short hour;
     short min;
     short sec;

}    time_type;


typedef struct                   /* Header & structure for binary gpb files */
						   /* (202 bytes) */

{
     short size;                 /* structure size in bytes */
     float version;              /* version number (see above) */
     char receiver;              /* receiver type (see above) */
     char max_channels;          /* maximum number of channels (for safety) */
     time_type time;                /* time of file open */
     float interval;             /* data interval in seconds */

     char extra1[64];
                                 /* variables used by software */
     char fname[40];             /* file name */
     FILE *f;                    /* file pointer */
     short vbufsize;             /* size of file buffer (internal) */
     void *vbuf;                 /* pointer to vbuf (allocated in open) */

     char extra2[64];

}    header_bin_type;



typedef struct                   /* position record (68 bytes) */

{
     short size;                 /* size of structure */

     char num_sats;              /* number of satellites to follow */
     char status;                /* bit 0: position valid (1=valid)
                                    bit 1: 0 - static mode 1 - kinematic */
     float ant_ht;               /* antenna height (HT) in metres */

     double phi,lamda;           /* position dec deg */
     float ht;

     double rcv_time;            /* receive time in seconds since sunday */
     double corr_time;           /* corrected receive time */
     double clock_shift;         /* clock_shift in metres */
     double clock_drift;
//     short  week_num;            /* GPS week number */
//     char extra[6];
     char extra[8];

}    pben_bin_type;              /* binary position record */


typedef struct                   /* measurement record (44 bytes) */

{
     short size;                 /* size in bytes */
     char  prn;                  /* prn number */
	unsigned char locktime;     /* seconds since last loss of lock
                                    (255 max) 0=no loss of lock */

     double ca_range;            /* ca pseudo range in metres */
     double phase_l1;            /* phase in cycles (on ca channel) */
     double phase_rate_l1;       /* phase_rate in cycles */

     double p1_range;            /* pcode on l1 (m) */
     double p2_range;            /* pcode on l2 (m) */

}    mben_bin_type;

typedef struct                   /* measurement record (19 bytes) */

{
	char  size;                 /* size in bytes */
	char  prn;                  /* prn number */
	unsigned char locktime;     /* seconds since last loss of lock
							 (255 max) 0=no loss of lock */

	unsigned long ca_range;            /* ca pseudo range in metres */
	double phase_l1;            /* phase in cycles (on ca channel) */
	float phase_rate_l1;       /* phase_rate in cycles */

}    compact_mben_bin_type;



/* prototypes */
header_bin_type *create_bin_file( char *fname, int receiver, float interval,
                                  unsigned vbufsize, int max_channels );
header_bin_type *open_bin_file( char *fname, unsigned vbufsize );
int reopen_bin_file( header_bin_type *h );
int write_bin_epoch( header_bin_type *h, pben_bin_type *b_pben,
                     mben_bin_type *b_mben );
int read_bin_epoch( header_bin_type *h, pben_bin_type *b_pben,
                    mben_bin_type *b_mben );
void close_bin_file( header_bin_type *h );
int search_for_prn( header_bin_type *h, int prn, double until_time );

#endif

⌨️ 快捷键说明

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