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

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

determination of an RTCM encoded update intervall for VTEC is added in rtnet interface

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