1 | /***************************************************************************
|
---|
2 | rtstruct.h - description
|
---|
3 | -------------------
|
---|
4 | begin : Tue Mar 7 2000
|
---|
5 | copyright : (C) 2000 by Ken MacLeod
|
---|
6 | email : macleod@geod.nrcan.gc.ca
|
---|
7 | ***************************************************************************/
|
---|
8 |
|
---|
9 | /***************************************************************************
|
---|
10 | * *
|
---|
11 | * This program is free software; you can redistribute it and/or modify *
|
---|
12 | * it under the terms of the GNU General Public License as published by *
|
---|
13 | * the Free Software Foundation; either version 2 of the License, or *
|
---|
14 | * (at your option) any later version. *
|
---|
15 | * *
|
---|
16 | ***************************************************************************/
|
---|
17 | /*-------------------------------------------------------------------------*/
|
---|
18 | /* Name : rtstruct.h */
|
---|
19 |
|
---|
20 | /* Purpose : structure definitions for the wide area prototype */
|
---|
21 |
|
---|
22 | /* RCS: $Header: rtstruct.h,v 3.10 99/08/18 15:06:33 macleod Released $ */
|
---|
23 |
|
---|
24 | /* Externals : */
|
---|
25 | /*-------------------------------------------------------------------------*/
|
---|
26 | #ifndef _RTSTRUCT
|
---|
27 | #define _RTSTRUCT
|
---|
28 |
|
---|
29 | /**************************************************************************/
|
---|
30 | /*** ***/
|
---|
31 | /*** RTAP Function Prototypes: ***/
|
---|
32 | /*** ***/
|
---|
33 | /*** 1) typedef defines the RTAP types for non-RTAP ***/
|
---|
34 | /*** compiles ***/
|
---|
35 | /*** ***/
|
---|
36 | /*** 2) To compile within RTAP use -D_RTAP compile option ***/
|
---|
37 | /*** ***/
|
---|
38 | /*** Note: Most function prototypes are commented out until the ***/
|
---|
39 | /*** corresponding functions are changed accordingly ***/
|
---|
40 | /*** ***/
|
---|
41 | /**************************************************************************/
|
---|
42 |
|
---|
43 | #ifdef _RTAP
|
---|
44 |
|
---|
45 | #include <rtap/types.h>
|
---|
46 | #include <rtap/database.h>
|
---|
47 |
|
---|
48 | #else
|
---|
49 |
|
---|
50 | typedef double rtDouble;
|
---|
51 | typedef float rtFloat;
|
---|
52 | typedef char rtChar;
|
---|
53 | typedef unsigned char rtUInt8;
|
---|
54 | typedef unsigned short rtUInt16;
|
---|
55 | typedef unsigned int rtUInt32;
|
---|
56 | typedef int rtInt32;
|
---|
57 | typedef short rtInt16;
|
---|
58 | typedef char rtInt8;
|
---|
59 | typedef int rtInt;
|
---|
60 | typedef struct timeval rtTime;
|
---|
61 |
|
---|
62 | typedef rtUInt32 rtDbQuality;
|
---|
63 | typedef rtUInt8 rtLogical;
|
---|
64 | typedef rtUInt8 rtBytes4[4];
|
---|
65 | typedef rtUInt8 rtBytes8[8];
|
---|
66 | typedef rtUInt8 rtBytes12[12];
|
---|
67 | typedef rtUInt8 rtBytes16[16];
|
---|
68 | typedef rtUInt8 rtBytes20[20];
|
---|
69 | typedef rtUInt8 rtBytes32[32];
|
---|
70 | typedef rtUInt8 rtBytes48[48];
|
---|
71 | typedef rtUInt8 rtBytes64[64];
|
---|
72 | typedef rtUInt8 rtBytes80[80];
|
---|
73 | typedef rtUInt8 rtBytes128[128];
|
---|
74 | typedef rtUInt8 rtBytes256[256];
|
---|
75 |
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | /* Now define our constants */
|
---|
79 | /* Our CONS_T structure member names are now lower case to prevent conflict */
|
---|
80 |
|
---|
81 | #define MAX_STA (24) /* maximum stations */
|
---|
82 | #define PI (3.141592653589793) /* value of PI */
|
---|
83 | #define DTR (0.017453292519943) /* deg to rad conversion con. */
|
---|
84 | #define C (299792458.00) /* speed of light in vaccuum */
|
---|
85 | #define F1 (1575.42E+06) /* GPS L1 frequency */
|
---|
86 | #define F1_SQUARE (F1 * F1) /* GPS L1 frequency squared */
|
---|
87 | #define L1 (C / F1) /* GPS L1 wavelength */
|
---|
88 | #define F2 (1227.60E+06) /* GPS L2 frequency */
|
---|
89 | #define F2_SQUARE (F2 * F2) /* GPS L2 frequency squared */
|
---|
90 | #define L2 (C / F2) /* GPS L2 wavelength */
|
---|
91 | #define F3 (F1 - F2) /* GPS widelane frequency */
|
---|
92 | #define L3 (C / F3) /* GPS widelane wavelength */
|
---|
93 | #define F1ION (F2_SQUARE / (F1_SQUARE - F2_SQUARE)) /* L1 iono scale factor */
|
---|
94 | #define F2ION (F1_SQUARE / (F1_SQUARE - F2_SQUARE)) /* L2 iono scale factor */
|
---|
95 | #define IonoH (350000.0) /* Ionospheric height in metres */
|
---|
96 |
|
---|
97 | /*******************************
|
---|
98 | * Content: Broadcast Orbit
|
---|
99 | * Representation
|
---|
100 | ********************************/
|
---|
101 | typedef struct broadcast{
|
---|
102 | double satellite; /* satellite number */
|
---|
103 | double gps_week; /* gps week number from 81/01/06*/
|
---|
104 | double user_range_acc; /* user range accuracy in meters */
|
---|
105 | double sat_health; /* satellite health (all bits) */
|
---|
106 | double fit_interval; /* ephemeris fit interval */
|
---|
107 | double l2code; /* Codes on L2 indicator */
|
---|
108 | double l2pflag; /* Data flag for L2 P code */
|
---|
109 | double issue_of_clock; /* issue of clock */
|
---|
110 | double issue_of_eph; /* issue of ephemeris */
|
---|
111 | double transmit_time; /* time of transmission */
|
---|
112 | double clock_ref_time; /* reference time of the clock */
|
---|
113 | double eph_ref_time; /* reference time of the ephem */
|
---|
114 | double a0; /* satellite clock coefficient */
|
---|
115 | double a1; /* satellite clock coefficient */
|
---|
116 | double a2; /* satellite clock coefficient */
|
---|
117 | double ref_mean_anmly; /* mean anomoly at reference time */
|
---|
118 | double mean_mot_diff; /* mean motion difference */
|
---|
119 | double orbit_ecc; /* orbit eccentricity */
|
---|
120 | double orbit_semimaj; /* square root of orbit semimajor axis */
|
---|
121 | double arg_of_perigee; /* argument of perigee */
|
---|
122 | double orbit_incl; /* orbit inclination */
|
---|
123 | double incl_rate; /* orbit inclination rate */
|
---|
124 | double right_asc; /* right ascension */
|
---|
125 | double right_asc_rate; /* rate of right ascension */
|
---|
126 | double lat_cos_corr; /* ampl of cos harm corr to arg of lat */
|
---|
127 | double lat_sin_corr; /* ampl of sin harm corr to arg of lat */
|
---|
128 | double orbit_cos_corr; /* ampl of cos harm corr to orbit */
|
---|
129 | double orbit_sin_corr; /* ampl of sin harm corr to orbit */
|
---|
130 | double incl_cos_corr; /* ampl of cos harm corr to the incl */
|
---|
131 | double incl_sin_corr; /* ampl of sin harm corr to the incl */
|
---|
132 | double group_delay; /* estimated group delay differential */
|
---|
133 | }BEPH_T;
|
---|
134 |
|
---|
135 |
|
---|
136 |
|
---|
137 | /******************************
|
---|
138 | * Content:Receiver independent
|
---|
139 | * GPS observation data structure
|
---|
140 | * contains all possible obs
|
---|
141 | *******************************/
|
---|
142 | typedef struct complete_measurement{
|
---|
143 | unsigned long GPSTime; /* broadcast time sec.*/
|
---|
144 | unsigned char chn; /* Channel*/
|
---|
145 | unsigned char sat_prn; /* satellite ID*/
|
---|
146 | unsigned short ntrvl; /* number of seconds */
|
---|
147 | unsigned char flag[4]; /*observation quality flags*/
|
---|
148 | float l1_sn; /* signal-to-noise CA frequency 1 */
|
---|
149 |
|
---|
150 | double l1_pseudo_range; /* frequency-1 CA pseudorange */
|
---|
151 | double l1_phase; /* frequency-1 CA carrier phase */
|
---|
152 | /*KML for this struct SNR will be DBHz */
|
---|
153 | double p1_pseudo_range; /* frequency-1 P1 pseudorange */
|
---|
154 | double p1_phase; /* frequency-1 P1 carrier phase */
|
---|
155 | float p1_sn; /* signal-to-noise P1 frequency 1 */
|
---|
156 | float l2_sn; /* signal-to-noise frequency 2 */
|
---|
157 |
|
---|
158 | /*KML for this struct SNR will be DBHz */
|
---|
159 | double l2_pseudo_range; /* frequency-2 pseudorange (XCorr) */
|
---|
160 | double l2_phase; /* frequency-2 carrier phase (XCorr) */
|
---|
161 | /*KML for this struct SNR will be DBHz */
|
---|
162 | double p2_pseudo_range; /* frequency-2 pseudorange */
|
---|
163 | double p2_phase; /* frequency-2 carrier phase */
|
---|
164 | }CMEAS_T;
|
---|
165 |
|
---|
166 |
|
---|
167 |
|
---|
168 |
|
---|
169 | /*******************************
|
---|
170 | * Content:Turbo Rogue Receiver
|
---|
171 | * Raw Turbo Broadcast Message
|
---|
172 | *******************************/
|
---|
173 | typedef struct rawtbeph{
|
---|
174 | char block_type; /* Turbo record type */
|
---|
175 | char block_length; /* Turbo record in bytes */
|
---|
176 | char Satellite; /* Sat. PRN */
|
---|
177 | char Dummy;
|
---|
178 | long GPSEpochTime;
|
---|
179 | long GPSCollectedTime;
|
---|
180 | unsigned long SubFrame1[6]; /* SubFrame1 hexbits */
|
---|
181 | unsigned long SubFrame2[6]; /* SubFrame2 hexbits */
|
---|
182 | unsigned long SubFrame3[6]; /* SubFrame3 hexbits */
|
---|
183 | }RNAV_T;
|
---|
184 |
|
---|
185 | /********************************
|
---|
186 | * Content: Turbo Rogue Receiver
|
---|
187 | * Raw TurboRogue GPS observation
|
---|
188 | ********************************/
|
---|
189 | typedef struct rawtbobserv{
|
---|
190 | char BlockType;
|
---|
191 | char BlockSize;
|
---|
192 | char Satellite;
|
---|
193 | char Channel;
|
---|
194 | long GPSTimeTag;
|
---|
195 | char SampleInterval;
|
---|
196 | char Flags;
|
---|
197 | unsigned short SNR[3];
|
---|
198 | double CAfaz;
|
---|
199 | double CAtau;
|
---|
200 | float faz1;
|
---|
201 | float tau1;
|
---|
202 | float faz2;
|
---|
203 | float tau2;
|
---|
204 | }TBIN_T;
|
---|
205 |
|
---|
206 | /*******************************
|
---|
207 | * Content:Turbo Rogue Receiver
|
---|
208 | * Turbo Broadcast Message
|
---|
209 | *******************************/
|
---|
210 | typedef struct reducedbeph{
|
---|
211 | long Satellite;
|
---|
212 | long GPSCollectedTime;
|
---|
213 | unsigned long SubFrame1[6]; /* SubFrame1 hexbits */
|
---|
214 | unsigned long SubFrame2[6]; /* SubFrame2 hexbits */
|
---|
215 | unsigned long SubFrame3[6]; /* SubFrame3 hexbits */
|
---|
216 | }TNAV_T;
|
---|
217 |
|
---|
218 |
|
---|
219 | /*************************************
|
---|
220 | * Content: Meteorological Observations
|
---|
221 | * Summarized met data
|
---|
222 | *************************************/
|
---|
223 | typedef struct scaledmet{
|
---|
224 | long GPSTime; /*GPS Time */
|
---|
225 | long Temp; /*scaled temperature */
|
---|
226 | long TempStdDev; /*scaled temp. std dev */
|
---|
227 | long Pressure; /*scaled pressure */
|
---|
228 | long PressureStdDev ; /*scaled press. std dev */
|
---|
229 | long RelHum; /*scaled percentage */
|
---|
230 | long RelHumStdDev; /*scaled prec. std dev */
|
---|
231 | }METS_T;
|
---|
232 |
|
---|
233 | #endif
|
---|