source: ntrip/trunk/BNC/src/pppar_interface.h@ 5681

Last change on this file since 5681 was 4806, checked in by mervart, 12 years ago
File size: 9.0 KB
Line 
1#ifndef PPPAR_INTERFACE_H
2#define PPPAR_INTERFACE_H
3
4/// Extern Definiton for DLL Support
5#ifdef WIN32
6# include <windows.h>
7# ifdef PPPAR_EXPORTS // automaticall added by cmake
8# define PPPAR_API EXTERN __declspec(dllexport)
9# else
10# ifdef PPPAR_STATIC_LIB // added in CMakeLists.txt
11# define PPPAR_API EXTERN
12# else
13# define PPPAR_API EXTERN __declspec(dllimport)
14# endif
15# endif
16#else
17# define PPPAR_API EXTERN
18#endif
19
20/// Extern Definiton for C++
21#ifdef __cplusplus
22# define EXTERN extern "C"
23#else
24# define EXTERN extern
25#endif
26
27/// Input options
28struct pppar_opt {
29 const char* _roverName; ///< name of the rover station
30 double _xyzAprRover[3]; ///< a priori coordinates of the rover station
31 double _neuEccRover[3]; ///< rover antenna eccentricity components
32 const char* _antNameRover; ///< name of the rover antenna
33 const char* _antexFileName; ///< name of the ANTEX file
34 int _logLevel; ///< level of details in log (0 ... no log, 1 ... normal log, 2 ... detailed log)
35 bool _useGlonass; ///< use Glonass observations (in addition to GPS)
36};
37
38/// Time
39struct pppar_time {
40 unsigned int _mjd; ///< modified Julian date
41 double _sec; ///< seconds of day
42};
43
44/// Unique satellite identification
45struct pppar_satellite {
46 char _system; ///< satellite system ('G' = GPS, 'R' = Glonass)
47 int _number; ///< satellite number (PRN if GPS, slot number if Glonass)
48};
49
50/// Output
51struct pppar_output {
52 pppar_time _epoTime; ///< time of the processed epoch
53 double _xyzRover[3]; ///< resulting rover coordinates
54 double _covMatrix[6]; ///< covariance matrix of rover coordinates (upper triangle)
55 char* _log; ///< log message
56 bool _error; ///< error flag
57};
58
59/// GPS ephemeris
60struct pppar_ephGPS {
61 pppar_satellite _satellite; ///< satellite
62 pppar_time _TOC; ///< Reference Time of Clocks
63 pppar_time _TOE; ///< Reference Time of Ephemeris
64 unsigned short _IODE; ///< Issue of Data (Ephemeris)
65 unsigned short _IODC; ///< Issue of Data (Clocks)
66 double _clock_bias; ///< Clock correction [s]
67 double _clock_drift; ///< Clock correction rate [s/s]
68 double _clock_driftrate; ///< Clock correction rate rate [s/s^2]
69 double _Crs; ///< sine correction to radius [m]
70 double _Delta_n; ///< mean motion correction [rad/s]
71 double _M0; ///< mean anomaly [rad]
72 double _Cuc; ///< cosine correction to argument of latitude [rad]
73 double _e; ///< numerical eccentricity
74 double _Cus; ///< sine correction to argument of latitude [rad]
75 double _sqrt_A; ///< semimajor axis square root [m^0.5]
76 double _Cic; ///< cosine correction to inclination [rad]
77 double _OMEGA0; ///< longitude of the ascending node [rad]
78 double _Cis; ///< sine correction to inclination [rad]
79 double _i0; ///< inclination angle [rad]
80 double _Crc; ///< cosine sine correction to radius [m]
81 double _omega; ///< argument of perigee [rad]
82 double _OMEGADOT; ///< rate of right ascension [rad/s]
83 double _IDOT; ///< rate of inclination angle [rad/s]
84 double _TGD; ///< differential group delay L1-L2 [s]
85 int _health; ///< health flag
86};
87
88/// Glonass ephemeris
89struct pppar_ephGlo {
90 pppar_satellite _satellite; ///< satellite
91 pppar_time _timeUTC; ///< Reference Time (UTC)
92 int _gps_utc; ///< GPS - UTC [s]
93 double _E; ///< ephemeris age [days]
94 double _tau; ///< clock correction [s]
95 double _gamma; ///< clock correction rate [s/s]
96 double _x_pos; ///< position x-component [km]
97 double _x_velocity; ///< velocity x-component [km/s]
98 double _x_acceleration; ///< acceleration x-component [km/s^2]
99 double _y_pos; ///< position y-component [km]
100 double _y_velocity; ///< velocity y-component [km/s]
101 double _y_acceleration; ///< acceleration y-component [km/s^2]
102 double _z_pos; ///< position z-component [km]
103 double _z_velocity; ///< velocity z-component [km/s]
104 double _z_acceleration; ///< acceleration z-component [km/s^2]
105 double _health; ///< health flag (0 = O.K.)
106 double _frequency_number; ///< frequency number (channel)
107};
108
109/// Single GNSS observation
110struct pppar_obs {
111 char _rnxType2ch[2]; ///< RINEX version 3 observation type description (band and attribute)
112 double _code; ///< code (pseudorange) observation value
113 bool _codeValid; ///< code validity flag
114 double _phase; ///< phase observation value
115 bool _phaseValid; ///< phase validity flag
116 double _doppler; ///< doppler observation value
117 bool _dopplerValid; ///< doppler validity flag
118 double _snr; ///< signal-to-noise value
119 bool _snrValid; ///< signal-to-noise validity flag
120 bool _slip; ///< cycle-slip flag
121 int _slipCounter; ///< cycle-slip counter (negative value = undefined);
122};
123
124/// GNSS observations of a single satellite
125struct pppar_satObs {
126 pppar_satellite _satellite; ///< satellite
127 pppar_time _time; ///< observation time (according to receiver clock)
128 int _slotNumber; ///< slot number for Glonass satellites
129 int _numObs; ///< number of observations
130 pppar_obs* _obs; ///< array of observations
131};
132
133/// Satellite Ephemeris Correction
134struct pppar_orbCorr {
135 pppar_satellite _satellite; ///< satellite
136 unsigned short _iod; ///< issue of data
137 pppar_time _time; ///< correction reference time
138 double _rao[3]; ///< radial, along-track, and out-of-plane correction components
139 double _dotRao[3]; ///< radial, along-track, and out-of-plane correction rate components
140 double _dotDotRao[3]; ///< radial, along-track, and out-of-plane correction rate rate components
141};
142
143/// Satellite Clock Correction
144struct pppar_clkCorr {
145 pppar_satellite _satellite; ///< satellite
146 unsigned short _iod; ///< issue of data
147 pppar_time _time; ///< correction reference time
148 double _dClk; ///< clock correction
149 double _dotDClk; ///< clock correction rate
150 double _dotDotDClk; ///< clock correction rate rate
151};
152
153/// Single Bias
154struct pppar_bias {
155 char _rnxType3ch[3]; ///< bias description (RINEX v3 code or special)
156 double _value; ///< bias value
157};
158
159/// Satellite-Specific Biases
160struct pppar_satBiases {
161 pppar_satellite _satellite; ///< satellite
162 pppar_time _time; ///< bias reference time
163 int _numBiases; ///< number of biases
164 pppar_bias* _biases; ///< array of biases
165};
166
167/// Initialize pppar_opt structure
168PPPAR_API void pppar_initOptions(pppar_opt* opt);
169
170/// Initialize pppar_obs structure
171PPPAR_API void pppar_initObs(pppar_obs* obs);
172
173/// \brief Set (and internally store) all input options
174///
175/// This function must be called at the begining (before any other function),
176/// it may be, however, called later changing the options on-the-fly.
177PPPAR_API void pppar_setOptions(const pppar_opt* opt);
178
179/// Add (and internally store) GPS Ephemeris
180PPPAR_API void pppar_putGPSEphemeris(const pppar_ephGPS* eph);
181
182/// Add (and internally store) Glonass Ephemeris
183PPPAR_API void pppar_putGloEphemeris(const pppar_ephGlo* eph);
184
185/// Add (and internally store) Ephemeris Corrections
186PPPAR_API void pppar_putOrbCorrections(int numCorr, const pppar_orbCorr* corr);
187
188/// Add (and internally store) Clock Corrections
189PPPAR_API void pppar_putClkCorrections(int numCorr, const pppar_clkCorr* corr);
190
191/// Add (and internally store) Satellite-Specific Biases
192PPPAR_API void pppar_putBiases(int numBiases, const pppar_satBiases* biases);
193
194/// Close processing, clean-up the memory
195PPPAR_API void pppar_destroy();
196
197/// Free memory allocated in output structure
198PPPAR_API void pppar_freeOutput(pppar_output* output);
199
200/// \brief Process single epoch
201///
202/// This function call performs the actual processing of a single epoch of
203/// data. The calling program must ensure that before calling this function
204/// the input options are set, satellite ephemerides are available and
205/// (optionally) the orbital and clock corrections are added.
206PPPAR_API
207void pppar_processEpoch(int numSatRover, ///< number of satellites (rover)
208 const pppar_satObs* satObsRover, ///< observations (rover)
209 pppar_output* output ///< output
210 );
211
212#endif
Note: See TracBrowser for help on using the repository browser.