source: ntrip/trunk/BNC/src/upload/bncrtnetuploadcaster.cpp@ 6860

Last change on this file since 6860 was 6860, checked in by stuerze, 9 years ago

extension of the rtnetuploadcaster interface regarding RTCM SSR II VTEC messages

File size: 81.2 KB
Line 
1/* -------------------------------------------------------------------------
2 * BKG NTRIP Server
3 * -------------------------------------------------------------------------
4 *
5 * Class: bncRtnetUploadCaster
6 *
7 * Purpose: Connection to NTRIP Caster
8 *
9 * Author: L. Mervart
10 *
11 * Created: 29-Mar-2011
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
17#include <math.h>
18#include "bncrtnetuploadcaster.h"
19#include "bncsettings.h"
20#include "bncephuser.h"
21#include "bncclockrinex.h"
22#include "bncsp3.h"
23#include "gnss.h"
24
25using namespace std;
26
27// Constructor
28////////////////////////////////////////////////////////////////////////////
29bncRtnetUploadCaster::bncRtnetUploadCaster(const QString& mountpoint,
30 const QString& outHost, int outPort,
31 const QString& password,
32 const QString& crdTrafo, bool CoM,
33 const QString& sp3FileName,
34 const QString& rnxFileName,
35 int PID, int SID, int IOD, int iRow) :
36 bncUploadCaster(mountpoint, outHost, outPort, password, iRow, 0) {
37
38 if (!outHost.isEmpty()) {
39 _casterID += outHost;
40 }
41 if (!crdTrafo.isEmpty()) {
42 _casterID += " " + crdTrafo;
43 }
44 if (!sp3FileName.isEmpty()) {
45 _casterID += " " + sp3FileName;
46 }
47 if (!rnxFileName.isEmpty()) {
48 _casterID += " " + rnxFileName;
49 }
50
51 _crdTrafo = crdTrafo;
52 _CoM = CoM;
53 _PID = PID;
54 _SID = SID;
55 _IOD = IOD;
56
57 // Member that receives the ephemeris
58 // ----------------------------------
59 _ephUser = new bncEphUser(true);
60
61 bncSettings settings;
62 QString intr = settings.value("uploadIntr").toString();
63 QStringList hlp = settings.value("combineStreams").toStringList();
64 _samplRtcmEphCorr = settings.value("uploadSamplRtcmEphCorr").toDouble();
65 if (hlp.size() > 1) { // combination stream upload
66 _samplRtcmClkCorr = settings.value("cmbSampl").toInt();
67 } else { // single stream upload or sp3 file generation
68 _samplRtcmClkCorr = 5; // default
69 }
70 int samplClkRnx = settings.value("uploadSamplClkRnx").toInt();
71 int samplSp3 = settings.value("uploadSamplSp3").toInt() * 60;
72
73 if (_samplRtcmEphCorr == 0.0) {
74 _usedEph = 0;
75 }
76 else {
77 _usedEph = new QMap<QString, const t_eph*>;
78 }
79
80 // RINEX writer
81 // ------------
82 if (!rnxFileName.isEmpty()) {
83 _rnx = new bncClockRinex(rnxFileName, intr, samplClkRnx);
84 }
85 else {
86 _rnx = 0;
87 }
88
89 // SP3 writer
90 // ----------
91 if (!sp3FileName.isEmpty()) {
92 _sp3 = new bncSP3(sp3FileName, intr, samplSp3);
93 }
94 else {
95 _sp3 = 0;
96 }
97
98 // Set Transformation Parameters
99 // -----------------------------
100 if (_crdTrafo == "ETRF2000") {
101 _dx = 0.0521;
102 _dy = 0.0493;
103 _dz = -0.0585;
104 _dxr = 0.0001;
105 _dyr = 0.0001;
106 _dzr = -0.0018;
107 _ox = 0.000891;
108 _oy = 0.005390;
109 _oz = -0.008712;
110 _oxr = 0.000081;
111 _oyr = 0.000490;
112 _ozr = -0.000792;
113 _sc = 1.34;
114 _scr = 0.08;
115 _t0 = 2000.0;
116 }
117 else if (_crdTrafo == "NAD83") {
118 _dx = 0.99343;
119 _dy = -1.90331;
120 _dz = -0.52655;
121 _dxr = 0.00079;
122 _dyr = -0.00060;
123 _dzr = -0.00134;
124 _ox = -0.02591467;
125 _oy = -0.00942645;
126 _oz = -0.01159935;
127 _oxr = -0.00006667;
128 _oyr = 0.00075744;
129 _ozr = 0.00005133;
130 _sc = 1.71504;
131 _scr = -0.10201;
132 _t0 = 1997.0;
133 }
134 else if (_crdTrafo == "GDA94") {
135 _dx = -0.08468;
136 _dy = -0.01942;
137 _dz = 0.03201;
138 _dxr = 0.00142;
139 _dyr = 0.00134;
140 _dzr = 0.00090;
141 _ox = 0.0004254;
142 _oy = -0.0022578;
143 _oz = -0.0024015;
144 _oxr = -0.0015461;
145 _oyr = -0.0011820;
146 _ozr = -0.0011551;
147 _sc = 9.710;
148 _scr = 0.109;
149 _t0 = 1994.0;
150 }
151 else if (_crdTrafo == "SIRGAS2000") {
152 _dx = 0.0020;
153 _dy = 0.0041;
154 _dz = 0.0039;
155 _dxr = 0.0000;
156 _dyr = 0.0000;
157 _dzr = 0.0000;
158 _ox = 0.000170;
159 _oy = -0.000030;
160 _oz = 0.000070;
161 _oxr = 0.000000;
162 _oyr = 0.000000;
163 _ozr = 0.000000;
164 _sc = -1.000;
165 _scr = 0.000;
166 _t0 = 0000.0;
167 }
168 else if (_crdTrafo == "SIRGAS95") {
169 _dx = 0.0077;
170 _dy = 0.0058;
171 _dz = -0.0138;
172 _dxr = 0.0000;
173 _dyr = 0.0000;
174 _dzr = 0.0000;
175 _ox = 0.000000;
176 _oy = 0.000000;
177 _oz = -0.000030;
178 _oxr = 0.000000;
179 _oyr = 0.000000;
180 _ozr = 0.000000;
181 _sc = 1.570;
182 _scr = 0.000;
183 _t0 = 0000.0;
184 }
185 else if (_crdTrafo == "DREF91") {
186 _dx = -0.0118;
187 _dy = 0.1432;
188 _dz = -0.1117;
189 _dxr = 0.0001;
190 _dyr = 0.0001;
191 _dzr = -0.0018;
192 _ox = 0.003291;
193 _oy = 0.006190;
194 _oz = -0.011012;
195 _oxr = 0.000081;
196 _oyr = 0.000490;
197 _ozr = -0.000792;
198 _sc = 12.24;
199 _scr = 0.08;
200 _t0 = 2000.0;
201 }
202 else if (_crdTrafo == "Custom") {
203 _dx = settings.value("trafo_dx").toDouble();
204 _dy = settings.value("trafo_dy").toDouble();
205 _dz = settings.value("trafo_dz").toDouble();
206 _dxr = settings.value("trafo_dxr").toDouble();
207 _dyr = settings.value("trafo_dyr").toDouble();
208 _dzr = settings.value("trafo_dzr").toDouble();
209 _ox = settings.value("trafo_ox").toDouble();
210 _oy = settings.value("trafo_oy").toDouble();
211 _oz = settings.value("trafo_oz").toDouble();
212 _oxr = settings.value("trafo_oxr").toDouble();
213 _oyr = settings.value("trafo_oyr").toDouble();
214 _ozr = settings.value("trafo_ozr").toDouble();
215 _sc = settings.value("trafo_sc").toDouble();
216 _scr = settings.value("trafo_scr").toDouble();
217 _t0 = settings.value("trafo_t0").toDouble();
218 }
219}
220
221// Destructor
222////////////////////////////////////////////////////////////////////////////
223bncRtnetUploadCaster::~bncRtnetUploadCaster() {
224 if (isRunning()) {
225 wait();
226 }
227 delete _rnx;
228 delete _sp3;
229 delete _ephUser;
230 delete _usedEph;
231}
232
233//
234////////////////////////////////////////////////////////////////////////////
235void bncRtnetUploadCaster::decodeRtnetStream(char* buffer, int bufLen) {
236
237 QMutexLocker locker(&_mutex);
238
239 // Append to internal buffer
240 // -------------------------
241 _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
242
243 // Select buffer part that contains last epoch
244 // -------------------------------------------
245 QStringList lines;
246 int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch
247 if (iEpoBeg == -1) {
248 _rtnetStreamBuffer.clear();
249 return;
250 }
251 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
252
253 int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
254 if (iEpoEnd == -1) {
255 return;
256 }
257 else {
258 lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
259 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
260 }
261
262 if (lines.size() < 2) {
263 return;
264 }
265
266 // Keep the last unfinished line in buffer
267 // ---------------------------------------
268 int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');
269 if (iLastEOL != -1) {
270 _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);
271 }
272
273 // Read first line (with epoch time)
274 // ---------------------------------
275 QTextStream in(lines[0].toAscii());
276 QString hlp;
277 int year, month, day, hour, min;
278 double sec;
279 in >> hlp >> year >> month >> day >> hour >> min >> sec;
280 bncTime epoTime; epoTime.set( year, month, day, hour, min, sec);
281
282 emit(newMessage("bncRtnetUploadCaster: decode " +
283 QByteArray(epoTime.datestr().c_str()) + " " +
284 QByteArray(epoTime.timestr().c_str()) + " " +
285 _casterID.toAscii(), false));
286
287 struct ClockOrbit co;
288 memset(&co, 0, sizeof(co));
289 co.EpochTime[CLOCKORBIT_SATGPS] = static_cast<int>(epoTime.gpssec());
290 double gt = epoTime.gpssec() + 3 * 3600 - gnumleap(year, month, day);
291 co.EpochTime[CLOCKORBIT_SATGLONASS] = static_cast<int>(fmod(gt, 86400.0));
292 co.EpochTime[CLOCKORBIT_SATGALILEO] = static_cast<int>(epoTime.gpssec());
293 co.EpochTime[CLOCKORBIT_SATQZSS] = static_cast<int>(epoTime.gpssec());
294 co.EpochTime[CLOCKORBIT_SATSBAS] = static_cast<int>(epoTime.gpssec());
295 co.EpochTime[CLOCKORBIT_SATBDS] = static_cast<int>(epoTime.bdssec());
296 co.Supplied[COBOFS_CLOCK] = 1;
297 co.Supplied[COBOFS_ORBIT] = 1;
298 co.SatRefDatum = DATUM_ITRF;
299 co.SSRIOD = _IOD;
300 co.SSRProviderID = _PID; // 256 .. BKG, 257 ... EUREF
301 co.SSRSolutionID = _SID;
302
303 struct CodeBias bias;
304 memset(&bias, 0, sizeof(bias));
305 bias.EpochTime[CLOCKORBIT_SATGPS] = co.EpochTime[CLOCKORBIT_SATGPS];
306 bias.EpochTime[CLOCKORBIT_SATGLONASS] = co.EpochTime[CLOCKORBIT_SATGLONASS];
307 bias.EpochTime[CLOCKORBIT_SATGALILEO] = co.EpochTime[CLOCKORBIT_SATGALILEO];
308 bias.EpochTime[CLOCKORBIT_SATQZSS] = co.EpochTime[CLOCKORBIT_SATQZSS];
309 bias.EpochTime[CLOCKORBIT_SATSBAS] = co.EpochTime[CLOCKORBIT_SATSBAS];
310 bias.EpochTime[CLOCKORBIT_SATBDS] = co.EpochTime[CLOCKORBIT_SATBDS];
311 bias.SSRIOD = _IOD;
312 bias.SSRProviderID = _PID;
313 bias.SSRSolutionID = _SID;
314
315 struct PhaseBias phasebias;
316 memset(&phasebias, 0, sizeof(phasebias));
317 unsigned int dispInd = 0;
318 unsigned int mwInd = 0;
319 phasebias.EpochTime[CLOCKORBIT_SATGPS] = co.EpochTime[CLOCKORBIT_SATGPS];
320 phasebias.EpochTime[CLOCKORBIT_SATGLONASS] = co.EpochTime[CLOCKORBIT_SATGLONASS];
321 phasebias.EpochTime[CLOCKORBIT_SATGALILEO] = co.EpochTime[CLOCKORBIT_SATGALILEO];
322 phasebias.EpochTime[CLOCKORBIT_SATQZSS] = co.EpochTime[CLOCKORBIT_SATQZSS];
323 phasebias.EpochTime[CLOCKORBIT_SATSBAS] = co.EpochTime[CLOCKORBIT_SATSBAS];
324 phasebias.EpochTime[CLOCKORBIT_SATBDS] = co.EpochTime[CLOCKORBIT_SATBDS];
325 phasebias.SSRIOD = _IOD;
326 phasebias.SSRProviderID = _PID;
327 phasebias.SSRSolutionID = _SID;
328
329 struct VTEC vtec;
330 memset(&vtec, 0, sizeof(vtec));
331 vtec.EpochTime = static_cast<int>(epoTime.gpssec());
332 vtec.SSRIOD = _IOD;
333 vtec.SSRProviderID = _PID;
334 vtec.SSRSolutionID = _SID;
335
336
337 // Default Update Interval
338 // -----------------------
339 int clkUpdInd = 2; // 5 sec
340 int ephUpdInd = clkUpdInd; // default
341
342 if (_samplRtcmClkCorr > 5.0 && _samplRtcmEphCorr <= 5.0) { // combined orb and clock
343 ephUpdInd = determineUpdateInd(_samplRtcmClkCorr);
344 }
345 if (_samplRtcmClkCorr > 5.0) {
346 clkUpdInd = determineUpdateInd(_samplRtcmClkCorr);
347 }
348 if (_samplRtcmEphCorr > 5.0) {
349 ephUpdInd = determineUpdateInd(_samplRtcmEphCorr);
350 }
351
352 co.UpdateInterval = clkUpdInd;
353 bias.UpdateInterval = clkUpdInd;
354 phasebias.UpdateInterval = clkUpdInd;
355
356 for (int ii = 1; ii < lines.size(); ii++) {
357
358 QString prn; // prn or key VTEC, IND (phase bias indicators)
359 ColumnVector rtnAPC;
360 ColumnVector rtnVel;
361 ColumnVector rtnCoM;
362 double rtnClk;
363
364 QTextStream in(lines[ii].toAscii());
365
366 in >> prn;
367
368 // non-satellite specific parameters
369 if (prn.contains("IND", Qt::CaseSensitive)) {
370 in >> dispInd >> mwInd;
371 continue;
372 }
373 if (prn.contains("VTEC", Qt::CaseSensitive)) {
374 in >> vtec.UpdateInterval >> vtec.NumLayers;
375 for (unsigned ll = 0; ll < vtec.NumLayers; ll++) {
376 int dummy;
377 in >> dummy >> vtec.Layers[ll].Degree >> vtec.Layers[ll].Order
378 >> vtec.Layers[ll].Height;
379 ii++;
380 for (unsigned iDeg = 0; iDeg < vtec.Layers[ll].Degree; iDeg++) {
381 for (unsigned iOrd = 0; iOrd < vtec.Layers[ll].Order; iOrd++) {
382 in >> vtec.Layers[ll].Cosinus[iDeg][iOrd];
383 }
384 ii++;
385 }
386 for (unsigned iDeg = 0; iDeg < vtec.Layers[ll].Degree; iDeg++) {
387 for (unsigned iOrd = 0; iOrd < vtec.Layers[ll].Order; iOrd++) {
388 in >> vtec.Layers[ll].Sinus[iDeg][iOrd];
389 }
390 ii++;
391 }
392 }
393 continue;
394 }
395
396 const t_eph* ephLast = _ephUser->ephLast(prn);
397 const t_eph* ephPrev = _ephUser->ephPrev(prn);
398 const t_eph* eph = ephLast;
399
400 if (eph) {
401
402 // Use previous ephemeris if the last one is too recent
403 // ----------------------------------------------------
404 const int MINAGE = 60; // seconds
405 if (ephPrev && eph->receptDateTime().isValid() &&
406 eph->receptDateTime().secsTo(currentDateAndTimeGPS()) < MINAGE) {
407 eph = ephPrev;
408 }
409
410 // Make sure the clock messages refer to same IOD as orbit messages
411 // ----------------------------------------------------------------
412 if (_usedEph) {
413 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
414 (*_usedEph)[prn] = eph;
415 }
416 else {
417 eph = 0;
418 if (_usedEph->contains(prn)) {
419 const t_eph* usedEph = _usedEph->value(prn);
420 if (usedEph == ephLast) {
421 eph = ephLast;
422 }
423 else if (usedEph == ephPrev) {
424 eph = ephPrev;
425 }
426 }
427 }
428 }
429 }
430
431 if (eph) {
432
433 QMap<QString, double> codeBiases;
434 QList<phaseBiasSignal> phaseBiasList;
435 phaseBiasesSat pbSat;
436
437 while (true) {
438 QString key;
439 int numVal = 0;
440 in >> key;
441 if (in.status() != QTextStream::Ok) {
442 break;
443 }
444 if (key == "APC") {
445 in >> numVal;
446 rtnAPC.ReSize(3);
447 for (int ii = 0; ii < numVal; ii++) {
448 in >> rtnAPC[ii];
449 }
450 }
451 else if (key == "Clk") {
452 in >> numVal;
453 if (numVal ==1)
454 in >> rtnClk;
455 }
456 else if (key == "Vel") {
457 rtnVel.ReSize(3);
458 in >> numVal;
459 for (int ii = 0; ii < numVal; ii++) {
460 in >> rtnVel[ii];
461 }
462 }
463 else if (key == "CoM") {
464 rtnCoM.ReSize(3);
465 in >> numVal;
466 for (int ii = 0; ii < numVal; ii++) {
467 in >> rtnCoM[ii];
468 }
469 }
470 else if (key == "CodeBias") {
471 in >> numVal;
472 for (int ii = 0; ii < numVal; ii++) {
473 QString type;
474 double value;
475 in >> type >> value;
476 codeBiases[type] = value;
477 }
478 }
479 else if (key == "YawAngle") {
480 in >> numVal >> pbSat.yA;
481 }
482 else if (key == "YawRate") {
483 in >> numVal >> pbSat.yR;
484 }
485 else if (key == "PhaseBias") {
486 in >> numVal;
487 for (int ii = 0; ii < numVal; ii++) {
488 phaseBiasSignal pb;
489 in >> pb.type >> pb.bias >> pb.intInd >> pb.wlInd
490 >> pb.discCount;
491 phaseBiasList.append(pb);
492 }
493 }
494 else {
495 for (int ii = 0; ii < numVal; ii++) {
496 double dummy;
497 in >> dummy;
498 }
499 }
500 }
501
502 struct ClockOrbit::SatData* sd = 0;
503 if (prn[0] == 'G') {
504 sd = co.Sat + co.NumberOfSat[CLOCKORBIT_SATGPS];
505 ++co.NumberOfSat[CLOCKORBIT_SATGPS];
506 }
507 else if (prn[0] == 'R') {
508 sd = co.Sat + CLOCKORBIT_NUMGPS
509 + co.NumberOfSat[CLOCKORBIT_SATGLONASS];
510 ++co.NumberOfSat[CLOCKORBIT_SATGLONASS];
511 }
512 else if (prn[0] == 'E') {
513 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
514 + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
515 ++co.NumberOfSat[CLOCKORBIT_SATGALILEO];
516 }
517 else if (prn[0] == 'J') {
518 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
519 + co.NumberOfSat[CLOCKORBIT_SATQZSS];
520 ++co.NumberOfSat[CLOCKORBIT_SATQZSS];
521 }
522 else if (prn[0] == 'S') {
523 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
524 + CLOCKORBIT_NUMQZSS
525 + co.NumberOfSat[CLOCKORBIT_SATSBAS];
526 ++co.NumberOfSat[CLOCKORBIT_SATSBAS];
527 }
528 else if (prn[0] == 'C') {
529 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
530 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
531 + co.NumberOfSat[CLOCKORBIT_SATBDS];
532 ++co.NumberOfSat[CLOCKORBIT_SATBDS];
533 }
534 if (sd) {
535 QString outLine;
536 processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prn,
537 rtnAPC, rtnClk, rtnVel, rtnCoM, sd, outLine);
538 }
539
540 // Code Biases
541 // -----------
542 struct CodeBias::BiasSat* biasSat = 0;
543 if (prn[0] == 'G') {
544 biasSat = bias.Sat + bias.NumberOfSat[CLOCKORBIT_SATGPS];
545 ++bias.NumberOfSat[CLOCKORBIT_SATGPS];
546 }
547 else if (prn[0] == 'R') {
548 biasSat = bias.Sat + CLOCKORBIT_NUMGPS
549 + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
550 ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
551 }
552 else if (prn[0] == 'E') {
553 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
554 + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
555 ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
556 }
557 else if (prn[0] == 'J') {
558 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
559 + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
560 ++bias.NumberOfSat[CLOCKORBIT_SATQZSS];
561 }
562 else if (prn[0] == 'S') {
563 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
564 + CLOCKORBIT_NUMQZSS
565 + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
566 ++bias.NumberOfSat[CLOCKORBIT_SATSBAS];
567 }
568 else if (prn[0] == 'C') {
569 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
570 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
571 + bias.NumberOfSat[CLOCKORBIT_SATBDS];
572 ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
573 }
574
575 if (biasSat) {
576 biasSat->ID = prn.mid(1).toInt();
577 biasSat->NumberOfCodeBiases = 0;
578 if (prn[0] == 'G') {
579 QMapIterator<QString, double> it(codeBiases);
580 while (it.hasNext()) {
581 it.next();
582 if (it.key() == "1C") {
583 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
584 biasSat->NumberOfCodeBiases += 1;
585 biasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
586 biasSat->Biases[ii].Bias = it.value();
587 }
588 else if (it.key() == "1P") {
589 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
590 biasSat->NumberOfCodeBiases += 1;
591 biasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
592 biasSat->Biases[ii].Bias = it.value();
593 }
594 else if (it.key() == "1W") {
595 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
596 biasSat->NumberOfCodeBiases += 1;
597 biasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
598 biasSat->Biases[ii].Bias = it.value();
599 }
600 else if (it.key() == "2C") {
601 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
602 biasSat->NumberOfCodeBiases += 1;
603 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
604 biasSat->Biases[ii].Bias = it.value();
605 }
606 else if (it.key() == "2D") {
607 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
608 biasSat->NumberOfCodeBiases += 1;
609 biasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
610 biasSat->Biases[ii].Bias = it.value();
611 }
612 else if (it.key() == "2S") {
613 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
614 biasSat->NumberOfCodeBiases += 1;
615 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
616 biasSat->Biases[ii].Bias = it.value();
617 }
618 else if (it.key() == "2L") {
619 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
620 biasSat->NumberOfCodeBiases += 1;
621 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
622 biasSat->Biases[ii].Bias = it.value();
623 }
624 else if (it.key() == "2X") {
625 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
626 biasSat->NumberOfCodeBiases += 1;
627 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
628 biasSat->Biases[ii].Bias = it.value();
629 }
630 else if (it.key() == "2P") {
631 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
632 biasSat->NumberOfCodeBiases += 1;
633 biasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
634 biasSat->Biases[ii].Bias = it.value();
635 }
636 else if (it.key() == "2W") {
637 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
638 biasSat->NumberOfCodeBiases += 1;
639 biasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
640 biasSat->Biases[ii].Bias = it.value();
641 }
642 else if (it.key() == "5I") {
643 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
644 biasSat->NumberOfCodeBiases += 1;
645 biasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
646 biasSat->Biases[ii].Bias = it.value();
647 }
648 else if (it.key() == "5Q") {
649 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
650 biasSat->NumberOfCodeBiases += 1;
651 biasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
652 biasSat->Biases[ii].Bias = it.value();
653 }
654 else if (it.key() == "5X") {
655 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
656 biasSat->NumberOfCodeBiases += 1;
657 biasSat->Biases[ii].Type = CODETYPEGPS_L5_IQ;
658 biasSat->Biases[ii].Bias = it.value();
659 }
660 }
661 }
662 else if (prn[0] == 'R') {
663 QMapIterator<QString, double> it(codeBiases);
664 while (it.hasNext()) {
665 it.next();
666 if (it.key() == "1C") {
667 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
668 biasSat->NumberOfCodeBiases += 1;
669 biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
670 biasSat->Biases[ii].Bias = it.value();
671 }
672 else if (it.key() == "1P") {
673 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
674 biasSat->NumberOfCodeBiases += 1;
675 biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
676 biasSat->Biases[ii].Bias = it.value();
677 }
678 else if (it.key() == "2C") {
679 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
680 biasSat->NumberOfCodeBiases += 1;
681 biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
682 biasSat->Biases[ii].Bias = it.value();
683 }
684 else if (it.key() == "2P") {
685 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
686 biasSat->NumberOfCodeBiases += 1;
687 biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
688 biasSat->Biases[ii].Bias = it.value();
689 }
690 }
691 }
692 else if (prn[0] == 'E') {
693 QMapIterator<QString, double> it(codeBiases);
694 while (it.hasNext()) {
695 it.next();
696 if (it.key() == "1A") {
697 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
698 biasSat->NumberOfCodeBiases += 1;
699 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_A;
700 biasSat->Biases[ii].Bias = it.value();
701 }
702 else if (it.key() == "1B") {
703 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
704 biasSat->NumberOfCodeBiases += 1;
705 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_B;
706 biasSat->Biases[ii].Bias = it.value();
707 }
708 else if (it.key() == "1C") {
709 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
710 biasSat->NumberOfCodeBiases += 1;
711 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_C;
712 biasSat->Biases[ii].Bias = it.value();
713 }
714 else if (it.key() == "5I") {
715 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
716 biasSat->NumberOfCodeBiases += 1;
717 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_I;
718 biasSat->Biases[ii].Bias = it.value();
719 }
720 else if (it.key() == "5Q") {
721 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
722 biasSat->NumberOfCodeBiases += 1;
723 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_Q;
724 biasSat->Biases[ii].Bias = it.value();
725 }
726 else if (it.key() == "7I") {
727 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
728 biasSat->NumberOfCodeBiases += 1;
729 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_I;
730 biasSat->Biases[ii].Bias = it.value();
731 }
732 else if (it.key() == "7Q") {
733 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
734 biasSat->NumberOfCodeBiases += 1;
735 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_Q;
736 biasSat->Biases[ii].Bias = it.value();
737 }
738 else if (it.key() == "8I") {
739 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
740 biasSat->NumberOfCodeBiases += 1;
741 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_I;
742 biasSat->Biases[ii].Bias = it.value();
743 }
744 else if (it.key() == "8Q") {
745 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
746 biasSat->NumberOfCodeBiases += 1;
747 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_Q;
748 biasSat->Biases[ii].Bias = it.value();
749 }
750 else if (it.key() == "6A") {
751 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
752 biasSat->NumberOfCodeBiases += 1;
753 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_A;
754 biasSat->Biases[ii].Bias = it.value();
755 }
756 else if (it.key() == "6B") {
757 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
758 biasSat->NumberOfCodeBiases += 1;
759 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_B;
760 biasSat->Biases[ii].Bias = it.value();
761 }
762 else if (it.key() == "6C") {
763 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
764 biasSat->NumberOfCodeBiases += 1;
765 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_C;
766 biasSat->Biases[ii].Bias = it.value();
767 }
768 }
769 }
770 else if (prn[0] == 'J') {
771 QMapIterator<QString, double> it(codeBiases);
772 while (it.hasNext()) {
773 it.next();
774 if (it.key() == "1C") {
775 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
776 biasSat->NumberOfCodeBiases += 1;
777 biasSat->Biases[ii].Type = CODETYPEQZSS_L1_CA;
778 biasSat->Biases[ii].Bias = it.value();
779 }
780 else if (it.key() == "1S") {
781 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
782 biasSat->NumberOfCodeBiases += 1;
783 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_D;
784 biasSat->Biases[ii].Bias = it.value();
785 }
786 else if (it.key() == "1L") {
787 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
788 biasSat->NumberOfCodeBiases += 1;
789 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_P;
790 biasSat->Biases[ii].Bias = it.value();
791 }
792 else if (it.key() == "1X") {
793 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
794 biasSat->NumberOfCodeBiases += 1;
795 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_DP;
796 biasSat->Biases[ii].Bias = it.value();
797 }
798 else if (it.key() == "2S") {
799 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
800 biasSat->NumberOfCodeBiases += 1;
801 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CM;
802 biasSat->Biases[ii].Bias = it.value();
803 }
804 else if (it.key() == "2L") {
805 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
806 biasSat->NumberOfCodeBiases += 1;
807 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CL;
808 biasSat->Biases[ii].Bias = it.value();
809 }
810 else if (it.key() == "2X") {
811 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
812 biasSat->NumberOfCodeBiases += 1;
813 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CML;
814 biasSat->Biases[ii].Bias = it.value();
815 }
816 else if (it.key() == "5I") {
817 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
818 biasSat->NumberOfCodeBiases += 1;
819 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_I;
820 biasSat->Biases[ii].Bias = it.value();
821 }
822 else if (it.key() == "5Q") {
823 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
824 biasSat->NumberOfCodeBiases += 1;
825 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_Q;
826 biasSat->Biases[ii].Bias = it.value();
827 }
828 else if (it.key() == "5X") {
829 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
830 biasSat->NumberOfCodeBiases += 1;
831 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_IQ;
832 biasSat->Biases[ii].Bias = it.value();
833 }
834 else if (it.key() == "6S") {
835 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
836 biasSat->NumberOfCodeBiases += 1;
837 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_S;
838 biasSat->Biases[ii].Bias = it.value();
839 }
840 else if (it.key() == "6L") {
841 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
842 biasSat->NumberOfCodeBiases += 1;
843 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_L;
844 biasSat->Biases[ii].Bias = it.value();
845 }
846 else if (it.key() == "6X") {
847 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
848 biasSat->NumberOfCodeBiases += 1;
849 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_SL;
850 biasSat->Biases[ii].Bias = it.value();
851 }
852 }
853 }
854 else if (prn[0] == 'S') {
855 QMapIterator<QString, double> it(codeBiases);
856 while (it.hasNext()) {
857 it.next();
858 if (it.key() == "1C") {
859 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
860 biasSat->NumberOfCodeBiases += 1;
861 biasSat->Biases[ii].Type = CODETYPE_SBAS_L1_CA;
862 biasSat->Biases[ii].Bias = it.value();
863 }
864 else if (it.key() == "5I") {
865 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
866 biasSat->NumberOfCodeBiases += 1;
867 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_I;
868 biasSat->Biases[ii].Bias = it.value();
869 }
870 else if (it.key() == "5Q") {
871 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
872 biasSat->NumberOfCodeBiases += 1;
873 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_Q;
874 biasSat->Biases[ii].Bias = it.value();
875 }
876 else if (it.key() == "5X") {
877 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
878 biasSat->NumberOfCodeBiases += 1;
879 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_IQ;
880 biasSat->Biases[ii].Bias = it.value();
881 }
882 }
883 }
884 else if (prn[0] == 'C') {
885 QMapIterator<QString, double> it(codeBiases);
886 while (it.hasNext()) {
887 it.next();
888 if (it.key() == "2I") {
889 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
890 biasSat->NumberOfCodeBiases += 1;
891 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_I;
892 biasSat->Biases[ii].Bias = it.value();
893 }
894 else if (it.key() == "2Q") {
895 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
896 biasSat->NumberOfCodeBiases += 1;
897 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_Q;
898 biasSat->Biases[ii].Bias = it.value();
899 }
900 else if (it.key() == "2X") {
901 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
902 biasSat->NumberOfCodeBiases += 1;
903 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_IQ;
904 biasSat->Biases[ii].Bias = it.value();
905 }
906 else if (it.key() == "6I") {
907 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
908 biasSat->NumberOfCodeBiases += 1;
909 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_I;
910 biasSat->Biases[ii].Bias = it.value();
911 }
912 else if (it.key() == "6Q") {
913 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
914 biasSat->NumberOfCodeBiases += 1;
915 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_Q;
916 biasSat->Biases[ii].Bias = it.value();
917 }
918 else if (it.key() == "6X") {
919 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
920 biasSat->NumberOfCodeBiases += 1;
921 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_IQ;
922 biasSat->Biases[ii].Bias = it.value();
923 }
924 else if (it.key() == "7I") {
925 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
926 biasSat->NumberOfCodeBiases += 1;
927 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_I;
928 biasSat->Biases[ii].Bias = it.value();
929 }
930 else if (it.key() == "7Q") {
931 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
932 biasSat->NumberOfCodeBiases += 1;
933 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_Q;
934 biasSat->Biases[ii].Bias = it.value();
935 }
936 else if (it.key() == "7X") {
937 int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
938 biasSat->NumberOfCodeBiases += 1;
939 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_IQ;
940 biasSat->Biases[ii].Bias = it.value();
941 }
942 }
943 }
944 }
945 // Phase Biases
946 // ------------
947 struct PhaseBias::PhaseBiasSat* phasebiasSat = 0;
948 if (prn[0] == 'G') {
949 phasebiasSat = phasebias.Sat + phasebias.NumberOfSat[CLOCKORBIT_SATGPS];
950 ++phasebias.NumberOfSat[CLOCKORBIT_SATGPS];
951 }
952 else if (prn[0] == 'R') {
953 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
954 + phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS];
955 ++phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS];
956 }
957 else if (prn[0] == 'E') {
958 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
959 + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
960 ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
961 }
962 else if (prn[0] == 'J') {
963 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
964 + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
965 ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
966 }
967 else if (prn[0] == 'S') {
968 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
969 + CLOCKORBIT_NUMQZSS
970 + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
971 ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
972 }
973 else if (prn[0] == 'C') {
974 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
975 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
976 + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
977 ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
978 }
979
980 if (phasebiasSat) {
981 phasebias.DispersiveBiasConsistencyIndicator = dispInd;
982 phasebias.MWConsistencyIndicator = mwInd;
983 phasebiasSat->ID = prn.mid(1).toInt();
984 phasebiasSat->NumberOfPhaseBiases = 0;
985 phasebiasSat->YawAngle = pbSat.yA;
986 phasebiasSat->YawRate = pbSat.yR;
987 if (prn[0] == 'G') {
988 QListIterator<phaseBiasSignal> it(phaseBiasList);
989 while (it.hasNext()) {
990 const phaseBiasSignal &pbSig = it.next();
991 if (pbSig.type == "1C") {
992 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
993 phasebiasSat->NumberOfPhaseBiases += 1;
994 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
995 phasebiasSat->Biases[ii].Bias = pbSig.bias;
996 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
997 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
998 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
999 }
1000 else if (pbSig.type == "1P") {
1001 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1002 phasebiasSat->NumberOfPhaseBiases += 1;
1003 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
1004 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1005 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1006 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1007 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1008 }
1009 else if (pbSig.type == "1W") {
1010 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1011 phasebiasSat->NumberOfPhaseBiases += 1;
1012 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
1013 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1014 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1015 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1016 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1017 }
1018 else if (pbSig.type == "2C") {
1019 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1020 phasebiasSat->NumberOfPhaseBiases += 1;
1021 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
1022 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1023 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1024 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1025 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1026 }
1027 else if (pbSig.type == "2D") {
1028 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1029 phasebiasSat->NumberOfPhaseBiases += 1;
1030 phasebiasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
1031 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1032 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1033 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1034 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1035 }
1036 else if (pbSig.type == "2S") {
1037 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1038 phasebiasSat->NumberOfPhaseBiases += 1;
1039 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
1040 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1041 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1042 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1043 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1044 }
1045 else if (pbSig.type == "2L") {
1046 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1047 phasebiasSat->NumberOfPhaseBiases += 1;
1048 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
1049 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1050 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1051 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1052 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1053 }
1054 else if (pbSig.type == "2X") {
1055 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1056 phasebiasSat->NumberOfPhaseBiases += 1;
1057 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
1058 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1059 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1060 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1061 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1062 }
1063 else if (pbSig.type == "2P") {
1064 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1065 phasebiasSat->NumberOfPhaseBiases += 1;
1066 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
1067 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1068 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1069 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1070 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1071 }
1072 else if (pbSig.type == "2W") {
1073 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1074 phasebiasSat->NumberOfPhaseBiases += 1;
1075 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
1076 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1077 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1078 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1079 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1080 }
1081 else if (pbSig.type == "5I") {
1082 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1083 phasebiasSat->NumberOfPhaseBiases += 1;
1084 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
1085 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1086 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1087 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1088 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1089 }
1090 else if (pbSig.type == "5Q") {
1091 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1092 phasebiasSat->NumberOfPhaseBiases += 1;
1093 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
1094 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1095 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1096 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1097 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1098 }
1099 else if (pbSig.type == "5X") {
1100 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1101 phasebiasSat->NumberOfPhaseBiases += 1;
1102 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_IQ;
1103 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1104 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1105 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1106 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1107 }
1108 }
1109 }
1110 if (prn[0] == 'R') {
1111 QListIterator<phaseBiasSignal> it(phaseBiasList);
1112 while (it.hasNext()) {
1113 const phaseBiasSignal &pbSig = it.next();
1114 if (pbSig.type == "1C") {
1115 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1116 phasebiasSat->NumberOfPhaseBiases += 1;
1117 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
1118 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1119 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1120 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1121 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1122 }
1123 else if (pbSig.type == "1P") {
1124 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1125 phasebiasSat->NumberOfPhaseBiases += 1;
1126 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
1127 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1128 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1129 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1130 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1131 }
1132 else if (pbSig.type == "2C") {
1133 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1134 phasebiasSat->NumberOfPhaseBiases += 1;
1135 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
1136 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1137 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1138 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1139 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1140 }
1141 else if (pbSig.type == "2P") {
1142 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1143 phasebiasSat->NumberOfPhaseBiases += 1;
1144 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
1145 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1146 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1147 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1148 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1149 }
1150 }
1151 }
1152 if (prn[0] == 'E') {
1153 QListIterator<phaseBiasSignal> it(phaseBiasList);
1154 while (it.hasNext()) {
1155 const phaseBiasSignal &pbSig = it.next();
1156 if (pbSig.type == "1A") {
1157 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1158 phasebiasSat->NumberOfPhaseBiases += 1;
1159 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_A;
1160 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1161 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1162 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1163 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1164 }
1165 else if (pbSig.type == "1B") {
1166 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1167 phasebiasSat->NumberOfPhaseBiases += 1;
1168 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_B;
1169 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1170 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1171 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1172 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1173 }
1174 else if (pbSig.type == "1C") {
1175 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1176 phasebiasSat->NumberOfPhaseBiases += 1;
1177 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_C;
1178 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1179 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1180 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1181 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1182 }
1183 else if (pbSig.type == "5I") {
1184 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1185 phasebiasSat->NumberOfPhaseBiases += 1;
1186 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_I;
1187 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1188 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1189 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1190 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1191 }
1192 else if (pbSig.type == "5Q") {
1193 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1194 phasebiasSat->NumberOfPhaseBiases += 1;
1195 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_Q;
1196 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1197 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1198 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1199 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1200 }
1201 else if (pbSig.type == "7I") {
1202 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1203 phasebiasSat->NumberOfPhaseBiases += 1;
1204 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_I;
1205 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1206 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1207 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1208 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1209 }
1210 else if (pbSig.type == "7Q") {
1211 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1212 phasebiasSat->NumberOfPhaseBiases += 1;
1213 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_Q;
1214 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1215 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1216 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1217 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1218 }
1219 else if (pbSig.type == "8I") {
1220 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1221 phasebiasSat->NumberOfPhaseBiases += 1;
1222 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5_I;
1223 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1224 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1225 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1226 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1227 }
1228 else if (pbSig.type == "8Q") {
1229 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1230 phasebiasSat->NumberOfPhaseBiases += 1;
1231 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5_Q;
1232 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1233 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1234 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1235 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1236 }
1237 else if (pbSig.type == "6A") {
1238 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1239 phasebiasSat->NumberOfPhaseBiases += 1;
1240 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_A;
1241 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1242 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1243 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1244 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1245 }
1246 else if (pbSig.type == "6B") {
1247 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1248 phasebiasSat->NumberOfPhaseBiases += 1;
1249 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_B;
1250 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1251 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1252 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1253 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1254 }
1255 else if (pbSig.type == "6C") {
1256 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1257 phasebiasSat->NumberOfPhaseBiases += 1;
1258 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_C;
1259 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1260 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1261 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1262 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1263 }
1264 }
1265 }
1266 if (prn[0] == 'J') {
1267 QListIterator<phaseBiasSignal> it(phaseBiasList);
1268 while (it.hasNext()) {
1269 const phaseBiasSignal &pbSig = it.next();
1270 if (pbSig.type == "1C") {
1271 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1272 phasebiasSat->NumberOfPhaseBiases += 1;
1273 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1_CA;
1274 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1275 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1276 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1277 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1278 }
1279 else if (pbSig.type == "1S") {
1280 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1281 phasebiasSat->NumberOfPhaseBiases += 1;
1282 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_D;
1283 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1284 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1285 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1286 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1287 }
1288 else if (pbSig.type == "1L") {
1289 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1290 phasebiasSat->NumberOfPhaseBiases += 1;
1291 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_P;
1292 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1293 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1294 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1295 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1296 }
1297 else if (pbSig.type == "1X") {
1298 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1299 phasebiasSat->NumberOfPhaseBiases += 1;
1300 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_DP;
1301 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1302 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1303 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1304 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1305 }
1306 else if (pbSig.type == "2S") {
1307 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1308 phasebiasSat->NumberOfPhaseBiases += 1;
1309 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CM;
1310 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1311 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1312 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1313 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1314 }
1315 else if (pbSig.type == "2L") {
1316 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1317 phasebiasSat->NumberOfPhaseBiases += 1;
1318 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CL;
1319 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1320 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1321 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1322 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1323 }
1324 else if (pbSig.type == "2X") {
1325 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1326 phasebiasSat->NumberOfPhaseBiases += 1;
1327 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CML;
1328 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1329 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1330 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1331 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1332 }
1333 else if (pbSig.type == "5I") {
1334 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1335 phasebiasSat->NumberOfPhaseBiases += 1;
1336 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_I;
1337 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1338 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1339 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1340 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1341 }
1342 else if (pbSig.type == "5Q") {
1343 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1344 phasebiasSat->NumberOfPhaseBiases += 1;
1345 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_Q;
1346 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1347 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1348 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1349 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1350 }
1351 else if (pbSig.type == "5X") {
1352 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1353 phasebiasSat->NumberOfPhaseBiases += 1;
1354 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_IQ;
1355 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1356 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1357 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1358 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1359 }
1360 else if (pbSig.type == "6S") {
1361 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1362 phasebiasSat->NumberOfPhaseBiases += 1;
1363 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_S;
1364 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1365 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1366 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1367 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1368 }
1369 else if (pbSig.type == "6L") {
1370 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1371 phasebiasSat->NumberOfPhaseBiases += 1;
1372 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_L;
1373 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1374 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1375 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1376 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1377 }
1378 else if (pbSig.type == "6X") {
1379 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1380 phasebiasSat->NumberOfPhaseBiases += 1;
1381 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_SL;
1382 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1383 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1384 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1385 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1386 }
1387 }
1388 }
1389 if (prn[0] == 'S') {
1390 QListIterator<phaseBiasSignal> it(phaseBiasList);
1391 while (it.hasNext()) {
1392 const phaseBiasSignal &pbSig = it.next();
1393 if (pbSig.type == "1C") {
1394 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1395 phasebiasSat->NumberOfPhaseBiases += 1;
1396 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L1_CA;
1397 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1398 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1399 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1400 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1401 }
1402 else if (pbSig.type == "5I") {
1403 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1404 phasebiasSat->NumberOfPhaseBiases += 1;
1405 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_I;
1406 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1407 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1408 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1409 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1410 }
1411 else if (pbSig.type == "5Q") {
1412 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1413 phasebiasSat->NumberOfPhaseBiases += 1;
1414 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_Q;
1415 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1416 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1417 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1418 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1419 }
1420 else if (pbSig.type == "5X") {
1421 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1422 phasebiasSat->NumberOfPhaseBiases += 1;
1423 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_IQ;
1424 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1425 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1426 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1427 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1428 }
1429 }
1430 }
1431 if (prn[0] == 'C') {
1432 QListIterator<phaseBiasSignal> it(phaseBiasList);
1433 while (it.hasNext()) {
1434 const phaseBiasSignal &pbSig = it.next();
1435 if (pbSig.type == "2I") {
1436 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1437 phasebiasSat->NumberOfPhaseBiases += 1;
1438 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_I;
1439 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1440 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1441 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1442 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1443 }
1444 else if (pbSig.type == "2Q") {
1445 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1446 phasebiasSat->NumberOfPhaseBiases += 1;
1447 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_Q;
1448 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1449 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1450 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1451 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1452 }
1453 else if (pbSig.type == "2X") {
1454 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1455 phasebiasSat->NumberOfPhaseBiases += 1;
1456 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_IQ;
1457 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1458 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1459 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1460 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1461 }
1462 else if (pbSig.type == "6I") {
1463 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1464 phasebiasSat->NumberOfPhaseBiases += 1;
1465 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_Q;
1466 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1467 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1468 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1469 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1470 }
1471 else if (pbSig.type == "6Q") {
1472 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1473 phasebiasSat->NumberOfPhaseBiases += 1;
1474 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_I;
1475 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1476 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1477 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1478 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1479 }
1480 else if (pbSig.type == "6X") {
1481 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1482 phasebiasSat->NumberOfPhaseBiases += 1;
1483 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_IQ;
1484 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1485 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1486 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1487 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1488 }
1489 else if (pbSig.type == "7I") {
1490 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1491 phasebiasSat->NumberOfPhaseBiases += 1;
1492 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_Q;
1493 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1494 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1495 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1496 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1497 }
1498 else if (pbSig.type == "7Q") {
1499 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1500 phasebiasSat->NumberOfPhaseBiases += 1;
1501 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_I;
1502 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1503 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1504 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1505 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1506 }
1507 else if (pbSig.type == "7X") {
1508 int ii = phasebiasSat->NumberOfPhaseBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
1509 phasebiasSat->NumberOfPhaseBiases += 1;
1510 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_IQ;
1511 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1512 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1513 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator = pbSig.wlInd;
1514 phasebiasSat->Biases[ii].SignalDiscontinuityCounter = pbSig.discCount;
1515 }
1516 }
1517 }
1518 }
1519 }
1520 }
1521
1522
1523 QByteArray hlpBufferCo;
1524
1525 // Orbit and Clock Corrections together
1526 // ------------------------------------
1527 if (_samplRtcmEphCorr == 0.0) {
1528 if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0 ||
1529 co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0 ||
1530 co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0 ||
1531 co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0 ||
1532 co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 ||
1533 co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
1534 char obuffer[CLOCKORBIT_BUFFERSIZE];
1535 int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
1536 if (len > 0) {
1537 hlpBufferCo = QByteArray(obuffer, len);
1538 }
1539 }
1540 }
1541
1542 // Orbit and Clock Corrections separately
1543 // --------------------------------------
1544 else {
1545 if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
1546 char obuffer[CLOCKORBIT_BUFFERSIZE];
1547 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1548 co.UpdateInterval = ephUpdInd;
1549 int len1 = MakeClockOrbit(&co, COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer));
1550 co.UpdateInterval = clkUpdInd;
1551 if (len1 > 0) {
1552 hlpBufferCo += QByteArray(obuffer, len1);
1553 }
1554 }
1555 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) ? 1 : 0;
1556 int len2 = MakeClockOrbit(&co, COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer));
1557 if (len2 > 0) {
1558 hlpBufferCo += QByteArray(obuffer, len2);
1559 }
1560 }
1561 if (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
1562 char obuffer[CLOCKORBIT_BUFFERSIZE];
1563 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1564 co.UpdateInterval = ephUpdInd;
1565 int len1 = MakeClockOrbit(&co, COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer));
1566 co.UpdateInterval = clkUpdInd;
1567 if (len1 > 0) {
1568 hlpBufferCo += QByteArray(obuffer, len1);
1569 }
1570 }
1571 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) ? 1 : 0;
1572 int len2 = MakeClockOrbit(&co, COTYPE_GLONASSCLOCK, mmsg, obuffer, sizeof(obuffer));
1573 if (len2 > 0) {
1574 hlpBufferCo += QByteArray(obuffer, len2);
1575 }
1576 }
1577 if (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) {
1578 char obuffer[CLOCKORBIT_BUFFERSIZE];
1579 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1580 co.UpdateInterval = ephUpdInd;
1581 int len1 = MakeClockOrbit(&co, COTYPE_GALILEOORBIT, 1, obuffer, sizeof(obuffer));
1582 co.UpdateInterval = clkUpdInd;
1583 if (len1 > 0) {
1584 hlpBufferCo += QByteArray(obuffer, len1);
1585 }
1586 }
1587 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) ? 1 : 0;
1588 int len2 = MakeClockOrbit(&co, COTYPE_GALILEOCLOCK, mmsg, obuffer, sizeof(obuffer));
1589 if (len2 > 0) {
1590 hlpBufferCo += QByteArray(obuffer, len2);
1591 }
1592 }
1593 if (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) {
1594 char obuffer[CLOCKORBIT_BUFFERSIZE];
1595 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1596 co.UpdateInterval = ephUpdInd;
1597 int len1 = MakeClockOrbit(&co, COTYPE_QZSSORBIT, 1, obuffer, sizeof(obuffer));
1598 co.UpdateInterval = clkUpdInd;
1599 if (len1 > 0) {
1600 hlpBufferCo += QByteArray(obuffer, len1);
1601 }
1602 }
1603 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) ? 1 : 0;
1604 int len2 = MakeClockOrbit(&co, COTYPE_QZSSCLOCK, mmsg, obuffer, sizeof(obuffer));
1605 if (len2 > 0) {
1606 hlpBufferCo += QByteArray(obuffer, len2);
1607 }
1608 }
1609 if (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) {
1610 char obuffer[CLOCKORBIT_BUFFERSIZE];
1611 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1612 co.UpdateInterval = ephUpdInd;
1613 int len1 = MakeClockOrbit(&co, COTYPE_SBASORBIT, 1, obuffer, sizeof(obuffer));
1614 co.UpdateInterval = clkUpdInd;
1615 if (len1 > 0) {
1616 hlpBufferCo += QByteArray(obuffer, len1);
1617 }
1618 }
1619 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) ? 1 : 0;
1620 int len2 = MakeClockOrbit(&co, COTYPE_SBASCLOCK, mmsg, obuffer, sizeof(obuffer));
1621 if (len2 > 0) {
1622 hlpBufferCo += QByteArray(obuffer, len2);
1623 }
1624 }
1625 if (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
1626 char obuffer[CLOCKORBIT_BUFFERSIZE];
1627 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1628 co.UpdateInterval = ephUpdInd;
1629 int len1 = MakeClockOrbit(&co, COTYPE_BDSORBIT, 1, obuffer, sizeof(obuffer));
1630 co.UpdateInterval = clkUpdInd;
1631 if (len1 > 0) {
1632 hlpBufferCo += QByteArray(obuffer, len1);
1633 }
1634 }
1635 int len2 = MakeClockOrbit(&co, COTYPE_BDSCLOCK, 0, obuffer, sizeof(obuffer));
1636 if (len2 > 0) {
1637 hlpBufferCo += QByteArray(obuffer, len2);
1638 }
1639 }
1640 }
1641
1642 // Code Biases
1643 // -----------
1644 QByteArray hlpBufferBias;
1645 if (bias.NumberOfSat[CLOCKORBIT_SATGPS] > 0 ||
1646 bias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0 ||
1647 bias.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0 ||
1648 bias.NumberOfSat[CLOCKORBIT_SATQZSS] > 0 ||
1649 bias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 ||
1650 bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) {
1651 char obuffer[CLOCKORBIT_BUFFERSIZE];
1652 int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
1653 if (len > 0) {
1654 hlpBufferBias = QByteArray(obuffer, len);
1655 }
1656 }
1657
1658 // Phase Biases
1659 // ------------
1660 QByteArray hlpBufferPhaseBias;
1661 if (phasebias.NumberOfSat[CLOCKORBIT_SATGPS] > 0 ||
1662 phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0 ||
1663 phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0 ||
1664 phasebias.NumberOfSat[CLOCKORBIT_SATQZSS] > 0 ||
1665 phasebias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 ||
1666 phasebias.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) {
1667 char obuffer[CLOCKORBIT_BUFFERSIZE];
1668 int len = MakePhaseBias(&phasebias, PBTYPE_AUTO, 0, obuffer, sizeof(obuffer));
1669 if (len > 0) {
1670 hlpBufferPhaseBias = QByteArray(obuffer, len);
1671 }
1672 }
1673
1674 // VTEC
1675 // ----
1676 QByteArray hlpBufferVtec;
1677 if (vtec.NumLayers > 0) {
1678 char obuffer[CLOCKORBIT_BUFFERSIZE];
1679 int len = MakeVTEC(&vtec, 0, obuffer, sizeof(obuffer));
1680 if (len > 0) {
1681 hlpBufferVtec = QByteArray(obuffer, len);
1682 }
1683 }
1684
1685 _outBuffer += hlpBufferCo + hlpBufferBias + hlpBufferPhaseBias + hlpBufferVtec;
1686}
1687
1688//
1689////////////////////////////////////////////////////////////////////////////
1690void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
1691 double GPSweeks, const QString& prn,
1692 const ColumnVector& rtnAPC,
1693 double rtnClk,
1694 const ColumnVector& rtnVel,
1695 const ColumnVector& rtnCoM,
1696 struct ClockOrbit::SatData* sd,
1697 QString& outLine) {
1698
1699 // Broadcast Position and Velocity
1700 // -------------------------------
1701 ColumnVector xB(4);
1702 ColumnVector vB(3);
1703 eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
1704
1705 // Precise Position
1706 // ----------------
1707 ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
1708
1709 double dc = 0.0;
1710 if (_crdTrafo != "IGS08") {
1711 crdTrafo(GPSweek, xP, dc);
1712 }
1713
1714 // Difference in xyz
1715 // -----------------
1716 ColumnVector dx = xB.Rows(1,3) - xP;
1717 ColumnVector dv = vB - rtnVel;
1718
1719 // Difference in RSW
1720 // -----------------
1721 ColumnVector rsw(3);
1722 XYZ_to_RSW(xB.Rows(1,3), vB, dx, rsw);
1723
1724 ColumnVector dotRsw(3);
1725 XYZ_to_RSW(xB.Rows(1,3), vB, dv, dotRsw);
1726
1727 // Clock Correction
1728 // ----------------
1729 double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
1730
1731 if (sd) {
1732 sd->ID = prn.mid(1).toInt();
1733 sd->IOD = eph->IOD();
1734 sd->Clock.DeltaA0 = dClk;
1735 sd->Clock.DeltaA1 = 0.0; // TODO
1736 sd->Clock.DeltaA2 = 0.0; // TODO
1737 sd->Orbit.DeltaRadial = rsw(1);
1738 sd->Orbit.DeltaAlongTrack = rsw(2);
1739 sd->Orbit.DeltaCrossTrack = rsw(3);
1740 sd->Orbit.DotDeltaRadial = dotRsw(1);
1741 sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
1742 sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
1743 }
1744
1745 outLine.sprintf("%d %.1f %s %3d %10.3f %8.3f %8.3f %8.3f\n",
1746 GPSweek, GPSweeks, eph->prn().toString().c_str(),
1747 eph->IOD(), dClk, rsw(1), rsw(2), rsw(3));
1748
1749 double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
1750 double sp3Clk = (rtnClk - relativity) / t_CST::c; // in seconds
1751
1752 if (_rnx) {
1753 _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
1754 }
1755 if (_sp3) {
1756 _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
1757 }
1758}
1759
1760// Transform Coordinates
1761////////////////////////////////////////////////////////////////////////////
1762void bncRtnetUploadCaster::crdTrafo(int GPSWeek, ColumnVector& xyz,
1763 double& dc) {
1764
1765 // Current epoch minus 2000.0 in years
1766 // ------------------------------------
1767 double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
1768
1769 ColumnVector dx(3);
1770
1771 dx(1) = _dx + dt * _dxr;
1772 dx(2) = _dy + dt * _dyr;
1773 dx(3) = _dz + dt * _dzr;
1774
1775 static const double arcSec = 180.0 * 3600.0 / M_PI;
1776
1777 double ox = (_ox + dt * _oxr) / arcSec;
1778 double oy = (_oy + dt * _oyr) / arcSec;
1779 double oz = (_oz + dt * _ozr) / arcSec;
1780
1781 double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
1782
1783 // Specify approximate center of area
1784 // ----------------------------------
1785 ColumnVector meanSta(3);
1786
1787 if (_crdTrafo == "ETRF2000") {
1788 meanSta(1) = 3661090.0;
1789 meanSta(2) = 845230.0;
1790 meanSta(3) = 5136850.0;
1791 }
1792 else if (_crdTrafo == "NAD83") {
1793 meanSta(1) = -1092950.0;
1794 meanSta(2) = -4383600.0;
1795 meanSta(3) = 4487420.0;
1796 }
1797 else if (_crdTrafo == "GDA94") {
1798 meanSta(1) = -4052050.0;
1799 meanSta(2) = 4212840.0;
1800 meanSta(3) = -2545110.0;
1801 }
1802 else if (_crdTrafo == "SIRGAS2000") {
1803 meanSta(1) = 3740860.0;
1804 meanSta(2) = -4964290.0;
1805 meanSta(3) = -1425420.0;
1806 }
1807 else if (_crdTrafo == "SIRGAS95") {
1808 meanSta(1) = 3135390.0;
1809 meanSta(2) = -5017670.0;
1810 meanSta(3) = -2374440.0;
1811 }
1812 else if (_crdTrafo == "DREF91") {
1813 meanSta(1) = 3959579.0;
1814 meanSta(2) = 721719.0;
1815 meanSta(3) = 4931539.0;
1816 }
1817 else if (_crdTrafo == "Custom") {
1818 meanSta(1) = 0.0; // TODO
1819 meanSta(2) = 0.0; // TODO
1820 meanSta(3) = 0.0; // TODO
1821 }
1822
1823 // Clock correction proportional to topocentric distance to satellites
1824 // -------------------------------------------------------------------
1825 double rho = (xyz - meanSta).norm_Frobenius();
1826 dc = rho * (sc - 1.0) / sc / t_CST::c;
1827
1828 Matrix rMat(3,3);
1829 rMat(1,1) = 1.0;
1830 rMat(1,2) = -oz;
1831 rMat(1,3) = oy;
1832 rMat(2,1) = oz;
1833 rMat(2,2) = 1.0;
1834 rMat(2,3) = -ox;
1835 rMat(3,1) = -oy;
1836 rMat(3,2) = ox;
1837 rMat(3,3) = 1.0;
1838
1839 xyz = sc * rMat * xyz + dx;
1840}
1841
1842int bncRtnetUploadCaster::determineUpdateInd(double samplingRate) {
1843
1844 if (samplingRate == 10.0) {
1845 return 3;
1846 }
1847 else if (samplingRate == 15.0) {
1848 return 4;
1849 }
1850 else if (samplingRate == 30.0) {
1851 return 5;
1852 }
1853 else if (samplingRate == 60.0) {
1854 return 6;
1855 }
1856 else if (samplingRate == 120.0) {
1857 return 7;
1858 }
1859 else if (samplingRate == 240.0) {
1860 return 8;
1861 }
1862 else if (samplingRate == 300.0) {
1863 return 9;
1864 }
1865 else if (samplingRate == 600.0) {
1866 return 10;
1867 }
1868 else if (samplingRate == 900.0) {
1869 return 11;
1870 }
1871 else if (samplingRate == 1800.0) {
1872 return 12;
1873 }
1874 else if (samplingRate == 3600.0) {
1875 return 13;
1876 }
1877 else if (samplingRate == 7200.0) {
1878 return 14;
1879 }
1880 else if (samplingRate == 10800.0) {
1881 return 15;
1882 }
1883 return 2;// default
1884}
Note: See TracBrowser for help on using the repository browser.