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: /usr/local/cvsroot/BNC/RTIGS/rtstruct.h,v 1.3 2006/11/13 11:42:14 mervart Exp $ */
|
---|
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 | #ifndef PI
|
---|
83 | #define PI (3.141592653589793) /* value of PI */
|
---|
84 | #endif
|
---|
85 | #define DTR (0.017453292519943) /* deg to rad conversion con. */
|
---|
86 | #define C (299792458.00) /* speed of light in vaccuum */
|
---|
87 | #define F1 (1575.42E+06) /* GPS L1 frequency */
|
---|
88 | #define F1_SQUARE (F1 * F1) /* GPS L1 frequency squared */
|
---|
89 | #define L1 (C / F1) /* GPS L1 wavelength */
|
---|
90 | #define F2 (1227.60E+06) /* GPS L2 frequency */
|
---|
91 | #define F2_SQUARE (F2 * F2) /* GPS L2 frequency squared */
|
---|
92 | #define L2 (C / F2) /* GPS L2 wavelength */
|
---|
93 | #define F3 (F1 - F2) /* GPS widelane frequency */
|
---|
94 | #define L3 (C / F3) /* GPS widelane wavelength */
|
---|
95 | #define F1ION (F2_SQUARE / (F1_SQUARE - F2_SQUARE)) /* L1 iono scale factor */
|
---|
96 | #define F2ION (F1_SQUARE / (F1_SQUARE - F2_SQUARE)) /* L2 iono scale factor */
|
---|
97 | #define IonoH (350000.0) /* Ionospheric height in metres */
|
---|
98 |
|
---|
99 | /*******************************
|
---|
100 | * Content: Broadcast Orbit
|
---|
101 | * Representation
|
---|
102 | ********************************/
|
---|
103 | typedef struct broadcast{
|
---|
104 | double satellite; /* satellite number */
|
---|
105 | double gps_week; /* gps week number from 81/01/06*/
|
---|
106 | double user_range_acc; /* user range accuracy in meters */
|
---|
107 | double sat_health; /* satellite health (all bits) */
|
---|
108 | double fit_interval; /* ephemeris fit interval */
|
---|
109 | double l2code; /* Codes on L2 indicator */
|
---|
110 | double l2pflag; /* Data flag for L2 P code */
|
---|
111 | double issue_of_clock; /* issue of clock */
|
---|
112 | double issue_of_eph; /* issue of ephemeris */
|
---|
113 | double transmit_time; /* time of transmission */
|
---|
114 | double clock_ref_time; /* reference time of the clock */
|
---|
115 | double eph_ref_time; /* reference time of the ephem */
|
---|
116 | double a0; /* satellite clock coefficient */
|
---|
117 | double a1; /* satellite clock coefficient */
|
---|
118 | double a2; /* satellite clock coefficient */
|
---|
119 | double ref_mean_anmly; /* mean anomoly at reference time */
|
---|
120 | double mean_mot_diff; /* mean motion difference */
|
---|
121 | double orbit_ecc; /* orbit eccentricity */
|
---|
122 | double orbit_semimaj; /* square root of orbit semimajor axis */
|
---|
123 | double arg_of_perigee; /* argument of perigee */
|
---|
124 | double orbit_incl; /* orbit inclination */
|
---|
125 | double incl_rate; /* orbit inclination rate */
|
---|
126 | double right_asc; /* right ascension */
|
---|
127 | double right_asc_rate; /* rate of right ascension */
|
---|
128 | double lat_cos_corr; /* ampl of cos harm corr to arg of lat */
|
---|
129 | double lat_sin_corr; /* ampl of sin harm corr to arg of lat */
|
---|
130 | double orbit_cos_corr; /* ampl of cos harm corr to orbit */
|
---|
131 | double orbit_sin_corr; /* ampl of sin harm corr to orbit */
|
---|
132 | double incl_cos_corr; /* ampl of cos harm corr to the incl */
|
---|
133 | double incl_sin_corr; /* ampl of sin harm corr to the incl */
|
---|
134 | double group_delay; /* estimated group delay differential */
|
---|
135 | }BEPH_T;
|
---|
136 |
|
---|
137 |
|
---|
138 |
|
---|
139 | /******************************
|
---|
140 | * Content:Receiver independent
|
---|
141 | * GPS observation data structure
|
---|
142 | * contains all possible obs
|
---|
143 | *******************************/
|
---|
144 | typedef struct complete_measurement{
|
---|
145 | unsigned long GPSTime; /* broadcast time sec.*/
|
---|
146 | unsigned char chn; /* Channel*/
|
---|
147 | unsigned char sat_prn; /* satellite ID*/
|
---|
148 | unsigned short ntrvl; /* number of seconds */
|
---|
149 | unsigned char flag[4]; /*observation quality flags*/
|
---|
150 | float l1_sn; /* signal-to-noise CA frequency 1 */
|
---|
151 |
|
---|
152 | double l1_pseudo_range; /* frequency-1 CA pseudorange */
|
---|
153 | double l1_phase; /* frequency-1 CA carrier phase */
|
---|
154 | /*KML for this struct SNR will be DBHz */
|
---|
155 | double p1_pseudo_range; /* frequency-1 P1 pseudorange */
|
---|
156 | double p1_phase; /* frequency-1 P1 carrier phase */
|
---|
157 | float p1_sn; /* signal-to-noise P1 frequency 1 */
|
---|
158 | float l2_sn; /* signal-to-noise frequency 2 */
|
---|
159 |
|
---|
160 | /*KML for this struct SNR will be DBHz */
|
---|
161 | double l2_pseudo_range; /* frequency-2 pseudorange (XCorr) */
|
---|
162 | double l2_phase; /* frequency-2 carrier phase (XCorr) */
|
---|
163 | /*KML for this struct SNR will be DBHz */
|
---|
164 | double p2_pseudo_range; /* frequency-2 pseudorange */
|
---|
165 | double p2_phase; /* frequency-2 carrier phase */
|
---|
166 | }CMEAS_T;
|
---|
167 |
|
---|
168 |
|
---|
169 |
|
---|
170 |
|
---|
171 | /*******************************
|
---|
172 | * Content:Turbo Rogue Receiver
|
---|
173 | * Raw Turbo Broadcast Message
|
---|
174 | *******************************/
|
---|
175 | typedef struct rawtbeph{
|
---|
176 | char block_type; /* Turbo record type */
|
---|
177 | char block_length; /* Turbo record in bytes */
|
---|
178 | char Satellite; /* Sat. PRN */
|
---|
179 | char Dummy;
|
---|
180 | long GPSEpochTime;
|
---|
181 | long GPSCollectedTime;
|
---|
182 | unsigned long SubFrame1[6]; /* SubFrame1 hexbits */
|
---|
183 | unsigned long SubFrame2[6]; /* SubFrame2 hexbits */
|
---|
184 | unsigned long SubFrame3[6]; /* SubFrame3 hexbits */
|
---|
185 | }RNAV_T;
|
---|
186 |
|
---|
187 | /********************************
|
---|
188 | * Content: Turbo Rogue Receiver
|
---|
189 | * Raw TurboRogue GPS observation
|
---|
190 | ********************************/
|
---|
191 | typedef struct rawtbobserv{
|
---|
192 | char BlockType;
|
---|
193 | char BlockSize;
|
---|
194 | char Satellite;
|
---|
195 | char Channel;
|
---|
196 | long GPSTimeTag;
|
---|
197 | char SampleInterval;
|
---|
198 | char Flags;
|
---|
199 | unsigned short SNR[3];
|
---|
200 | double CAfaz;
|
---|
201 | double CAtau;
|
---|
202 | float faz1;
|
---|
203 | float tau1;
|
---|
204 | float faz2;
|
---|
205 | float tau2;
|
---|
206 | }TBIN_T;
|
---|
207 |
|
---|
208 | /*******************************
|
---|
209 | * Content:Turbo Rogue Receiver
|
---|
210 | * Turbo Broadcast Message
|
---|
211 | *******************************/
|
---|
212 | typedef struct reducedbeph{
|
---|
213 | long Satellite;
|
---|
214 | long GPSCollectedTime;
|
---|
215 | unsigned long SubFrame1[6]; /* SubFrame1 hexbits */
|
---|
216 | unsigned long SubFrame2[6]; /* SubFrame2 hexbits */
|
---|
217 | unsigned long SubFrame3[6]; /* SubFrame3 hexbits */
|
---|
218 | }TNAV_T;
|
---|
219 |
|
---|
220 |
|
---|
221 | /*************************************
|
---|
222 | * Content: Meteorological Observations
|
---|
223 | * Summarized met data
|
---|
224 | *************************************/
|
---|
225 | typedef struct scaledmet{
|
---|
226 | long GPSTime; /*GPS Time */
|
---|
227 | long Temp; /*scaled temperature */
|
---|
228 | long TempStdDev; /*scaled temp. std dev */
|
---|
229 | long Pressure; /*scaled pressure */
|
---|
230 | long PressureStdDev ; /*scaled press. std dev */
|
---|
231 | long RelHum; /*scaled percentage */
|
---|
232 | long RelHumStdDev; /*scaled prec. std dev */
|
---|
233 | }METS_T;
|
---|
234 |
|
---|
235 | #endif
|
---|