source: ntrip/branches/BNC_2.12/src/RTCM3/clock_and_orbit/clock_orbit_igs.cpp@ 9209

Last change on this file since 9209 was 9209, checked in by stuerze, 20 months ago

small re-organization of debug output

  • Property svn:executable set to *
File size: 35.0 KB
Line 
1/* Programheader
2
3 Name: clock_orbit_igs.c
4 Project: RTCM3
5 Version: $Id: clock_orbit_igs.c 8963 2020-06-29 12:46:25Z stuerze $
6 Authors: Dirk Stöcker, Andrea Stürze
7 Description: state space approach: IGS
8 */
9
10#include <math.h>
11#include <stdio.h>
12#include <string.h>
13#ifndef sparc
14#include <stdint.h>
15#else
16#include <sys/types.h>
17#endif
18#include <clock_orbit_igs.h>
19
20
21size_t SsrCorrIgs::MakeClockOrbit(const struct ClockOrbit *co, ClockOrbitType type,
22 int moremessagesfollow, char *buffer, size_t size) {
23
24 unsigned int status[CLOCKORBIT_SATNUM][COBOFS_NUM], i, s;
25
26 memset(status, 0, sizeof(status));
27
28 STARTDATA
29
30 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) {
31 for (i = 0; i < COBOFS_NUM; ++i) {
32 if (co->NumberOfSat[s] && (type == COTYPE_AUTO || type == corbase[s] + i) &&
33 (co->Supplied[i] || (i <= COBOFS_CLOCK && co->Supplied[COBOFS_COMBINED]) ||
34 (i == COBOFS_COMBINED && co->Supplied[COBOFS_ORBIT] && co->Supplied[COBOFS_CLOCK]))) {
35 status[s][i] = 1;
36 if (i == COBOFS_COMBINED) {
37 status[s][COBOFS_ORBIT] = status[s][COBOFS_CLOCK] = 0;
38 } /* disable single blocks for combined type */
39 } /* check for data */
40 } /* iterate over sub-types */
41 } /* iterate over satellite systems */
42
43 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) {
44 if (status[s][COBOFS_ORBIT]) {
45 INITBLOCK
46 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
47 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
48 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_ORBIT)
49 T_SSR_EPOCH_TIME(co->EpochTime[s])
50 T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
51 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
52 T_SSR_IOD(co->SSRIOD)
53 T_SSR_PROVIDER_ID(co->SSRProviderID)
54 T_SSR_SOLUTION_ID(co->SSRSolutionID)
55 T_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
56 T_NO_OF_SATELLITES(co->NumberOfSat[s])
57 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) {
58 T_GNSS_SATELLITE_ID(co->Sat[i].ID)
59 T_GNSS_IOD(co->Sat[i].IOD)
60 T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
61 T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
62 T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
63 T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
64 T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
65 T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
66 }
67 ENDBLOCK
68 }
69 if (status[s][COBOFS_CLOCK]) {
70 INITBLOCK
71 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
72 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
73 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_CLOCK)
74 T_SSR_EPOCH_TIME(co->EpochTime[s])
75 T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
76 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
77 T_SSR_IOD(co->SSRIOD)
78 T_SSR_PROVIDER_ID(co->SSRProviderID)
79 T_SSR_SOLUTION_ID(co->SSRSolutionID)
80 T_NO_OF_SATELLITES(co->NumberOfSat[s])
81 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) {
82 T_GNSS_SATELLITE_ID(co->Sat[i].ID)
83 T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
84 T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
85 T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
86 }
87 ENDBLOCK
88 }
89 if (status[s][COBOFS_COMBINED]) {
90#ifdef SPLITBLOCK
91 int nums = co->NumberOfSat[s];
92 int left, start = satoffset[s];
93 if(nums > 28) {/* split block when more than 28 sats */
94 left = nums - 28;
95 nums = 28;
96 }
97 else {
98 left = 0;
99 }
100 while(nums) {
101#endif
102 INITBLOCK
103 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
104 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
105 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_COMBINED)
106 T_SSR_EPOCH_TIME(co->EpochTime[s])
107 T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
108#ifdef SPLITBLOCK
109 T_MULTIPLE_MESSAGE_INDICATOR((moremessagesfollow || left) ? 1 : 0)
110#else
111 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
112#endif
113 T_SSR_IOD(co->SSRIOD)
114 T_SSR_PROVIDER_ID(co->SSRProviderID)
115 T_SSR_SOLUTION_ID(co->SSRSolutionID)
116 T_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
117#ifdef SPLITBLOCK
118 T_NO_OF_SATELLITES(nums)
119 for(i = start; i < start+nums; ++i) {
120#else
121 T_NO_OF_SATELLITES(co->NumberOfSat[s])
122 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) {
123#endif
124 T_GNSS_SATELLITE_ID(co->Sat[i].ID)
125 T_GNSS_IOD(co->Sat[i].IOD)
126 T_DELTA_RADIAL(co->Sat[i].Orbit.DeltaRadial)
127 T_DELTA_ALONG_TRACK(co->Sat[i].Orbit.DeltaAlongTrack)
128 T_DELTA_CROSS_TRACK(co->Sat[i].Orbit.DeltaCrossTrack)
129 T_DELTA_DOT_RADIAL(co->Sat[i].Orbit.DotDeltaRadial)
130 T_DELTA_DOT_ALONG_TRACK(co->Sat[i].Orbit.DotDeltaAlongTrack)
131 T_DELTA_DOT_CROSS_TRACK(co->Sat[i].Orbit.DotDeltaCrossTrack)
132 T_DELTA_CLOCK_C0(co->Sat[i].Clock.DeltaA0)
133 T_DELTA_CLOCK_C1(co->Sat[i].Clock.DeltaA1)
134 T_DELTA_CLOCK_C2(co->Sat[i].Clock.DeltaA2)
135 }
136 ENDBLOCK
137#ifdef SPLITBLOCK
138 start += nums;
139 nums = left;
140 left = 0;
141 }
142#endif
143 }
144 if (status[s][COBOFS_HR]) {
145 INITBLOCK
146 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
147 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
148 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_HR)
149 T_SSR_EPOCH_TIME(co->EpochTime[s])
150 T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
151 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
152 T_SSR_IOD(co->SSRIOD)
153 T_SSR_PROVIDER_ID(co->SSRProviderID)
154 T_SSR_SOLUTION_ID(co->SSRSolutionID)
155 T_NO_OF_SATELLITES(co->NumberOfSat[s])
156 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) {
157 T_GNSS_SATELLITE_ID(co->Sat[i].ID)
158 T_HR_CLOCK_CORRECTION(co->Sat[i].hrclock)
159 }
160 ENDBLOCK
161 }
162 if (status[s][COBOFS_URA]) {
163 INITBLOCK
164 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
165 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
166 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_URA)
167 T_SSR_EPOCH_TIME(co->EpochTime[s])
168 T_SSR_UPDATE_INTERVAL(co->UpdateInterval)
169 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
170 T_SSR_IOD(co->SSRIOD)
171 T_SSR_PROVIDER_ID(co->SSRProviderID)
172 T_SSR_SOLUTION_ID(co->SSRSolutionID)
173 T_NO_OF_SATELLITES(co->NumberOfSat[s])
174 for (i = satoffset[s]; i < satoffset[s] + co->NumberOfSat[s]; ++i) {
175 T_GNSS_SATELLITE_ID(co->Sat[i].ID)
176 T_SSR_URA(ValueToURA(co->Sat[i].UserRangeAccuracy))
177 }
178 ENDBLOCK
179 }
180 }
181 return ressize;
182}
183
184size_t SsrCorrIgs::MakeCodeBias(const struct CodeBias *b, CodeBiasType type,
185 int moremessagesfollow, char *buffer, size_t size) {
186 unsigned int s, i, j;
187
188 STARTDATA
189
190 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) {
191 if (b->NumberOfSat[s] && (type == CBTYPE_AUTO || type == corbase[s] + COBOFS_CBIAS)) {
192 INITBLOCK
193 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
194 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
195 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_CBIAS)
196 T_SSR_EPOCH_TIME(b->EpochTime[s])
197 T_SSR_UPDATE_INTERVAL(b->UpdateInterval)
198 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
199 T_SSR_IOD(b->SSRIOD)
200 T_SSR_PROVIDER_ID(b->SSRProviderID)
201 T_SSR_SOLUTION_ID(b->SSRSolutionID)
202 T_NO_OF_SATELLITES(b->NumberOfSat[s])
203 for (i = satoffset[s]; i < satoffset[s] + b->NumberOfSat[s]; ++i) {
204 T_GNSS_SATELLITE_ID(b->Sat[i].ID)
205 T_NO_OF_BIASES(b->Sat[i].NumberOfCodeBiases)
206 for (j = 0; j < b->Sat[i].NumberOfCodeBiases; ++j) {
207 T_GNSS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
208 T_CODE_BIAS(b->Sat[i].Biases[j].Bias)
209 }
210 }
211 ENDBLOCK
212 }
213 }
214 return ressize;
215}
216
217size_t SsrCorrIgs::MakePhaseBias(const struct PhaseBias *b, PhaseBiasType type,
218 int moremessagesfollow, char *buffer, size_t size) {
219 unsigned int s, i, j;
220
221 STARTDATA
222
223 for (s = 0; s < CLOCKORBIT_SATNUM; ++s) {
224 if (b->NumberOfSat[s] && (type == PBTYPE_AUTO || type == corbase[s] + COBOFS_PBIAS)) {
225 INITBLOCK
226 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
227 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
228 T_IGS_MESSAGE_NUMBER(corbase[s] + COBOFS_PBIAS)
229 T_SSR_EPOCH_TIME(b->EpochTime[s])
230 T_SSR_UPDATE_INTERVAL(b->UpdateInterval)
231 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
232 T_SSR_IOD(b->SSRIOD)
233 T_SSR_PROVIDER_ID(b->SSRProviderID)
234 T_SSR_SOLUTION_ID(b->SSRSolutionID)
235 T_DISPERSIVE_BIAS_INDICATOR(b->DispersiveBiasConsistencyIndicator ? 1 : 0)
236 T_MW_CONSISTENCY_INDICATOR(b->MWConsistencyIndicator ? 1 : 0)
237 T_NO_OF_SATELLITES(b->NumberOfSat[s])
238 for (i = satoffset[s]; i < satoffset[s] + b->NumberOfSat[s]; ++i) {
239 T_GNSS_SATELLITE_ID(b->Sat[i].ID)
240 T_NO_OF_BIASES(b->Sat[i].NumberOfPhaseBiases)
241 T_YAW_ANGLE(b->Sat[i].YawAngle)
242 T_YAW_RATE(b->Sat[i].YawRate)
243 for (j = 0; j < b->Sat[i].NumberOfPhaseBiases; ++j) {
244 T_GNSS_SIGNAL_IDENTIFIER(b->Sat[i].Biases[j].Type)
245 T_INTEGER_INDICATOR(b->Sat[i].Biases[j].SignalIntegerIndicator ? 1 : 0)
246 T_WIDE_LANE_INDICATOR(b->Sat[i].Biases[j].SignalsWideLaneIntegerIndicator)
247 T_DISCONTINUITY_COUNTER(b->Sat[i].Biases[j].SignalDiscontinuityCounter)
248 T_PHASE_BIAS(b->Sat[i].Biases[j].Bias)
249 }
250 }
251 ENDBLOCK
252 }
253 }
254 return ressize;
255}
256
257size_t SsrCorrIgs::MakeVTEC(const struct VTEC *v, int moremessagesfollow, char *buffer, size_t size) {
258 unsigned int l, o, d;
259
260 STARTDATA
261 INITBLOCK
262
263 T_RTCM_MESSAGE_NUMBER(RTCM_MESSAGE_NUMBER_IGS)
264 T_IGS_SSR_VERSION(IGS_SSR_VERSION)
265 T_IGS_MESSAGE_NUMBER(VTEC_BASE)
266 T_SSR_EPOCH_TIME(v->EpochTime)
267 T_SSR_UPDATE_INTERVAL(v->UpdateInterval)
268 T_MULTIPLE_MESSAGE_INDICATOR(moremessagesfollow ? 1 : 0)
269 T_SSR_IOD(v->SSRIOD)
270 T_SSR_PROVIDER_ID(v->SSRProviderID)
271 T_SSR_SOLUTION_ID(v->SSRSolutionID)
272 T_VTEC_QUALITY_INDICATOR(v->Quality)
273 T_NO_IONO_LAYERS(v->NumLayers)
274 for (l = 0; l < v->NumLayers; ++l) {
275 T_IONO_HEIGHT(v->Layers[l].Height)
276 T_IONO_DEGREE(v->Layers[l].Degree)
277 T_IONO_ORDER(v->Layers[l].Order)
278 for (o = 0; o <= v->Layers[l].Order; ++o) {
279 for (d = o; d <= v->Layers[l].Degree; ++d) {
280 T_IONO_COEFF_C(v->Layers[l].Cosinus[d][o])
281 }
282 }
283 for (o = 1; o <= v->Layers[l].Order; ++o) {
284 for (d = o; d <= v->Layers[l].Degree; ++d) {
285 T_IONO_COEFF_S(v->Layers[l].Sinus[d][o])
286 }
287 }
288 }
289 ENDBLOCK
290 return ressize;
291}
292
293enum GCOB_RETURN SsrCorrIgs::GetSSR(struct ClockOrbit *co, struct CodeBias *b,struct VTEC *v,
294 struct PhaseBias *pb, const char *buffer, size_t size, int *bytesused) {
295 int mmi = 0, h, rs;
296 unsigned int rtcmtype, igstype, pos, i, j, s, nums, id, version;
297 size_t sizeofrtcmblock;
298 const char *blockstart = buffer;
299 DECODESTART
300
301 if (size < 7)
302 return GCOBR_SHORTBUFFER;
303
304#ifdef BNC_DEBUG_SSR
305 fprintf(stderr, "GetSSR-IGS START: size %d, numbits %d\n",(int)size, numbits);
306#endif
307
308 G_HEADER(h)
309 G_RESERVEDH(rs)
310 G_SIZE(sizeofrtcmblock);
311
312 if ((unsigned char) h != 0xD3 || rs)
313 return GCOBR_UNKNOWNDATA;
314 if (size < sizeofrtcmblock + 3) /* 3 header bytes already removed */
315 return GCOBR_MESSAGEEXCEEDSBUFFER;
316 if (CRC24(sizeofrtcmblock + 3, (const unsigned char *) blockstart) !=
317 (uint32_t) ((((unsigned char) buffer[sizeofrtcmblock]) << 16) |
318 (((unsigned char) buffer[sizeofrtcmblock + 1]) << 8) |
319 (((unsigned char) buffer[sizeofrtcmblock + 2]))))
320 return GCOBR_CRCMISMATCH;
321 size = sizeofrtcmblock; /* reduce size, so overflows are detected */
322
323 G_RTCM_MESSAGE_NUMBER(rtcmtype)
324 G_IGS_SSR_VERSION(version)
325#ifdef BNC_DEBUG_SSR
326 fprintf(stderr, "rtcmType %d igsVersion %d ", rtcmtype, version);
327#endif
328 G_IGS_MESSAGE_NUMBER(igstype)
329#ifdef BNC_DEBUG_SSR
330 fprintf(stderr, "igsType IM%d size %d\n", igstype,(int)sizeofrtcmblock);
331#endif
332 if (bytesused)
333 *bytesused = sizeofrtcmblock + 6;
334
335 if (igstype == VTEC_BASE) {
336 unsigned int l, o, d;
337 if (!v)
338 return GCOBR_NOVTECPARAMETER;
339 memset(v, 0, sizeof(*v));
340 G_SSR_EPOCH_TIME(v->EpochTime)
341 G_SSR_UPDATE_INTERVAL(v->UpdateInterval)
342 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
343 G_SSR_IOD(v->SSRIOD)
344 G_SSR_PROVIDER_ID(v->SSRProviderID)
345 G_SSR_SOLUTION_ID(v->SSRSolutionID)
346 G_VTEC_QUALITY_INDICATOR(v->Quality)
347 G_NO_IONO_LAYERS(v->NumLayers)
348#ifdef BNC_DEBUG_SSR
349 fprintf(stderr, "epochTime %d ui %d mmi %d ssrIod %d providerId %d solId %d vtecQ %8.3f numLay %d \n",
350 v->EpochTime, v->UpdateInterval, mmi,
351 v->SSRIOD, v->SSRProviderID, v->SSRSolutionID, v->Quality, v->NumLayers);
352#endif
353 for (l = 0; l < v->NumLayers; ++l) {
354 G_IONO_HEIGHT(v->Layers[l].Height)
355 G_IONO_DEGREE(v->Layers[l].Degree)
356 G_IONO_ORDER(v->Layers[l].Order)
357#ifdef BNC_DEBUG_SSR
358 fprintf(stderr, "h %8.3f deg %d ord %d \n",
359 v->Layers[l].Height, v->Layers[l].Degree, v->Layers[l].Order);
360#endif
361 for (o = 0; o <= v->Layers[l].Order; ++o) {
362 for (d = o; d <= v->Layers[l].Degree; ++d) {
363 G_IONO_COEFF_C(v->Layers[l].Cosinus[d][o])
364#ifdef BNC_DEBUG_SSR
365 fprintf(stderr, "C[%02d][%02d] %8.3f \n",
366 d, o, v->Layers[l].Cosinus[d][o]);
367#endif
368 }
369 }
370 for (o = 1; o <= v->Layers[l].Order; ++o) {
371 for (d = o; d <= v->Layers[l].Degree; ++d) {
372 G_IONO_COEFF_S(v->Layers[l].Sinus[d][o])
373#ifdef BNC_DEBUG_SSR
374 fprintf(stderr, "S[%02d][%02d] %8.3f \n",
375 d, o, v->Layers[l].Sinus[d][o]);
376#endif
377 }
378 }
379 }
380#ifdef BNC_DEBUG_SSR
381 for(igstype = 0; igstype < (unsigned int)size && (unsigned char)buffer[igstype] != 0xD3; ++igstype)
382 numbits += 8;
383 fprintf(stderr, "numbits left %d\n",numbits);
384#endif
385 return mmi ? GCOBR_MESSAGEFOLLOWS : GCOBR_OK;
386 }
387 for (s = CLOCKORBIT_SATNUM; s-- > 0;) {
388 if (igstype >= corbase[s]) {
389 unsigned int corrOffset = igstype - corbase[s];
390 if (corrOffset == COBOFS_ORBIT) {
391 if (!co)
392 return GCOBR_NOCLOCKORBITPARAMETER;
393 co->messageType = igstype;
394 G_SSR_EPOCH_TIME_CHECK(co->EpochTime[s], co->NumberOfSat[s])
395 G_SSR_UPDATE_INTERVAL(co->UpdateInterval)
396 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
397 G_SSR_IOD(co->SSRIOD)
398 G_SSR_PROVIDER_ID(co->SSRProviderID)
399 G_SSR_SOLUTION_ID(co->SSRSolutionID)
400 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
401 G_NO_OF_SATELLITES(nums)
402 co->Supplied[COBOFS_ORBIT] |= 1;
403#ifdef BNC_DEBUG_SSR
404 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d rd %d ssrIod %d providerId %d solId %d\n",
405 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums,
406 co->SatRefDatum, co->SSRIOD, co->SSRProviderID, co->SSRSolutionID);
407#endif
408 for (i = 0; i < nums; ++i) {
409 G_GNSS_SATELLITE_ID(id)
410 for (pos = satoffset[s];
411 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id;
412 ++pos)
413 ;
414 if (pos >= satoffset[s + 1])
415 return GCOBR_DATAMISMATCH;
416 else if (pos == co->NumberOfSat[s] + satoffset[s])
417 ++co->NumberOfSat[s];
418 co->Sat[pos].ID = id;
419 G_GNSS_IOD(co->Sat[pos].IOD)
420 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
421 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
422 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
423 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
424 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
425 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
426#ifdef BNC_DEBUG_SSR
427 fprintf(stderr, "id %2d iod %3d dr %8.4f da %8.4f dc %8.4f dr %8.3f da %8.3f dc %8.3f\n",
428 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial,
429 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack,
430 co->Sat[pos].Orbit.DotDeltaRadial,
431 co->Sat[pos].Orbit.DotDeltaAlongTrack,
432 co->Sat[pos].Orbit.DotDeltaCrossTrack);
433#endif
434 }
435 }
436 else if (corrOffset == COBOFS_CLOCK) {
437 if (!co)
438 return GCOBR_NOCLOCKORBITPARAMETER;
439 co->messageType = igstype;
440 G_SSR_EPOCH_TIME_CHECK(co->EpochTime[s], co->NumberOfSat[s])
441 G_SSR_UPDATE_INTERVAL(co->UpdateInterval)
442 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
443 G_SSR_IOD(co->SSRIOD)
444 G_SSR_PROVIDER_ID(co->SSRProviderID)
445 G_SSR_SOLUTION_ID(co->SSRSolutionID)
446 G_NO_OF_SATELLITES(nums)
447 co->Supplied[COBOFS_CLOCK] |= 1;
448#ifdef BNC_DEBUG_SSR
449 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n",
450 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums,
451 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID);
452#endif
453 for (i = 0; i < nums; ++i) {
454 G_GNSS_SATELLITE_ID(id)
455 for (pos = satoffset[s];
456 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id;
457 ++pos)
458 ;
459 if (pos >= satoffset[s + 1])
460 return GCOBR_DATAMISMATCH;
461 else if (pos == co->NumberOfSat[s] + satoffset[s])
462 ++co->NumberOfSat[s];
463 co->Sat[pos].ID = id;
464 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
465 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
466 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
467#ifdef BNC_DEBUG_SSR
468 fprintf(stderr, "id %2d c0 %8.3f c1 %8.3f c2 %8.3f\n",
469 co->Sat[pos].ID, co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1,
470 co->Sat[pos].Clock.DeltaA2);
471#endif
472 }
473 }
474 else if (corrOffset == COBOFS_COMBINED) {
475 if (!co)
476 return GCOBR_NOCLOCKORBITPARAMETER;
477 co->messageType = igstype;
478 G_SSR_EPOCH_TIME_CHECK(co->EpochTime[s], co->NumberOfSat[s])
479 G_SSR_UPDATE_INTERVAL(co->UpdateInterval)
480 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
481 G_SSR_IOD(co->SSRIOD)
482 G_SSR_PROVIDER_ID(co->SSRProviderID)
483 G_SSR_SOLUTION_ID(co->SSRSolutionID)
484 G_SATELLITE_REFERENCE_DATUM(co->SatRefDatum)
485 G_NO_OF_SATELLITES(nums)
486 co->Supplied[COBOFS_ORBIT] |= 1;
487 co->Supplied[COBOFS_CLOCK] |= 1;
488#ifdef BNC_DEBUG_SSR
489 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d rd %d ssrIod %d providerId %d solId %d\n",
490 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums,
491 co->SatRefDatum, co->SSRIOD, co->SSRProviderID, co->SSRSolutionID);
492#endif
493 for (i = 0; i < nums; ++i) {
494 G_GNSS_SATELLITE_ID(id)
495 for (pos = satoffset[s];
496 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id;
497 ++pos)
498 ;
499 if (pos >= satoffset[s + 1])
500 return GCOBR_DATAMISMATCH;
501 else if (pos == co->NumberOfSat[s] + satoffset[s])
502 ++co->NumberOfSat[s];
503 co->Sat[pos].ID = id;
504 G_GNSS_IOD(co->Sat[pos].IOD)
505 G_DELTA_RADIAL(co->Sat[pos].Orbit.DeltaRadial)
506 G_DELTA_ALONG_TRACK(co->Sat[pos].Orbit.DeltaAlongTrack)
507 G_DELTA_CROSS_TRACK(co->Sat[pos].Orbit.DeltaCrossTrack)
508 G_DELTA_DOT_RADIAL(co->Sat[pos].Orbit.DotDeltaRadial)
509 G_DELTA_DOT_ALONG_TRACK(co->Sat[pos].Orbit.DotDeltaAlongTrack)
510 G_DELTA_DOT_CROSS_TRACK(co->Sat[pos].Orbit.DotDeltaCrossTrack)
511 G_DELTA_CLOCK_C0(co->Sat[pos].Clock.DeltaA0)
512 G_DELTA_CLOCK_C1(co->Sat[pos].Clock.DeltaA1)
513 G_DELTA_CLOCK_C2(co->Sat[pos].Clock.DeltaA2)
514#ifdef BNC_DEBUG_SSR
515 fprintf(stderr, "id %2d iod %3d dr %10.6f da %10.6f dc %10.6f dr %10.6f da %10.6f dc %10.6f c0 %10.6f c1 %10.6f c2 %10.6f\n",
516 co->Sat[pos].ID,co->Sat[pos].IOD,co->Sat[pos].Orbit.DeltaRadial,
517 co->Sat[pos].Orbit.DeltaAlongTrack,co->Sat[pos].Orbit.DeltaCrossTrack,
518 co->Sat[pos].Orbit.DotDeltaRadial, co->Sat[pos].Orbit.DotDeltaAlongTrack,
519 co->Sat[pos].Orbit.DotDeltaCrossTrack,
520 co->Sat[pos].Clock.DeltaA0, co->Sat[pos].Clock.DeltaA1, co->Sat[pos].Clock.DeltaA2);
521#endif
522 }
523 }
524 else if (corrOffset == COBOFS_URA) {
525 if (!co)
526 return GCOBR_NOCLOCKORBITPARAMETER;
527 co->messageType = igstype;
528 G_SSR_EPOCH_TIME_CHECK(co->EpochTime[s], co->NumberOfSat[s])
529 G_SSR_UPDATE_INTERVAL(co->UpdateInterval)
530 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
531 G_SSR_IOD(co->SSRIOD)
532 G_SSR_PROVIDER_ID(co->SSRProviderID)
533 G_SSR_SOLUTION_ID(co->SSRSolutionID)
534 G_NO_OF_SATELLITES(nums)
535 co->Supplied[COBOFS_URA] |= 1;
536#ifdef BNC_DEBUG_SSR
537 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n",
538 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums,
539 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID);
540#endif
541 for (i = 0; i < nums; ++i) {
542 G_GNSS_SATELLITE_ID(id)
543 for (pos = satoffset[s];
544 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id;
545 ++pos)
546 ;
547 if (pos >= satoffset[s + 1])
548 return GCOBR_DATAMISMATCH;
549 else if (pos == co->NumberOfSat[s] + satoffset[s])
550 ++co->NumberOfSat[s];
551 co->Sat[pos].ID = id;
552 G_SSR_URA(co->Sat[pos].UserRangeAccuracy)
553#ifdef BNC_DEBUG_SSR
554 fprintf(stderr, "id %2d ura %8.3f \n",
555 co->Sat[pos].ID, co->Sat[pos].UserRangeAccuracy);
556#endif
557 }
558 }
559 else if (corrOffset == COBOFS_HR) {
560 if (!co)
561 return GCOBR_NOCLOCKORBITPARAMETER;
562 co->messageType = igstype;
563 G_SSR_EPOCH_TIME_CHECK(co->EpochTime[s], co->NumberOfSat[s])
564 G_SSR_UPDATE_INTERVAL(co->UpdateInterval)
565 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
566 G_SSR_IOD(co->SSRIOD)
567 G_SSR_PROVIDER_ID(co->SSRProviderID)
568 G_SSR_SOLUTION_ID(co->SSRSolutionID)
569 G_NO_OF_SATELLITES(nums)
570 co->Supplied[COBOFS_HR] |= 1;
571#ifdef BNC_DEBUG_SSR
572 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n",
573 co->EpochTime[s], co->UpdateInterval,mmi,co->NumberOfSat[s],nums,
574 co->SSRIOD, co->SSRProviderID, co->SSRSolutionID);
575#endif
576 for (i = 0; i < nums; ++i) {
577 G_GNSS_SATELLITE_ID(id)
578 for (pos = satoffset[s];
579 pos < satoffset[s] + co->NumberOfSat[s] && co->Sat[pos].ID != id;
580 ++pos)
581 ;
582 if (pos >= satoffset[s + 1])
583 return GCOBR_DATAMISMATCH;
584 else if (pos == co->NumberOfSat[s] + satoffset[s])
585 ++co->NumberOfSat[s];
586 co->Sat[pos].ID = id;
587 G_HR_CLOCK_CORRECTION(co->Sat[pos].hrclock)
588#ifdef BNC_DEBUG_SSR
589 fprintf(stderr, "id %2d hrClock %8.3f \n",
590 co->Sat[pos].ID, co->Sat[pos].hrclock);
591#endif
592 }
593 }
594 else if (corrOffset == COBOFS_CBIAS) {
595 if (!b)
596 return GCOBR_NOCODEBIASPARAMETER;
597 b->messageType = igstype;
598 G_SSR_EPOCH_TIME_CHECK(b->EpochTime[s], b->NumberOfSat[s])
599 G_SSR_UPDATE_INTERVAL(b->UpdateInterval)
600 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
601 G_SSR_IOD(b->SSRIOD)
602 G_SSR_PROVIDER_ID(b->SSRProviderID)
603 G_SSR_SOLUTION_ID(b->SSRSolutionID)
604 G_NO_OF_SATELLITES(nums)
605#ifdef BNC_DEBUG_SSR
606 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d\n",
607 b->EpochTime[s], b->UpdateInterval,mmi,b->NumberOfSat[s],nums,
608 b->SSRIOD, b->SSRProviderID, b->SSRSolutionID);
609#endif
610 for (i = 0; i < nums; ++i) {
611 G_GNSS_SATELLITE_ID(id)
612 for (pos = satoffset[s];
613 pos < satoffset[s] + b->NumberOfSat[s] && b->Sat[pos].ID != id;
614 ++pos)
615 ;
616 if (pos >= satoffset[s + 1])
617 return GCOBR_DATAMISMATCH;
618 else if (pos == b->NumberOfSat[s] + satoffset[s])
619 ++b->NumberOfSat[s];
620 b->Sat[pos].ID = id;
621 G_NO_OF_BIASES(b->Sat[pos].NumberOfCodeBiases)
622#ifdef BNC_DEBUG_SSR
623 fprintf(stderr, "id %2d #%d ",
624 b->Sat[pos].ID, b->Sat[pos].NumberOfCodeBiases);
625#endif
626 for (j = 0; j < b->Sat[pos].NumberOfCodeBiases; ++j) {
627 G_GNSS_SIGNAL_IDENTIFIER(b->Sat[pos].Biases[j].Type)
628 G_CODE_BIAS(b->Sat[pos].Biases[j].Bias)
629#ifdef BNC_DEBUG_SSR
630 fprintf(stderr, "t%02d b %8.2f ",
631 b->Sat[pos].Biases[j].Type, b->Sat[pos].Biases[j].Bias);
632#endif
633 }
634#ifdef BNC_DEBUG_SSR
635 fprintf(stderr, "\n");
636#endif
637 }
638 }
639 else if (corrOffset == COBOFS_PBIAS) {
640 if (!pb)
641 return GCOBR_NOPHASEBIASPARAMETER;
642 pb->messageType = igstype;
643 G_SSR_EPOCH_TIME_CHECK(pb->EpochTime[s], pb->NumberOfSat[s])
644 G_SSR_UPDATE_INTERVAL(pb->UpdateInterval)
645 G_MULTIPLE_MESSAGE_INDICATOR(mmi)
646 G_SSR_IOD(pb->SSRIOD)
647 G_SSR_PROVIDER_ID(pb->SSRProviderID)
648 G_SSR_SOLUTION_ID(pb->SSRSolutionID)
649 G_DISPERSIVE_BIAS_INDICATOR(pb->DispersiveBiasConsistencyIndicator)
650 G_MW_CONSISTENCY_INDICATOR(pb->MWConsistencyIndicator)
651 G_NO_OF_SATELLITES(nums)
652#ifdef BNC_DEBUG_SSR
653 fprintf(stderr, "epochTime %d ui %d mmi %d sats %d/%d ssrIod %d providerId %d solId %d dispInd %d mwInd %d\n",
654 pb->EpochTime[s], pb->UpdateInterval,mmi,pb->NumberOfSat[s],nums,
655 pb->SSRIOD, pb->SSRProviderID, pb->SSRSolutionID,
656 pb->DispersiveBiasConsistencyIndicator, pb->MWConsistencyIndicator);
657#endif
658 for (i = 0; i < nums; ++i) {
659 G_GNSS_SATELLITE_ID(id)
660 for (pos = satoffset[s];
661 pos < satoffset[s] + pb->NumberOfSat[s] && pb->Sat[pos].ID != id;
662 ++pos)
663 ;
664 if (pos >= satoffset[s + 1])
665 return GCOBR_DATAMISMATCH;
666 else if (pos == pb->NumberOfSat[s] + satoffset[s])
667 ++pb->NumberOfSat[s];
668 pb->Sat[pos].ID = id;
669 G_NO_OF_BIASES(pb->Sat[pos].NumberOfPhaseBiases)
670 G_YAW_ANGLE(pb->Sat[pos].YawAngle)
671 G_YAW_RATE(pb->Sat[pos].YawRate)
672#ifdef BNC_DEBUG_SSR
673 fprintf(stderr, "id %2d #%d y %10.6f yr %10.6f ",
674 pb->Sat[pos].ID, pb->Sat[pos].NumberOfPhaseBiases,
675 pb->Sat[pos].YawAngle/MPI, pb->Sat[pos].YawRate/MPI);
676#endif
677 for (j = 0; j < pb->Sat[pos].NumberOfPhaseBiases; ++j) {
678 G_GNSS_SIGNAL_IDENTIFIER(pb->Sat[pos].Biases[j].Type)
679 G_INTEGER_INDICATOR(pb->Sat[pos].Biases[j].SignalIntegerIndicator)
680 G_WIDE_LANE_INDICATOR(pb->Sat[pos].Biases[j].SignalsWideLaneIntegerIndicator)
681 G_DISCONTINUITY_COUNTER(pb->Sat[pos].Biases[j].SignalDiscontinuityCounter)
682 G_PHASE_BIAS(pb->Sat[pos].Biases[j].Bias)
683#ifdef BNC_DEBUG_SSR
684 fprintf(stderr, "t%02d int %d wl %d disc %02d b %8.4f ",
685 pb->Sat[pos].Biases[j].Type,
686 pb->Sat[pos].Biases[j].SignalIntegerIndicator,
687 pb->Sat[pos].Biases[j].SignalsWideLaneIntegerIndicator,
688 pb->Sat[pos].Biases[j].SignalDiscontinuityCounter,
689 pb->Sat[pos].Biases[j].Bias);
690#endif
691 }
692#ifdef BNC_DEBUG_SSR
693 fprintf(stderr, "\n");
694#endif
695 }
696 }
697 else {
698 continue;
699 }
700#ifdef BNC_DEBUG_SSR
701 for(igstype = 0; igstype < (unsigned int)size && (unsigned char)buffer[igstype] != 0xD3; ++igstype)
702 numbits += 8;
703 fprintf(stderr, "numbits left %d\n",numbits);
704#endif
705 return mmi ? GCOBR_MESSAGEFOLLOWS : GCOBR_OK;
706 }
707 }
708 return GCOBR_UNKNOWNTYPE;
709}
710
711//
712////////////////////////////////////////////////////////////////////////////
713std::string SsrCorrIgs::codeTypeToRnxType(char system, CodeType type) {
714 if (system == 'G') {
715 if (type == CODETYPE_GPS_L1_CA) return "1C";
716 if (type == CODETYPE_GPS_L1_P) return "1P";
717 if (type == CODETYPE_GPS_L1_Z) return "1W";
718
719 if (type == CODETYPE_GPS_SEMI_CODELESS) return "2D";
720 if (type == CODETYPE_GPS_L2_CA) return "2C";
721 if (type == CODETYPE_GPS_L2_P) return "2P";
722 if (type == CODETYPE_GPS_L2_Z) return "2W";
723 if (type == CODETYPE_GPS_L2C_M) return "2S";
724 if (type == CODETYPE_GPS_L2C_L) return "2L";
725
726 if (type == CODETYPE_GPS_L5_I) return "5I";
727 if (type == CODETYPE_GPS_L5_Q) return "5Q";
728
729 if (type == CODETYPE_GPS_L1C_D) return "1S";
730 if (type == CODETYPE_GPS_L1C_P) return "1L";
731 }
732 else if (system == 'R') {
733 if (type == CODETYPE_GLONASS_L1_CA) return "1C";
734 if (type == CODETYPE_GLONASS_L1_P) return "1P";
735
736 if (type == CODETYPE_GLONASS_L2_CA) return "2C";
737 if (type == CODETYPE_GLONASS_L2_P) return "2P";
738
739 if (type == CODETYPE_GLONASS_L1a_OCd) return "4A";
740 if (type == CODETYPE_GLONASS_L1a_OCp) return "4B";
741
742 if (type == CODETYPE_GLONASS_L2a_CSI) return "6A";
743 if (type == CODETYPE_GLONASS_L2a_OCp) return "6B";
744
745 if (type == CODETYPE_GLONASS_L3_I) return "3I";
746 if (type == CODETYPE_GLONASS_L3_Q) return "3Q";
747 }
748 else if (system == 'E') {
749 if (type == CODETYPE_GALILEO_E1_A) return "1A";
750 if (type == CODETYPE_GALILEO_E1_B) return "1B";
751 if (type == CODETYPE_GALILEO_E1_C) return "1C";
752
753 if (type == CODETYPE_GALILEO_E5A_I) return "5I";
754 if (type == CODETYPE_GALILEO_E5A_Q) return "5Q";
755
756 if (type == CODETYPE_GALILEO_E5B_I) return "7I";
757 if (type == CODETYPE_GALILEO_E5B_Q) return "7Q";
758
759 if (type == CODETYPE_GALILEO_E6_A) return "6A";
760 if (type == CODETYPE_GALILEO_E6_B) return "6B";
761 if (type == CODETYPE_GALILEO_E6_C) return "6C";
762 }
763 else if (system == 'J') {
764 if (type == CODETYPE_QZSS_L1_CA) return "1C";
765 if (type == CODETYPE_QZSS_L1C_D) return "1S";
766 if (type == CODETYPE_QZSS_L1C_P) return "1L";
767
768 if (type == CODETYPE_QZSS_L2C_M) return "2S";
769 if (type == CODETYPE_QZSS_L2C_L) return "2L";
770
771 if (type == CODETYPE_QZSS_L5_I) return "5I";
772 if (type == CODETYPE_QZSS_L5_Q) return "5Q";
773
774 if (type == CODETYPE_QZSS_L6_D) return "6S";
775 if (type == CODETYPE_QZSS_L6_P) return "6L";
776 if (type == CODETYPE_QZSS_L6_E) return "6E";
777 }
778 else if (system == 'C') {
779 if (type == CODETYPE_BDS_B1_I) return "2I";
780 if (type == CODETYPE_BDS_B1_Q) return "2Q";
781
782 if (type == CODETYPE_BDS_B3_I) return "6I";
783 if (type == CODETYPE_BDS_B3_Q) return "6Q";
784 if (type == CODETYPE_BDS_B3_A) return "6A";
785
786 if (type == CODETYPE_BDS_B2_I) return "7I";
787 if (type == CODETYPE_BDS_B2_Q) return "7Q";
788
789 if (type == CODETYPE_BDS_B1a_D) return "1D";
790 if (type == CODETYPE_BDS_B1a_P) return "1P";
791
792 if (type == CODETYPE_BDS_B2a_D) return "5D";
793 if (type == CODETYPE_BDS_B2a_P) return "5P";
794
795 if (type == CODETYPE_BDS_B1_A) return "1A";
796 }
797 else if (system == 'S') {
798 if (type == CODETYPE_SBAS_L1_CA) return "1C";
799
800 if (type == CODETYPE_SBAS_L5_I) return "5I";
801 if (type == CODETYPE_SBAS_L5_Q) return "5Q";
802 }
803 return "";
804}
805
806SsrCorr::CodeType SsrCorrIgs::rnxTypeToCodeType(char system, std::string type) {
807 if (system == 'G') {
808 if (type.compare("1C") == 0) {return CODETYPE_GPS_L1_CA;}
809 if (type.compare("1P") == 0) {return CODETYPE_GPS_L1_P;}
810 if (type.compare("1W") == 0) {return CODETYPE_GPS_L1_Z;}
811
812 if (type.compare("2D") == 0) {return CODETYPE_GPS_SEMI_CODELESS;}
813 if (type.compare("2C") == 0) {return CODETYPE_GPS_L2_CA;}
814 if (type.compare("2P") == 0) {return CODETYPE_GPS_L2_P;}
815 if (type.compare("2W") == 0) {return CODETYPE_GPS_L2_Z;}
816 if (type.compare("2S") == 0) {return CODETYPE_GPS_L2C_M;}
817 if (type.compare("2L") == 0) {return CODETYPE_GPS_L2C_L;}
818
819 if (type.compare("5I") == 0) {return CODETYPE_GPS_L5_I;}
820 if (type.compare("5Q") == 0) {return CODETYPE_GPS_L5_Q;}
821
822 if (type.compare("1S") == 0) {return CODETYPE_GPS_L1C_D;}
823 if (type.compare("1L") == 0) {return CODETYPE_GPS_L1C_P;}
824 }
825 else if (system == 'R') {
826 if (type.compare("1C") == 0) {return CODETYPE_GLONASS_L1_CA;}
827 if (type.compare("1P") == 0) {return CODETYPE_GLONASS_L1_P;}
828
829 if (type.compare("2C") == 0) {return CODETYPE_GLONASS_L2_CA;}
830 if (type.compare("2P") == 0) {return CODETYPE_GLONASS_L2_P;}
831
832 if (type.compare("4A") == 0) {return CODETYPE_GLONASS_L1a_OCd;}
833 if (type.compare("4B") == 0) {return CODETYPE_GLONASS_L1a_OCp;}
834
835 if (type.compare("6A") == 0) {return CODETYPE_GLONASS_L2a_CSI;}
836 if (type.compare("6B") == 0) {return CODETYPE_GLONASS_L2a_OCp;}
837
838 if (type.compare("3I") == 0) {return CODETYPE_GLONASS_L3_I;}
839 if (type.compare("3Q") == 0) {return CODETYPE_GLONASS_L3_Q;}
840 }
841 else if (system == 'E') {
842 if (type.compare("1A") == 0) {return CODETYPE_GALILEO_E1_A;}
843 if (type.compare("1B") == 0) {return CODETYPE_GALILEO_E1_B;}
844 if (type.compare("1C") == 0) {return CODETYPE_GALILEO_E1_C;}
845
846 if (type.compare("5I") == 0) {return CODETYPE_GALILEO_E5A_I;}
847 if (type.compare("5Q") == 0) {return CODETYPE_GALILEO_E5A_Q;}
848
849 if (type.compare("7I") == 0) {return CODETYPE_GALILEO_E5B_I;}
850 if (type.compare("7Q") == 0) {return CODETYPE_GALILEO_E5B_Q;}
851
852 if (type.compare("6A") == 0) {return CODETYPE_GALILEO_E6_A;}
853 if (type.compare("6B") == 0) {return CODETYPE_GALILEO_E6_B;}
854 if (type.compare("6C") == 0) {return CODETYPE_GALILEO_E6_C;}
855 }
856 else if (system == 'J') {
857 if (type.compare("1C") == 0) {return CODETYPE_QZSS_L1_CA;}
858 if (type.compare("1S") == 0) {return CODETYPE_QZSS_L1C_D;}
859 if (type.compare("1L") == 0) {return CODETYPE_QZSS_L1C_P;}
860
861 if (type.compare("2S") == 0) {return CODETYPE_QZSS_L2C_M;}
862 if (type.compare("2L") == 0) {return CODETYPE_QZSS_L2C_L;}
863
864 if (type.compare("5I") == 0) {return CODETYPE_QZSS_L5_I;}
865 if (type.compare("5Q") == 0) {return CODETYPE_QZSS_L5_Q;}
866
867 if (type.compare("6S") == 0) {return CODETYPE_QZSS_L6_D;}
868 if (type.compare("6L") == 0) {return CODETYPE_QZSS_L6_P;}
869 if (type.compare("6E") == 0) {return CODETYPE_QZSS_L6_E;}
870 }
871 else if (system == 'C') {
872 if (type.compare("2I") == 0) {return CODETYPE_BDS_B1_I;}
873 if (type.compare("2Q") == 0) {return CODETYPE_BDS_B1_Q;}
874
875 if (type.compare("6I") == 0) {return CODETYPE_BDS_B3_I;}
876 if (type.compare("6Q") == 0) {return CODETYPE_BDS_B3_Q;}
877 if (type.compare("6A") == 0) {return CODETYPE_BDS_B3_A;}
878
879 if (type.compare("7I") == 0) {return CODETYPE_BDS_B2_I;}
880 if (type.compare("7Q") == 0) {return CODETYPE_BDS_B2_Q;}
881
882 if (type.compare("1D") == 0) {return CODETYPE_BDS_B1a_D;}
883 if (type.compare("1P") == 0) {return CODETYPE_BDS_B1a_P;}
884
885 if (type.compare("5D") == 0) {return CODETYPE_BDS_B2a_D;}
886 if (type.compare("5P") == 0) {return CODETYPE_BDS_B2a_P;}
887
888 if (type.compare("1A") == 0) {return CODETYPE_BDS_B1_A;}
889 }
890 else if (system == 'S') {
891 if (type.compare("1C") == 0) {return CODETYPE_SBAS_L1_CA;}
892
893 if (type.compare("5I") == 0) {return CODETYPE_SBAS_L5_I;}
894 if (type.compare("5Q") == 0) {return CODETYPE_SBAS_L5_Q;}
895 }
896 return RESERVED;
897}
898
Note: See TracBrowser for help on using the repository browser.