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

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

some re-naming

File size: 85.6 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("cmbStreams").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 if (pbSat.yA < 0.0) {
489 pbSat.yA += (2*M_PI);
490 }
491 else if (pbSat.yA > 2*M_PI) {
492 pbSat.yA -= (2*M_PI);
493 }
494 }
495 else if (key == "YawRate") {
496 in >> numVal >> pbSat.yR;
497 }
498 else if (key == "PhaseBias") {
499 in >> numVal;
500 for (int ii = 0; ii < numVal; ii++) {
501 phaseBiasSignal pb;
502 in >> pb.type >> pb.bias >> pb.intInd >> pb.wlInd >> pb.discCount;
503 phaseBiasList.append(pb);
504 }
505 }
506 else {
507 for (int ii = 0; ii < numVal; ii++) {
508 double dummy;
509 in >> dummy;
510 }
511 }
512 }
513
514 struct ClockOrbit::SatData* sd = 0;
515 if (prn.system() == 'G') {
516 sd = co.Sat + co.NumberOfSat[CLOCKORBIT_SATGPS];
517 ++co.NumberOfSat[CLOCKORBIT_SATGPS];
518 }
519 else if (prn.system() == 'R') {
520 sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfSat[CLOCKORBIT_SATGLONASS];
521 ++co.NumberOfSat[CLOCKORBIT_SATGLONASS];
522 }
523 else if (prn.system() == 'E') {
524 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
525 + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
526 ++co.NumberOfSat[CLOCKORBIT_SATGALILEO];
527 }
528 else if (prn.system() == 'J') {
529 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
530 + CLOCKORBIT_NUMGALILEO + co.NumberOfSat[CLOCKORBIT_SATQZSS];
531 ++co.NumberOfSat[CLOCKORBIT_SATQZSS];
532 }
533 else if (prn.system() == 'S') {
534 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
535 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
536 + co.NumberOfSat[CLOCKORBIT_SATSBAS];
537 ++co.NumberOfSat[CLOCKORBIT_SATSBAS];
538 }
539 else if (prn.system() == 'C') {
540 sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
541 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
542 + co.NumberOfSat[CLOCKORBIT_SATBDS];
543 ++co.NumberOfSat[CLOCKORBIT_SATBDS];
544 }
545 if (sd) {
546 QString outLine;
547 processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prnStr, rtnAPC,
548 rtnClk, rtnVel, rtnCoM, sd, outLine);
549 }
550
551 // Code Biases
552 // -----------
553 struct CodeBias::BiasSat* biasSat = 0;
554 if (!codeBiases.isEmpty()) {
555 if (prn.system() == 'G') {
556 biasSat = bias.Sat + bias.NumberOfSat[CLOCKORBIT_SATGPS];
557 ++bias.NumberOfSat[CLOCKORBIT_SATGPS];
558 }
559 else if (prn.system() == 'R') {
560 biasSat = bias.Sat + CLOCKORBIT_NUMGPS
561 + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
562 ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
563 }
564 else if (prn.system() == 'E') {
565 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
566 + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
567 ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
568 }
569 else if (prn.system() == 'J') {
570 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
571 + CLOCKORBIT_NUMGALILEO + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
572 ++bias.NumberOfSat[CLOCKORBIT_SATQZSS];
573 }
574 else if (prn.system() == 'S') {
575 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
576 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS
577 + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
578 ++bias.NumberOfSat[CLOCKORBIT_SATSBAS];
579 }
580 else if (prn.system() == 'C') {
581 biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
582 + CLOCKORBIT_NUMGALILEO + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
583 + bias.NumberOfSat[CLOCKORBIT_SATBDS];
584 ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
585 }
586 }
587
588 if (biasSat) {
589 biasSat->ID = prn.number();
590 biasSat->NumberOfCodeBiases = 0;
591 if (prn.system() == 'G') {
592 QMapIterator<QString, double> it(codeBiases);
593 while (it.hasNext()) {
594 it.next();
595 if (it.key() == "1C") {
596 int ii = biasSat->NumberOfCodeBiases;
597 if (ii >= CLOCKORBIT_NUMBIAS)
598 break;
599 biasSat->NumberOfCodeBiases += 1;
600 biasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
601 biasSat->Biases[ii].Bias = it.value();
602 }
603 else if (it.key() == "1P") {
604 int ii = biasSat->NumberOfCodeBiases;
605 if (ii >= CLOCKORBIT_NUMBIAS)
606 break;
607 biasSat->NumberOfCodeBiases += 1;
608 biasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
609 biasSat->Biases[ii].Bias = it.value();
610 }
611 else if (it.key() == "1W") {
612 int ii = biasSat->NumberOfCodeBiases;
613 if (ii >= CLOCKORBIT_NUMBIAS)
614 break;
615 biasSat->NumberOfCodeBiases += 1;
616 biasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
617 biasSat->Biases[ii].Bias = it.value();
618 }
619 else if (it.key() == "2C") {
620 int ii = biasSat->NumberOfCodeBiases;
621 if (ii >= CLOCKORBIT_NUMBIAS)
622 break;
623 biasSat->NumberOfCodeBiases += 1;
624 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
625 biasSat->Biases[ii].Bias = it.value();
626 }
627 else if (it.key() == "2D") {
628 int ii = biasSat->NumberOfCodeBiases;
629 if (ii >= CLOCKORBIT_NUMBIAS)
630 break;
631 biasSat->NumberOfCodeBiases += 1;
632 biasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
633 biasSat->Biases[ii].Bias = it.value();
634 }
635 else if (it.key() == "2S") {
636 int ii = biasSat->NumberOfCodeBiases;
637 if (ii >= CLOCKORBIT_NUMBIAS)
638 break;
639 biasSat->NumberOfCodeBiases += 1;
640 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
641 biasSat->Biases[ii].Bias = it.value();
642 }
643 else if (it.key() == "2L") {
644 int ii = biasSat->NumberOfCodeBiases;
645 if (ii >= CLOCKORBIT_NUMBIAS)
646 break;
647 biasSat->NumberOfCodeBiases += 1;
648 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
649 biasSat->Biases[ii].Bias = it.value();
650 }
651 else if (it.key() == "2X") {
652 int ii = biasSat->NumberOfCodeBiases;
653 if (ii >= CLOCKORBIT_NUMBIAS)
654 break;
655 biasSat->NumberOfCodeBiases += 1;
656 biasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
657 biasSat->Biases[ii].Bias = it.value();
658 }
659 else if (it.key() == "2P") {
660 int ii = biasSat->NumberOfCodeBiases;
661 if (ii >= CLOCKORBIT_NUMBIAS)
662 break;
663 biasSat->NumberOfCodeBiases += 1;
664 biasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
665 biasSat->Biases[ii].Bias = it.value();
666 }
667 else if (it.key() == "2W") {
668 int ii = biasSat->NumberOfCodeBiases;
669 if (ii >= CLOCKORBIT_NUMBIAS)
670 break;
671 biasSat->NumberOfCodeBiases += 1;
672 biasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
673 biasSat->Biases[ii].Bias = it.value();
674 }
675 else if (it.key() == "5I") {
676 int ii = biasSat->NumberOfCodeBiases;
677 if (ii >= CLOCKORBIT_NUMBIAS)
678 break;
679 biasSat->NumberOfCodeBiases += 1;
680 biasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
681 biasSat->Biases[ii].Bias = it.value();
682 }
683 else if (it.key() == "5Q") {
684 int ii = biasSat->NumberOfCodeBiases;
685 if (ii >= CLOCKORBIT_NUMBIAS)
686 break;
687 biasSat->NumberOfCodeBiases += 1;
688 biasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
689 biasSat->Biases[ii].Bias = it.value();
690 }
691 else if (it.key() == "5X") {
692 int ii = biasSat->NumberOfCodeBiases;
693 if (ii >= CLOCKORBIT_NUMBIAS)
694 break;
695 biasSat->NumberOfCodeBiases += 1;
696 biasSat->Biases[ii].Type = CODETYPEGPS_L5_IQ;
697 biasSat->Biases[ii].Bias = it.value();
698 }
699 }
700 }
701 else if (prn.system() == 'R') {
702 QMapIterator<QString, double> it(codeBiases);
703 while (it.hasNext()) {
704 it.next();
705 if (it.key() == "1C") {
706 int ii = biasSat->NumberOfCodeBiases;
707 if (ii >= CLOCKORBIT_NUMBIAS)
708 break;
709 biasSat->NumberOfCodeBiases += 1;
710 biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
711 biasSat->Biases[ii].Bias = it.value();
712 }
713 else if (it.key() == "1P") {
714 int ii = biasSat->NumberOfCodeBiases;
715 if (ii >= CLOCKORBIT_NUMBIAS)
716 break;
717 biasSat->NumberOfCodeBiases += 1;
718 biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
719 biasSat->Biases[ii].Bias = it.value();
720 }
721 else if (it.key() == "2C") {
722 int ii = biasSat->NumberOfCodeBiases;
723 if (ii >= CLOCKORBIT_NUMBIAS)
724 break;
725 biasSat->NumberOfCodeBiases += 1;
726 biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
727 biasSat->Biases[ii].Bias = it.value();
728 }
729 else if (it.key() == "2P") {
730 int ii = biasSat->NumberOfCodeBiases;
731 if (ii >= CLOCKORBIT_NUMBIAS)
732 break;
733 biasSat->NumberOfCodeBiases += 1;
734 biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
735 biasSat->Biases[ii].Bias = it.value();
736 }
737 }
738 }
739 else if (prn.system() == 'E') {
740 QMapIterator<QString, double> it(codeBiases);
741 while (it.hasNext()) {
742 it.next();
743 if (it.key() == "1A") {
744 int ii = biasSat->NumberOfCodeBiases;
745 if (ii >= CLOCKORBIT_NUMBIAS)
746 break;
747 biasSat->NumberOfCodeBiases += 1;
748 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_A;
749 biasSat->Biases[ii].Bias = it.value();
750 }
751 else if (it.key() == "1B") {
752 int ii = biasSat->NumberOfCodeBiases;
753 if (ii >= CLOCKORBIT_NUMBIAS)
754 break;
755 biasSat->NumberOfCodeBiases += 1;
756 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_B;
757 biasSat->Biases[ii].Bias = it.value();
758 }
759 else if (it.key() == "1C") {
760 int ii = biasSat->NumberOfCodeBiases;
761 if (ii >= CLOCKORBIT_NUMBIAS)
762 break;
763 biasSat->NumberOfCodeBiases += 1;
764 biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_C;
765 biasSat->Biases[ii].Bias = it.value();
766 }
767 else if (it.key() == "5I") {
768 int ii = biasSat->NumberOfCodeBiases;
769 if (ii >= CLOCKORBIT_NUMBIAS)
770 break;
771 biasSat->NumberOfCodeBiases += 1;
772 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_I;
773 biasSat->Biases[ii].Bias = it.value();
774 }
775 else if (it.key() == "5Q") {
776 int ii = biasSat->NumberOfCodeBiases;
777 if (ii >= CLOCKORBIT_NUMBIAS)
778 break;
779 biasSat->NumberOfCodeBiases += 1;
780 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_Q;
781 biasSat->Biases[ii].Bias = it.value();
782 }
783 else if (it.key() == "7I") {
784 int ii = biasSat->NumberOfCodeBiases;
785 if (ii >= CLOCKORBIT_NUMBIAS)
786 break;
787 biasSat->NumberOfCodeBiases += 1;
788 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_I;
789 biasSat->Biases[ii].Bias = it.value();
790 }
791 else if (it.key() == "7Q") {
792 int ii = biasSat->NumberOfCodeBiases;
793 if (ii >= CLOCKORBIT_NUMBIAS)
794 break;
795 biasSat->NumberOfCodeBiases += 1;
796 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_Q;
797 biasSat->Biases[ii].Bias = it.value();
798 }
799 else if (it.key() == "8I") {
800 int ii = biasSat->NumberOfCodeBiases;
801 if (ii >= CLOCKORBIT_NUMBIAS)
802 break;
803 biasSat->NumberOfCodeBiases += 1;
804 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_I;
805 biasSat->Biases[ii].Bias = it.value();
806 }
807 else if (it.key() == "8Q") {
808 int ii = biasSat->NumberOfCodeBiases;
809 if (ii >= CLOCKORBIT_NUMBIAS)
810 break;
811 biasSat->NumberOfCodeBiases += 1;
812 biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_Q;
813 biasSat->Biases[ii].Bias = it.value();
814 }
815 else if (it.key() == "6A") {
816 int ii = biasSat->NumberOfCodeBiases;
817 if (ii >= CLOCKORBIT_NUMBIAS)
818 break;
819 biasSat->NumberOfCodeBiases += 1;
820 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_A;
821 biasSat->Biases[ii].Bias = it.value();
822 }
823 else if (it.key() == "6B") {
824 int ii = biasSat->NumberOfCodeBiases;
825 if (ii >= CLOCKORBIT_NUMBIAS)
826 break;
827 biasSat->NumberOfCodeBiases += 1;
828 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_B;
829 biasSat->Biases[ii].Bias = it.value();
830 }
831 else if (it.key() == "6C") {
832 int ii = biasSat->NumberOfCodeBiases;
833 if (ii >= CLOCKORBIT_NUMBIAS)
834 break;
835 biasSat->NumberOfCodeBiases += 1;
836 biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_C;
837 biasSat->Biases[ii].Bias = it.value();
838 }
839 }
840 }
841 else if (prn.system() == 'J') {
842 QMapIterator<QString, double> it(codeBiases);
843 while (it.hasNext()) {
844 it.next();
845 if (it.key() == "1C") {
846 int ii = biasSat->NumberOfCodeBiases;
847 if (ii >= CLOCKORBIT_NUMBIAS)
848 break;
849 biasSat->NumberOfCodeBiases += 1;
850 biasSat->Biases[ii].Type = CODETYPEQZSS_L1_CA;
851 biasSat->Biases[ii].Bias = it.value();
852 }
853 else if (it.key() == "1S") {
854 int ii = biasSat->NumberOfCodeBiases;
855 if (ii >= CLOCKORBIT_NUMBIAS)
856 break;
857 biasSat->NumberOfCodeBiases += 1;
858 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_D;
859 biasSat->Biases[ii].Bias = it.value();
860 }
861 else if (it.key() == "1L") {
862 int ii = biasSat->NumberOfCodeBiases;
863 if (ii >= CLOCKORBIT_NUMBIAS)
864 break;
865 biasSat->NumberOfCodeBiases += 1;
866 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_P;
867 biasSat->Biases[ii].Bias = it.value();
868 }
869 else if (it.key() == "1X") {
870 int ii = biasSat->NumberOfCodeBiases;
871 if (ii >= CLOCKORBIT_NUMBIAS)
872 break;
873 biasSat->NumberOfCodeBiases += 1;
874 biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_DP;
875 biasSat->Biases[ii].Bias = it.value();
876 }
877 else if (it.key() == "2S") {
878 int ii = biasSat->NumberOfCodeBiases;
879 if (ii >= CLOCKORBIT_NUMBIAS)
880 break;
881 biasSat->NumberOfCodeBiases += 1;
882 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CM;
883 biasSat->Biases[ii].Bias = it.value();
884 }
885 else if (it.key() == "2L") {
886 int ii = biasSat->NumberOfCodeBiases;
887 if (ii >= CLOCKORBIT_NUMBIAS)
888 break;
889 biasSat->NumberOfCodeBiases += 1;
890 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CL;
891 biasSat->Biases[ii].Bias = it.value();
892 }
893 else if (it.key() == "2X") {
894 int ii = biasSat->NumberOfCodeBiases;
895 if (ii >= CLOCKORBIT_NUMBIAS)
896 break;
897 biasSat->NumberOfCodeBiases += 1;
898 biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CML;
899 biasSat->Biases[ii].Bias = it.value();
900 }
901 else if (it.key() == "5I") {
902 int ii = biasSat->NumberOfCodeBiases;
903 if (ii >= CLOCKORBIT_NUMBIAS)
904 break;
905 biasSat->NumberOfCodeBiases += 1;
906 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_I;
907 biasSat->Biases[ii].Bias = it.value();
908 }
909 else if (it.key() == "5Q") {
910 int ii = biasSat->NumberOfCodeBiases;
911 if (ii >= CLOCKORBIT_NUMBIAS)
912 break;
913 biasSat->NumberOfCodeBiases += 1;
914 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_Q;
915 biasSat->Biases[ii].Bias = it.value();
916 }
917 else if (it.key() == "5X") {
918 int ii = biasSat->NumberOfCodeBiases;
919 if (ii >= CLOCKORBIT_NUMBIAS)
920 break;
921 biasSat->NumberOfCodeBiases += 1;
922 biasSat->Biases[ii].Type = CODETYPEQZSS_L5_IQ;
923 biasSat->Biases[ii].Bias = it.value();
924 }
925 else if (it.key() == "6S") {
926 int ii = biasSat->NumberOfCodeBiases;
927 if (ii >= CLOCKORBIT_NUMBIAS)
928 break;
929 biasSat->NumberOfCodeBiases += 1;
930 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_S;
931 biasSat->Biases[ii].Bias = it.value();
932 }
933 else if (it.key() == "6L") {
934 int ii = biasSat->NumberOfCodeBiases;
935 if (ii >= CLOCKORBIT_NUMBIAS)
936 break;
937 biasSat->NumberOfCodeBiases += 1;
938 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_L;
939 biasSat->Biases[ii].Bias = it.value();
940 }
941 else if (it.key() == "6X") {
942 int ii = biasSat->NumberOfCodeBiases;
943 if (ii >= CLOCKORBIT_NUMBIAS)
944 break;
945 biasSat->NumberOfCodeBiases += 1;
946 biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_SL;
947 biasSat->Biases[ii].Bias = it.value();
948 }
949 }
950 }
951 else if (prn.system() == 'S') {
952 QMapIterator<QString, double> it(codeBiases);
953 while (it.hasNext()) {
954 it.next();
955 if (it.key() == "1C") {
956 int ii = biasSat->NumberOfCodeBiases;
957 if (ii >= CLOCKORBIT_NUMBIAS)
958 break;
959 biasSat->NumberOfCodeBiases += 1;
960 biasSat->Biases[ii].Type = CODETYPE_SBAS_L1_CA;
961 biasSat->Biases[ii].Bias = it.value();
962 }
963 else if (it.key() == "5I") {
964 int ii = biasSat->NumberOfCodeBiases;
965 if (ii >= CLOCKORBIT_NUMBIAS)
966 break;
967 biasSat->NumberOfCodeBiases += 1;
968 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_I;
969 biasSat->Biases[ii].Bias = it.value();
970 }
971 else if (it.key() == "5Q") {
972 int ii = biasSat->NumberOfCodeBiases;
973 if (ii >= CLOCKORBIT_NUMBIAS)
974 break;
975 biasSat->NumberOfCodeBiases += 1;
976 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_Q;
977 biasSat->Biases[ii].Bias = it.value();
978 }
979 else if (it.key() == "5X") {
980 int ii = biasSat->NumberOfCodeBiases;
981 if (ii >= CLOCKORBIT_NUMBIAS)
982 break;
983 biasSat->NumberOfCodeBiases += 1;
984 biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_IQ;
985 biasSat->Biases[ii].Bias = it.value();
986 }
987 }
988 }
989 else if (prn.system() == 'C') {
990 QMapIterator<QString, double> it(codeBiases);
991 while (it.hasNext()) {
992 it.next();
993 if (it.key() == "2I") {
994 int ii = biasSat->NumberOfCodeBiases;
995 if (ii >= CLOCKORBIT_NUMBIAS)
996 break;
997 biasSat->NumberOfCodeBiases += 1;
998 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_I;
999 biasSat->Biases[ii].Bias = it.value();
1000 }
1001 else if (it.key() == "2Q") {
1002 int ii = biasSat->NumberOfCodeBiases;
1003 if (ii >= CLOCKORBIT_NUMBIAS)
1004 break;
1005 biasSat->NumberOfCodeBiases += 1;
1006 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_Q;
1007 biasSat->Biases[ii].Bias = it.value();
1008 }
1009 else if (it.key() == "2X") {
1010 int ii = biasSat->NumberOfCodeBiases;
1011 if (ii >= CLOCKORBIT_NUMBIAS)
1012 break;
1013 biasSat->NumberOfCodeBiases += 1;
1014 biasSat->Biases[ii].Type = CODETYPE_BDS_B1_IQ;
1015 biasSat->Biases[ii].Bias = it.value();
1016 }
1017 else if (it.key() == "6I") {
1018 int ii = biasSat->NumberOfCodeBiases;
1019 if (ii >= CLOCKORBIT_NUMBIAS)
1020 break;
1021 biasSat->NumberOfCodeBiases += 1;
1022 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_I;
1023 biasSat->Biases[ii].Bias = it.value();
1024 }
1025 else if (it.key() == "6Q") {
1026 int ii = biasSat->NumberOfCodeBiases;
1027 if (ii >= CLOCKORBIT_NUMBIAS)
1028 break;
1029 biasSat->NumberOfCodeBiases += 1;
1030 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_Q;
1031 biasSat->Biases[ii].Bias = it.value();
1032 }
1033 else if (it.key() == "6X") {
1034 int ii = biasSat->NumberOfCodeBiases;
1035 if (ii >= CLOCKORBIT_NUMBIAS)
1036 break;
1037 biasSat->NumberOfCodeBiases += 1;
1038 biasSat->Biases[ii].Type = CODETYPE_BDS_B3_IQ;
1039 biasSat->Biases[ii].Bias = it.value();
1040 }
1041 else if (it.key() == "7I") {
1042 int ii = biasSat->NumberOfCodeBiases;
1043 if (ii >= CLOCKORBIT_NUMBIAS)
1044 break;
1045 biasSat->NumberOfCodeBiases += 1;
1046 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_I;
1047 biasSat->Biases[ii].Bias = it.value();
1048 }
1049 else if (it.key() == "7Q") {
1050 int ii = biasSat->NumberOfCodeBiases;
1051 if (ii >= CLOCKORBIT_NUMBIAS)
1052 break;
1053 biasSat->NumberOfCodeBiases += 1;
1054 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_Q;
1055 biasSat->Biases[ii].Bias = it.value();
1056 }
1057 else if (it.key() == "7X") {
1058 int ii = biasSat->NumberOfCodeBiases;
1059 if (ii >= CLOCKORBIT_NUMBIAS)
1060 break;
1061 biasSat->NumberOfCodeBiases += 1;
1062 biasSat->Biases[ii].Type = CODETYPE_BDS_B2_IQ;
1063 biasSat->Biases[ii].Bias = it.value();
1064 }
1065 }
1066 }
1067 }
1068 // Phase Biases
1069 // ------------
1070 struct PhaseBias::PhaseBiasSat* phasebiasSat = 0;
1071 if (!phaseBiasList.isEmpty()) {
1072 if (prn.system() == 'G') {
1073 phasebiasSat = phasebias.Sat
1074 + phasebias.NumberOfSat[CLOCKORBIT_SATGPS];
1075 ++phasebias.NumberOfSat[CLOCKORBIT_SATGPS];
1076 }
1077 else if (prn.system() == 'R') {
1078 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
1079 + phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS];
1080 ++phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS];
1081 }
1082 else if (prn.system() == 'E') {
1083 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
1084 + CLOCKORBIT_NUMGLONASS
1085 + phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
1086 ++phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO];
1087 }
1088 else if (prn.system() == 'J') {
1089 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
1090 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
1091 + phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
1092 ++phasebias.NumberOfSat[CLOCKORBIT_SATQZSS];
1093 }
1094 else if (prn.system() == 'S') {
1095 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
1096 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
1097 + CLOCKORBIT_NUMQZSS + phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
1098 ++phasebias.NumberOfSat[CLOCKORBIT_SATSBAS];
1099 }
1100 else if (prn.system() == 'C') {
1101 phasebiasSat = phasebias.Sat + CLOCKORBIT_NUMGPS
1102 + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
1103 + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
1104 + phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
1105 ++phasebias.NumberOfSat[CLOCKORBIT_SATBDS];
1106 }
1107 }
1108
1109 if (phasebiasSat) {
1110 phasebias.DispersiveBiasConsistencyIndicator = dispInd;
1111 phasebias.MWConsistencyIndicator = mwInd;
1112 phasebiasSat->ID = prn.number();
1113 phasebiasSat->NumberOfPhaseBiases = 0;
1114 phasebiasSat->YawAngle = pbSat.yA;
1115 phasebiasSat->YawRate = pbSat.yR;
1116 if (prn.system() == 'G') {
1117 QListIterator<phaseBiasSignal> it(phaseBiasList);
1118 while (it.hasNext()) {
1119 const phaseBiasSignal &pbSig = it.next();
1120 if (pbSig.type == "1C") {
1121 int ii = phasebiasSat->NumberOfPhaseBiases;
1122 if (ii >= CLOCKORBIT_NUMBIAS)
1123 break;
1124 phasebiasSat->NumberOfPhaseBiases += 1;
1125 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
1126 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1127 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1128 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1129 pbSig.wlInd;
1130 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1131 pbSig.discCount;
1132 }
1133 else if (pbSig.type == "1P") {
1134 int ii = phasebiasSat->NumberOfPhaseBiases;
1135 if (ii >= CLOCKORBIT_NUMBIAS)
1136 break;
1137 phasebiasSat->NumberOfPhaseBiases += 1;
1138 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
1139 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1140 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1141 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1142 pbSig.wlInd;
1143 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1144 pbSig.discCount;
1145 }
1146 else if (pbSig.type == "1W") {
1147 int ii = phasebiasSat->NumberOfPhaseBiases;
1148 if (ii >= CLOCKORBIT_NUMBIAS)
1149 break;
1150 phasebiasSat->NumberOfPhaseBiases += 1;
1151 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
1152 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1153 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1154 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1155 pbSig.wlInd;
1156 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1157 pbSig.discCount;
1158 }
1159 else if (pbSig.type == "2C") {
1160 int ii = phasebiasSat->NumberOfPhaseBiases;
1161 if (ii >= CLOCKORBIT_NUMBIAS)
1162 break;
1163 phasebiasSat->NumberOfPhaseBiases += 1;
1164 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
1165 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1166 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1167 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1168 pbSig.wlInd;
1169 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1170 pbSig.discCount;
1171 }
1172 else if (pbSig.type == "2D") {
1173 int ii = phasebiasSat->NumberOfPhaseBiases;
1174 if (ii >= CLOCKORBIT_NUMBIAS)
1175 break;
1176 phasebiasSat->NumberOfPhaseBiases += 1;
1177 phasebiasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
1178 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1179 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1180 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1181 pbSig.wlInd;
1182 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1183 pbSig.discCount;
1184 }
1185 else if (pbSig.type == "2S") {
1186 int ii = phasebiasSat->NumberOfPhaseBiases;
1187 if (ii >= CLOCKORBIT_NUMBIAS)
1188 break;
1189 phasebiasSat->NumberOfPhaseBiases += 1;
1190 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
1191 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1192 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1193 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1194 pbSig.wlInd;
1195 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1196 pbSig.discCount;
1197 }
1198 else if (pbSig.type == "2L") {
1199 int ii = phasebiasSat->NumberOfPhaseBiases;
1200 if (ii >= CLOCKORBIT_NUMBIAS)
1201 break;
1202 phasebiasSat->NumberOfPhaseBiases += 1;
1203 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
1204 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1205 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1206 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1207 pbSig.wlInd;
1208 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1209 pbSig.discCount;
1210 }
1211 else if (pbSig.type == "2X") {
1212 int ii = phasebiasSat->NumberOfPhaseBiases;
1213 if (ii >= CLOCKORBIT_NUMBIAS)
1214 break;
1215 phasebiasSat->NumberOfPhaseBiases += 1;
1216 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
1217 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1218 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1219 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1220 pbSig.wlInd;
1221 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1222 pbSig.discCount;
1223 }
1224 else if (pbSig.type == "2P") {
1225 int ii = phasebiasSat->NumberOfPhaseBiases;
1226 if (ii >= CLOCKORBIT_NUMBIAS)
1227 break;
1228 phasebiasSat->NumberOfPhaseBiases += 1;
1229 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
1230 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1231 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1232 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1233 pbSig.wlInd;
1234 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1235 pbSig.discCount;
1236 }
1237 else if (pbSig.type == "2W") {
1238 int ii = phasebiasSat->NumberOfPhaseBiases;
1239 if (ii >= CLOCKORBIT_NUMBIAS)
1240 break;
1241 phasebiasSat->NumberOfPhaseBiases += 1;
1242 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
1243 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1244 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1245 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1246 pbSig.wlInd;
1247 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1248 pbSig.discCount;
1249 }
1250 else if (pbSig.type == "5I") {
1251 int ii = phasebiasSat->NumberOfPhaseBiases;
1252 if (ii >= CLOCKORBIT_NUMBIAS)
1253 break;
1254 phasebiasSat->NumberOfPhaseBiases += 1;
1255 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
1256 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1257 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1258 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1259 pbSig.wlInd;
1260 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1261 pbSig.discCount;
1262 }
1263 else if (pbSig.type == "5Q") {
1264 int ii = phasebiasSat->NumberOfPhaseBiases;
1265 if (ii >= CLOCKORBIT_NUMBIAS)
1266 break;
1267 phasebiasSat->NumberOfPhaseBiases += 1;
1268 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
1269 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1270 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1271 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1272 pbSig.wlInd;
1273 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1274 pbSig.discCount;
1275 }
1276 else if (pbSig.type == "5X") {
1277 int ii = phasebiasSat->NumberOfPhaseBiases;
1278 if (ii >= CLOCKORBIT_NUMBIAS)
1279 break;
1280 phasebiasSat->NumberOfPhaseBiases += 1;
1281 phasebiasSat->Biases[ii].Type = CODETYPEGPS_L5_IQ;
1282 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1283 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1284 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1285 pbSig.wlInd;
1286 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1287 pbSig.discCount;
1288 }
1289 }
1290 }
1291 if (prn.system() == 'R') {
1292 QListIterator<phaseBiasSignal> it(phaseBiasList);
1293 while (it.hasNext()) {
1294 const phaseBiasSignal &pbSig = it.next();
1295 if (pbSig.type == "1C") {
1296 int ii = phasebiasSat->NumberOfPhaseBiases;
1297 if (ii >= CLOCKORBIT_NUMBIAS)
1298 break;
1299 phasebiasSat->NumberOfPhaseBiases += 1;
1300 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
1301 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1302 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1303 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1304 pbSig.wlInd;
1305 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1306 pbSig.discCount;
1307 }
1308 else if (pbSig.type == "1P") {
1309 int ii = phasebiasSat->NumberOfPhaseBiases;
1310 if (ii >= CLOCKORBIT_NUMBIAS)
1311 break;
1312 phasebiasSat->NumberOfPhaseBiases += 1;
1313 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
1314 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1315 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1316 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1317 pbSig.wlInd;
1318 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1319 pbSig.discCount;
1320 }
1321 else if (pbSig.type == "2C") {
1322 int ii = phasebiasSat->NumberOfPhaseBiases;
1323 if (ii >= CLOCKORBIT_NUMBIAS)
1324 break;
1325 phasebiasSat->NumberOfPhaseBiases += 1;
1326 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
1327 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1328 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1329 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1330 pbSig.wlInd;
1331 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1332 pbSig.discCount;
1333 }
1334 else if (pbSig.type == "2P") {
1335 int ii = phasebiasSat->NumberOfPhaseBiases;
1336 if (ii >= CLOCKORBIT_NUMBIAS)
1337 break;
1338 phasebiasSat->NumberOfPhaseBiases += 1;
1339 phasebiasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
1340 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1341 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1342 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1343 pbSig.wlInd;
1344 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1345 pbSig.discCount;
1346 }
1347 }
1348 }
1349 if (prn.system() == 'E') {
1350 QListIterator<phaseBiasSignal> it(phaseBiasList);
1351 while (it.hasNext()) {
1352 const phaseBiasSignal &pbSig = it.next();
1353 if (pbSig.type == "1A") {
1354 int ii = phasebiasSat->NumberOfPhaseBiases;
1355 if (ii >= CLOCKORBIT_NUMBIAS)
1356 break;
1357 phasebiasSat->NumberOfPhaseBiases += 1;
1358 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_A;
1359 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1360 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1361 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1362 pbSig.wlInd;
1363 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1364 pbSig.discCount;
1365 }
1366 else if (pbSig.type == "1B") {
1367 int ii = phasebiasSat->NumberOfPhaseBiases;
1368 if (ii >= CLOCKORBIT_NUMBIAS)
1369 break;
1370 phasebiasSat->NumberOfPhaseBiases += 1;
1371 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_B;
1372 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1373 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1374 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1375 pbSig.wlInd;
1376 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1377 pbSig.discCount;
1378 }
1379 else if (pbSig.type == "1C") {
1380 int ii = phasebiasSat->NumberOfPhaseBiases;
1381 if (ii >= CLOCKORBIT_NUMBIAS)
1382 break;
1383 phasebiasSat->NumberOfPhaseBiases += 1;
1384 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E1_C;
1385 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1386 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1387 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1388 pbSig.wlInd;
1389 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1390 pbSig.discCount;
1391 }
1392 else if (pbSig.type == "5I") {
1393 int ii = phasebiasSat->NumberOfPhaseBiases;
1394 if (ii >= CLOCKORBIT_NUMBIAS)
1395 break;
1396 phasebiasSat->NumberOfPhaseBiases += 1;
1397 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_I;
1398 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1399 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1400 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1401 pbSig.wlInd;
1402 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1403 pbSig.discCount;
1404 }
1405 else if (pbSig.type == "5Q") {
1406 int ii = phasebiasSat->NumberOfPhaseBiases;
1407 if (ii >= CLOCKORBIT_NUMBIAS)
1408 break;
1409 phasebiasSat->NumberOfPhaseBiases += 1;
1410 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_Q;
1411 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1412 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1413 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1414 pbSig.wlInd;
1415 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1416 pbSig.discCount;
1417 }
1418 else if (pbSig.type == "7I") {
1419 int ii = phasebiasSat->NumberOfPhaseBiases;
1420 if (ii >= CLOCKORBIT_NUMBIAS)
1421 break;
1422 phasebiasSat->NumberOfPhaseBiases += 1;
1423 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_I;
1424 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1425 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1426 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1427 pbSig.wlInd;
1428 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1429 pbSig.discCount;
1430 }
1431 else if (pbSig.type == "7Q") {
1432 int ii = phasebiasSat->NumberOfPhaseBiases;
1433 if (ii >= CLOCKORBIT_NUMBIAS)
1434 break;
1435 phasebiasSat->NumberOfPhaseBiases += 1;
1436 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_Q;
1437 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1438 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1439 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1440 pbSig.wlInd;
1441 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1442 pbSig.discCount;
1443 }
1444 else if (pbSig.type == "8I") {
1445 int ii = phasebiasSat->NumberOfPhaseBiases;
1446 if (ii >= CLOCKORBIT_NUMBIAS)
1447 break;
1448 phasebiasSat->NumberOfPhaseBiases += 1;
1449 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5_I;
1450 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1451 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1452 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1453 pbSig.wlInd;
1454 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1455 pbSig.discCount;
1456 }
1457 else if (pbSig.type == "8Q") {
1458 int ii = phasebiasSat->NumberOfPhaseBiases;
1459 if (ii >= CLOCKORBIT_NUMBIAS)
1460 break;
1461 phasebiasSat->NumberOfPhaseBiases += 1;
1462 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E5_Q;
1463 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1464 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1465 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1466 pbSig.wlInd;
1467 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1468 pbSig.discCount;
1469 }
1470 else if (pbSig.type == "6A") {
1471 int ii = phasebiasSat->NumberOfPhaseBiases;
1472 if (ii >= CLOCKORBIT_NUMBIAS)
1473 break;
1474 phasebiasSat->NumberOfPhaseBiases += 1;
1475 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_A;
1476 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1477 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1478 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1479 pbSig.wlInd;
1480 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1481 pbSig.discCount;
1482 }
1483 else if (pbSig.type == "6B") {
1484 int ii = phasebiasSat->NumberOfPhaseBiases;
1485 if (ii >= CLOCKORBIT_NUMBIAS)
1486 break;
1487 phasebiasSat->NumberOfPhaseBiases += 1;
1488 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_B;
1489 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1490 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1491 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1492 pbSig.wlInd;
1493 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1494 pbSig.discCount;
1495 }
1496 else if (pbSig.type == "6C") {
1497 int ii = phasebiasSat->NumberOfPhaseBiases;
1498 if (ii >= CLOCKORBIT_NUMBIAS)
1499 break;
1500 phasebiasSat->NumberOfPhaseBiases += 1;
1501 phasebiasSat->Biases[ii].Type = CODETYPEGALILEO_E6_C;
1502 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1503 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1504 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1505 pbSig.wlInd;
1506 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1507 pbSig.discCount;
1508 }
1509 }
1510 }
1511 if (prn.system() == 'J') {
1512 QListIterator<phaseBiasSignal> it(phaseBiasList);
1513 while (it.hasNext()) {
1514 const phaseBiasSignal &pbSig = it.next();
1515 if (pbSig.type == "1C") {
1516 int ii = phasebiasSat->NumberOfPhaseBiases;
1517 if (ii >= CLOCKORBIT_NUMBIAS)
1518 break;
1519 phasebiasSat->NumberOfPhaseBiases += 1;
1520 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1_CA;
1521 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1522 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1523 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1524 pbSig.wlInd;
1525 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1526 pbSig.discCount;
1527 }
1528 else if (pbSig.type == "1S") {
1529 int ii = phasebiasSat->NumberOfPhaseBiases;
1530 if (ii >= CLOCKORBIT_NUMBIAS)
1531 break;
1532 phasebiasSat->NumberOfPhaseBiases += 1;
1533 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_D;
1534 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1535 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1536 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1537 pbSig.wlInd;
1538 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1539 pbSig.discCount;
1540 }
1541 else if (pbSig.type == "1L") {
1542 int ii = phasebiasSat->NumberOfPhaseBiases;
1543 if (ii >= CLOCKORBIT_NUMBIAS)
1544 break;
1545 phasebiasSat->NumberOfPhaseBiases += 1;
1546 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_P;
1547 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1548 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1549 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1550 pbSig.wlInd;
1551 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1552 pbSig.discCount;
1553 }
1554 else if (pbSig.type == "1X") {
1555 int ii = phasebiasSat->NumberOfPhaseBiases;
1556 if (ii >= CLOCKORBIT_NUMBIAS)
1557 break;
1558 phasebiasSat->NumberOfPhaseBiases += 1;
1559 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L1C_DP;
1560 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1561 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1562 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1563 pbSig.wlInd;
1564 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1565 pbSig.discCount;
1566 }
1567 else if (pbSig.type == "2S") {
1568 int ii = phasebiasSat->NumberOfPhaseBiases;
1569 if (ii >= CLOCKORBIT_NUMBIAS)
1570 break;
1571 phasebiasSat->NumberOfPhaseBiases += 1;
1572 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CM;
1573 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1574 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1575 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1576 pbSig.wlInd;
1577 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1578 pbSig.discCount;
1579 }
1580 else if (pbSig.type == "2L") {
1581 int ii = phasebiasSat->NumberOfPhaseBiases;
1582 if (ii >= CLOCKORBIT_NUMBIAS)
1583 break;
1584 phasebiasSat->NumberOfPhaseBiases += 1;
1585 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CL;
1586 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1587 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1588 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1589 pbSig.wlInd;
1590 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1591 pbSig.discCount;
1592 }
1593 else if (pbSig.type == "2X") {
1594 int ii = phasebiasSat->NumberOfPhaseBiases;
1595 if (ii >= CLOCKORBIT_NUMBIAS)
1596 break;
1597 phasebiasSat->NumberOfPhaseBiases += 1;
1598 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L2_CML;
1599 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1600 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1601 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1602 pbSig.wlInd;
1603 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1604 pbSig.discCount;
1605 }
1606 else if (pbSig.type == "5I") {
1607 int ii = phasebiasSat->NumberOfPhaseBiases;
1608 if (ii >= CLOCKORBIT_NUMBIAS)
1609 break;
1610 phasebiasSat->NumberOfPhaseBiases += 1;
1611 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_I;
1612 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1613 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1614 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1615 pbSig.wlInd;
1616 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1617 pbSig.discCount;
1618 }
1619 else if (pbSig.type == "5Q") {
1620 int ii = phasebiasSat->NumberOfPhaseBiases;
1621 if (ii >= CLOCKORBIT_NUMBIAS)
1622 break;
1623 phasebiasSat->NumberOfPhaseBiases += 1;
1624 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_Q;
1625 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1626 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1627 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1628 pbSig.wlInd;
1629 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1630 pbSig.discCount;
1631 }
1632 else if (pbSig.type == "5X") {
1633 int ii = phasebiasSat->NumberOfPhaseBiases;
1634 if (ii >= CLOCKORBIT_NUMBIAS)
1635 break;
1636 phasebiasSat->NumberOfPhaseBiases += 1;
1637 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_L5_IQ;
1638 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1639 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1640 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1641 pbSig.wlInd;
1642 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1643 pbSig.discCount;
1644 }
1645 else if (pbSig.type == "6S") {
1646 int ii = phasebiasSat->NumberOfPhaseBiases;
1647 if (ii >= CLOCKORBIT_NUMBIAS)
1648 break;
1649 phasebiasSat->NumberOfPhaseBiases += 1;
1650 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_S;
1651 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1652 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1653 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1654 pbSig.wlInd;
1655 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1656 pbSig.discCount;
1657 }
1658 else if (pbSig.type == "6L") {
1659 int ii = phasebiasSat->NumberOfPhaseBiases;
1660 if (ii >= CLOCKORBIT_NUMBIAS)
1661 break;
1662 phasebiasSat->NumberOfPhaseBiases += 1;
1663 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_L;
1664 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1665 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1666 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1667 pbSig.wlInd;
1668 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1669 pbSig.discCount;
1670 }
1671 else if (pbSig.type == "6X") {
1672 int ii = phasebiasSat->NumberOfPhaseBiases;
1673 if (ii >= CLOCKORBIT_NUMBIAS)
1674 break;
1675 phasebiasSat->NumberOfPhaseBiases += 1;
1676 phasebiasSat->Biases[ii].Type = CODETYPEQZSS_LEX_SL;
1677 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1678 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1679 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1680 pbSig.wlInd;
1681 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1682 pbSig.discCount;
1683 }
1684 }
1685 }
1686 if (prn.system() == 'S') {
1687 QListIterator<phaseBiasSignal> it(phaseBiasList);
1688 while (it.hasNext()) {
1689 const phaseBiasSignal &pbSig = it.next();
1690 if (pbSig.type == "1C") {
1691 int ii = phasebiasSat->NumberOfPhaseBiases;
1692 if (ii >= CLOCKORBIT_NUMBIAS)
1693 break;
1694 phasebiasSat->NumberOfPhaseBiases += 1;
1695 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L1_CA;
1696 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1697 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1698 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1699 pbSig.wlInd;
1700 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1701 pbSig.discCount;
1702 }
1703 else if (pbSig.type == "5I") {
1704 int ii = phasebiasSat->NumberOfPhaseBiases;
1705 if (ii >= CLOCKORBIT_NUMBIAS)
1706 break;
1707 phasebiasSat->NumberOfPhaseBiases += 1;
1708 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_I;
1709 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1710 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1711 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1712 pbSig.wlInd;
1713 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1714 pbSig.discCount;
1715 }
1716 else if (pbSig.type == "5Q") {
1717 int ii = phasebiasSat->NumberOfPhaseBiases;
1718 if (ii >= CLOCKORBIT_NUMBIAS)
1719 break;
1720 phasebiasSat->NumberOfPhaseBiases += 1;
1721 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_Q;
1722 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1723 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1724 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1725 pbSig.wlInd;
1726 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1727 pbSig.discCount;
1728 }
1729 else if (pbSig.type == "5X") {
1730 int ii = phasebiasSat->NumberOfPhaseBiases;
1731 if (ii >= CLOCKORBIT_NUMBIAS)
1732 break;
1733 phasebiasSat->NumberOfPhaseBiases += 1;
1734 phasebiasSat->Biases[ii].Type = CODETYPE_SBAS_L5_IQ;
1735 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1736 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1737 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1738 pbSig.wlInd;
1739 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1740 pbSig.discCount;
1741 }
1742 }
1743 }
1744 if (prn.system() == 'C') {
1745 QListIterator<phaseBiasSignal> it(phaseBiasList);
1746 while (it.hasNext()) {
1747 const phaseBiasSignal &pbSig = it.next();
1748 if (pbSig.type == "2I") {
1749 int ii = phasebiasSat->NumberOfPhaseBiases;
1750 if (ii >= CLOCKORBIT_NUMBIAS)
1751 break;
1752 phasebiasSat->NumberOfPhaseBiases += 1;
1753 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_I;
1754 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1755 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1756 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1757 pbSig.wlInd;
1758 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1759 pbSig.discCount;
1760 }
1761 else if (pbSig.type == "2Q") {
1762 int ii = phasebiasSat->NumberOfPhaseBiases;
1763 if (ii >= CLOCKORBIT_NUMBIAS)
1764 break;
1765 phasebiasSat->NumberOfPhaseBiases += 1;
1766 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_Q;
1767 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1768 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1769 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1770 pbSig.wlInd;
1771 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1772 pbSig.discCount;
1773 }
1774 else if (pbSig.type == "2X") {
1775 int ii = phasebiasSat->NumberOfPhaseBiases;
1776 if (ii >= CLOCKORBIT_NUMBIAS)
1777 break;
1778 phasebiasSat->NumberOfPhaseBiases += 1;
1779 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B1_IQ;
1780 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1781 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1782 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1783 pbSig.wlInd;
1784 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1785 pbSig.discCount;
1786 }
1787 else if (pbSig.type == "6I") {
1788 int ii = phasebiasSat->NumberOfPhaseBiases;
1789 if (ii >= CLOCKORBIT_NUMBIAS)
1790 break;
1791 phasebiasSat->NumberOfPhaseBiases += 1;
1792 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_Q;
1793 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1794 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1795 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1796 pbSig.wlInd;
1797 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1798 pbSig.discCount;
1799 }
1800 else if (pbSig.type == "6Q") {
1801 int ii = phasebiasSat->NumberOfPhaseBiases;
1802 if (ii >= CLOCKORBIT_NUMBIAS)
1803 break;
1804 phasebiasSat->NumberOfPhaseBiases += 1;
1805 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_I;
1806 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1807 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1808 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1809 pbSig.wlInd;
1810 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1811 pbSig.discCount;
1812 }
1813 else if (pbSig.type == "6X") {
1814 int ii = phasebiasSat->NumberOfPhaseBiases;
1815 if (ii >= CLOCKORBIT_NUMBIAS)
1816 break;
1817 phasebiasSat->NumberOfPhaseBiases += 1;
1818 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B2_IQ;
1819 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1820 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1821 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1822 pbSig.wlInd;
1823 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1824 pbSig.discCount;
1825 }
1826 else if (pbSig.type == "7I") {
1827 int ii = phasebiasSat->NumberOfPhaseBiases;
1828 if (ii >= CLOCKORBIT_NUMBIAS)
1829 break;
1830 phasebiasSat->NumberOfPhaseBiases += 1;
1831 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_Q;
1832 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1833 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1834 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1835 pbSig.wlInd;
1836 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1837 pbSig.discCount;
1838 }
1839 else if (pbSig.type == "7Q") {
1840 int ii = phasebiasSat->NumberOfPhaseBiases;
1841 if (ii >= CLOCKORBIT_NUMBIAS)
1842 break;
1843 phasebiasSat->NumberOfPhaseBiases += 1;
1844 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_I;
1845 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1846 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1847 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1848 pbSig.wlInd;
1849 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1850 pbSig.discCount;
1851 }
1852 else if (pbSig.type == "7X") {
1853 int ii = phasebiasSat->NumberOfPhaseBiases;
1854 if (ii >= CLOCKORBIT_NUMBIAS)
1855 break;
1856 phasebiasSat->NumberOfPhaseBiases += 1;
1857 phasebiasSat->Biases[ii].Type = CODETYPE_BDS_B3_IQ;
1858 phasebiasSat->Biases[ii].Bias = pbSig.bias;
1859 phasebiasSat->Biases[ii].SignalIntegerIndicator = pbSig.intInd;
1860 phasebiasSat->Biases[ii].SignalsWideLaneIntegerIndicator =
1861 pbSig.wlInd;
1862 phasebiasSat->Biases[ii].SignalDiscontinuityCounter =
1863 pbSig.discCount;
1864 }
1865 }
1866 }
1867 }
1868 }
1869 }
1870
1871 QByteArray hlpBufferCo;
1872
1873 // Orbit and Clock Corrections together
1874 // ------------------------------------
1875 if (_samplRtcmEphCorr == 0.0) {
1876 if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0
1877 || co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0
1878 || co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0
1879 || co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0
1880 || co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0
1881 || co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
1882 char obuffer[CLOCKORBIT_BUFFERSIZE];
1883 int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
1884 if (len > 0) {
1885 hlpBufferCo = QByteArray(obuffer, len);
1886 }
1887 }
1888 }
1889
1890 // Orbit and Clock Corrections separately
1891 // --------------------------------------
1892 else {
1893 if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
1894 char obuffer[CLOCKORBIT_BUFFERSIZE];
1895 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1896 co.UpdateInterval = ephUpdInd;
1897 int len1 = MakeClockOrbit(&co, COTYPE_GPSORBIT, 1, obuffer,
1898 sizeof(obuffer));
1899 co.UpdateInterval = clkUpdInd;
1900 if (len1 > 0) {
1901 hlpBufferCo += QByteArray(obuffer, len1);
1902 }
1903 }
1904 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) ? 1 : 0;
1905 int len2 = MakeClockOrbit(&co, COTYPE_GPSCLOCK, mmsg, obuffer,
1906 sizeof(obuffer));
1907 if (len2 > 0) {
1908 hlpBufferCo += QByteArray(obuffer, len2);
1909 }
1910 }
1911 if (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
1912 char obuffer[CLOCKORBIT_BUFFERSIZE];
1913 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1914 co.UpdateInterval = ephUpdInd;
1915 int len1 = MakeClockOrbit(&co, COTYPE_GLONASSORBIT, 1, obuffer,
1916 sizeof(obuffer));
1917 co.UpdateInterval = clkUpdInd;
1918 if (len1 > 0) {
1919 hlpBufferCo += QByteArray(obuffer, len1);
1920 }
1921 }
1922 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) ? 1 : 0;
1923 int len2 = MakeClockOrbit(&co, COTYPE_GLONASSCLOCK, mmsg, obuffer,
1924 sizeof(obuffer));
1925 if (len2 > 0) {
1926 hlpBufferCo += QByteArray(obuffer, len2);
1927 }
1928 }
1929 if (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) {
1930 char obuffer[CLOCKORBIT_BUFFERSIZE];
1931 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1932 co.UpdateInterval = ephUpdInd;
1933 int len1 = MakeClockOrbit(&co, COTYPE_GALILEOORBIT, 1, obuffer,
1934 sizeof(obuffer));
1935 co.UpdateInterval = clkUpdInd;
1936 if (len1 > 0) {
1937 hlpBufferCo += QByteArray(obuffer, len1);
1938 }
1939 }
1940 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) ? 1 : 0;
1941 int len2 = MakeClockOrbit(&co, COTYPE_GALILEOCLOCK, mmsg, obuffer,
1942 sizeof(obuffer));
1943 if (len2 > 0) {
1944 hlpBufferCo += QByteArray(obuffer, len2);
1945 }
1946 }
1947 if (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) {
1948 char obuffer[CLOCKORBIT_BUFFERSIZE];
1949 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1950 co.UpdateInterval = ephUpdInd;
1951 int len1 = MakeClockOrbit(&co, COTYPE_QZSSORBIT, 1, obuffer,
1952 sizeof(obuffer));
1953 co.UpdateInterval = clkUpdInd;
1954 if (len1 > 0) {
1955 hlpBufferCo += QByteArray(obuffer, len1);
1956 }
1957 }
1958 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) ? 1 : 0;
1959 int len2 = MakeClockOrbit(&co, COTYPE_QZSSCLOCK, mmsg, obuffer,
1960 sizeof(obuffer));
1961 if (len2 > 0) {
1962 hlpBufferCo += QByteArray(obuffer, len2);
1963 }
1964 }
1965 if (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) {
1966 char obuffer[CLOCKORBIT_BUFFERSIZE];
1967 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1968 co.UpdateInterval = ephUpdInd;
1969 int len1 = MakeClockOrbit(&co, COTYPE_SBASORBIT, 1, obuffer,
1970 sizeof(obuffer));
1971 co.UpdateInterval = clkUpdInd;
1972 if (len1 > 0) {
1973 hlpBufferCo += QByteArray(obuffer, len1);
1974 }
1975 }
1976 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) ? 1 : 0;
1977 int len2 = MakeClockOrbit(&co, COTYPE_SBASCLOCK, mmsg, obuffer,
1978 sizeof(obuffer));
1979 if (len2 > 0) {
1980 hlpBufferCo += QByteArray(obuffer, len2);
1981 }
1982 }
1983 if (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
1984 char obuffer[CLOCKORBIT_BUFFERSIZE];
1985 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
1986 co.UpdateInterval = ephUpdInd;
1987 int len1 = MakeClockOrbit(&co, COTYPE_BDSORBIT, 1, obuffer,
1988 sizeof(obuffer));
1989 co.UpdateInterval = clkUpdInd;
1990 if (len1 > 0) {
1991 hlpBufferCo += QByteArray(obuffer, len1);
1992 }
1993 }
1994 int len2 = MakeClockOrbit(&co, COTYPE_BDSCLOCK, 0, obuffer,
1995 sizeof(obuffer));
1996 if (len2 > 0) {
1997 hlpBufferCo += QByteArray(obuffer, len2);
1998 }
1999 }
2000 }
2001
2002 // Code Biases
2003 // -----------
2004 QByteArray hlpBufferBias;
2005 if (bias.NumberOfSat[CLOCKORBIT_SATGPS] > 0
2006 || bias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0
2007 || bias.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0
2008 || bias.NumberOfSat[CLOCKORBIT_SATQZSS] > 0
2009 || bias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0
2010 || bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
2011 char obuffer[CLOCKORBIT_BUFFERSIZE];
2012 int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
2013 if (len > 0) {
2014 hlpBufferBias = QByteArray(obuffer, len);
2015 }
2016 }
2017
2018 // Phase Biases
2019 // ------------
2020 QByteArray hlpBufferPhaseBias;
2021 if (phasebias.NumberOfSat[CLOCKORBIT_SATGPS] > 0
2022 || phasebias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0
2023 || phasebias.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0
2024 || phasebias.NumberOfSat[CLOCKORBIT_SATQZSS] > 0
2025 || phasebias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0
2026 || phasebias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
2027 char obuffer[CLOCKORBIT_BUFFERSIZE];
2028 int len = MakePhaseBias(&phasebias, PBTYPE_AUTO, 0, obuffer,
2029 sizeof(obuffer));
2030 if (len > 0) {
2031 hlpBufferPhaseBias = QByteArray(obuffer, len);
2032 }
2033 }
2034
2035 // VTEC
2036 // ----
2037 QByteArray hlpBufferVtec;
2038 if (vtec.NumLayers > 0) {
2039 char obuffer[CLOCKORBIT_BUFFERSIZE];
2040 int len = MakeVTEC(&vtec, 0, obuffer, sizeof(obuffer));
2041 if (len > 0) {
2042 hlpBufferVtec = QByteArray(obuffer, len);
2043 }
2044 }
2045
2046 _outBuffer += hlpBufferCo + hlpBufferBias + hlpBufferPhaseBias
2047 + hlpBufferVtec;
2048}
2049
2050//
2051////////////////////////////////////////////////////////////////////////////
2052void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
2053 double GPSweeks, const QString& prn, const ColumnVector& rtnAPC,
2054 double rtnClk, const ColumnVector& rtnVel, const ColumnVector& rtnCoM,
2055 struct ClockOrbit::SatData* sd, QString& outLine) {
2056
2057 // Broadcast Position and Velocity
2058 // -------------------------------
2059 ColumnVector xB(4);
2060 ColumnVector vB(3);
2061 eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
2062
2063 // Precise Position
2064 // ----------------
2065 ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
2066
2067 double dc = 0.0;
2068 if (_crdTrafo != "IGS08") {
2069 crdTrafo(GPSweek, xP, dc);
2070 }
2071
2072 // Difference in xyz
2073 // -----------------
2074 ColumnVector dx = xB.Rows(1, 3) - xP;
2075 ColumnVector dv = vB - rtnVel;
2076
2077 // Difference in RSW
2078 // -----------------
2079 ColumnVector rsw(3);
2080 XYZ_to_RSW(xB.Rows(1, 3), vB, dx, rsw);
2081
2082 ColumnVector dotRsw(3);
2083 XYZ_to_RSW(xB.Rows(1, 3), vB, dv, dotRsw);
2084
2085 // Clock Correction
2086 // ----------------
2087 double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
2088
2089 if (sd) {
2090 sd->ID = prn.mid(1).toInt();
2091 sd->IOD = eph->IOD();
2092 sd->Clock.DeltaA0 = dClk;
2093 sd->Clock.DeltaA1 = 0.0; // TODO
2094 sd->Clock.DeltaA2 = 0.0; // TODO
2095 sd->Orbit.DeltaRadial = rsw(1);
2096 sd->Orbit.DeltaAlongTrack = rsw(2);
2097 sd->Orbit.DeltaCrossTrack = rsw(3);
2098 sd->Orbit.DotDeltaRadial = dotRsw(1);
2099 sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
2100 sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
2101 }
2102
2103 outLine.sprintf("%d %.1f %s %u %10.3f %8.3f %8.3f %8.3f\n", GPSweek,
2104 GPSweeks, eph->prn().toString().c_str(), eph->IOD(), dClk, rsw(1), rsw(2),
2105 rsw(3));
2106
2107 double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
2108 double sp3Clk = (rtnClk - relativity) / t_CST::c; // in seconds
2109
2110 if (_rnx) {
2111 _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
2112 }
2113 if (_sp3) {
2114 _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
2115 }
2116}
2117
2118// Transform Coordinates
2119////////////////////////////////////////////////////////////////////////////
2120void bncRtnetUploadCaster::crdTrafo(int GPSWeek, ColumnVector& xyz,
2121 double& dc) {
2122
2123 // Current epoch minus 2000.0 in years
2124 // ------------------------------------
2125 double dt = (GPSWeek - (1042.0 + 6.0 / 7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
2126
2127 ColumnVector dx(3);
2128
2129 dx(1) = _dx + dt * _dxr;
2130 dx(2) = _dy + dt * _dyr;
2131 dx(3) = _dz + dt * _dzr;
2132
2133 static const double arcSec = 180.0 * 3600.0 / M_PI;
2134
2135 double ox = (_ox + dt * _oxr) / arcSec;
2136 double oy = (_oy + dt * _oyr) / arcSec;
2137 double oz = (_oz + dt * _ozr) / arcSec;
2138
2139 double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
2140
2141 // Specify approximate center of area
2142 // ----------------------------------
2143 ColumnVector meanSta(3);
2144
2145 if (_crdTrafo == "ETRF2000") {
2146 meanSta(1) = 3661090.0;
2147 meanSta(2) = 845230.0;
2148 meanSta(3) = 5136850.0;
2149 }
2150 else if (_crdTrafo == "NAD83") {
2151 meanSta(1) = -1092950.0;
2152 meanSta(2) = -4383600.0;
2153 meanSta(3) = 4487420.0;
2154 }
2155 else if (_crdTrafo == "GDA94") {
2156 meanSta(1) = -4052050.0;
2157 meanSta(2) = 4212840.0;
2158 meanSta(3) = -2545110.0;
2159 }
2160 else if (_crdTrafo == "SIRGAS2000") {
2161 meanSta(1) = 3740860.0;
2162 meanSta(2) = -4964290.0;
2163 meanSta(3) = -1425420.0;
2164 }
2165 else if (_crdTrafo == "SIRGAS95") {
2166 meanSta(1) = 3135390.0;
2167 meanSta(2) = -5017670.0;
2168 meanSta(3) = -2374440.0;
2169 }
2170 else if (_crdTrafo == "DREF91") {
2171 meanSta(1) = 3959579.0;
2172 meanSta(2) = 721719.0;
2173 meanSta(3) = 4931539.0;
2174 }
2175 else if (_crdTrafo == "Custom") {
2176 meanSta(1) = 0.0; // TODO
2177 meanSta(2) = 0.0; // TODO
2178 meanSta(3) = 0.0; // TODO
2179 }
2180
2181 // Clock correction proportional to topocentric distance to satellites
2182 // -------------------------------------------------------------------
2183 double rho = (xyz - meanSta).norm_Frobenius();
2184 dc = rho * (sc - 1.0) / sc / t_CST::c;
2185
2186 Matrix rMat(3, 3);
2187 rMat(1, 1) = 1.0;
2188 rMat(1, 2) = -oz;
2189 rMat(1, 3) = oy;
2190 rMat(2, 1) = oz;
2191 rMat(2, 2) = 1.0;
2192 rMat(2, 3) = -ox;
2193 rMat(3, 1) = -oy;
2194 rMat(3, 2) = ox;
2195 rMat(3, 3) = 1.0;
2196
2197 xyz = sc * rMat * xyz + dx;
2198}
2199
2200int bncRtnetUploadCaster::determineUpdateInd(double samplingRate) {
2201
2202 if (samplingRate == 10.0) {
2203 return 3;
2204 }
2205 else if (samplingRate == 15.0) {
2206 return 4;
2207 }
2208 else if (samplingRate == 30.0) {
2209 return 5;
2210 }
2211 else if (samplingRate == 60.0) {
2212 return 6;
2213 }
2214 else if (samplingRate == 120.0) {
2215 return 7;
2216 }
2217 else if (samplingRate == 240.0) {
2218 return 8;
2219 }
2220 else if (samplingRate == 300.0) {
2221 return 9;
2222 }
2223 else if (samplingRate == 600.0) {
2224 return 10;
2225 }
2226 else if (samplingRate == 900.0) {
2227 return 11;
2228 }
2229 else if (samplingRate == 1800.0) {
2230 return 12;
2231 }
2232 else if (samplingRate == 3600.0) {
2233 return 13;
2234 }
2235 else if (samplingRate == 7200.0) {
2236 return 14;
2237 }
2238 else if (samplingRate == 10800.0) {
2239 return 15;
2240 }
2241 return 2; // default
2242}
Note: See TracBrowser for help on using the repository browser.