source: ntrip/trunk/BNC/combination/bnccomb.cpp@ 3298

Last change on this file since 3298 was 3298, checked in by mervart, 13 years ago
File size: 19.5 KB
RevLine 
[2898]1/* -------------------------------------------------------------------------
2 * BKG NTRIP Client
3 * -------------------------------------------------------------------------
4 *
5 * Class: bncComb
6 *
7 * Purpose: Combinations of Orbit/Clock Corrections
8 *
9 * Author: L. Mervart
10 *
11 * Created: 22-Jan-2011
12 *
13 * Changes:
14 *
15 * -----------------------------------------------------------------------*/
16
[2933]17#include <newmatio.h>
[2921]18#include <iomanip>
[3214]19#include <sstream>
[2898]20
21#include "bnccomb.h"
22#include "bncapp.h"
[3201]23#include "upload/bncrtnetdecoder.h"
[2910]24#include "bncsettings.h"
[2933]25#include "bncmodel.h"
[2988]26#include "bncutils.h"
[3027]27#include "bncpppclient.h"
[3181]28#include "bncsp3.h"
[3052]29#include "bncantex.h"
[3055]30#include "bnctides.h"
[2898]31
32using namespace std;
33
[3134]34const int MAXPRN_GPS = 32;
35
[2898]36// Constructor
37////////////////////////////////////////////////////////////////////////////
[3032]38cmbParam::cmbParam(cmbParam::parType type_, int index_,
39 const QString& ac_, const QString& prn_,
40 double sig_0_, double sig_P_) {
41
42 type = type_;
43 index = index_;
44 AC = ac_;
45 prn = prn_;
46 sig_0 = sig_0_;
47 sig_P = sig_P_;
[2933]48 xx = 0.0;
49}
50
51// Destructor
52////////////////////////////////////////////////////////////////////////////
53cmbParam::~cmbParam() {
54}
55
56// Partial
57////////////////////////////////////////////////////////////////////////////
[3032]58double cmbParam::partial(const QString& AC_, t_corr* corr) {
[2933]59
[2934]60 if (type == AC_offset) {
[3032]61 if (AC == AC_) {
[2934]62 return 1.0;
63 }
64 }
65 else if (type == Sat_offset) {
[3032]66 if (AC == AC_ && prn == corr->prn) {
[2933]67 return 1.0;
68 }
69 }
70 else if (type == clk) {
71 if (prn == corr->prn) {
72 return 1.0;
73 }
74 }
75
76 return 0.0;
77}
78
[2990]79//
80////////////////////////////////////////////////////////////////////////////
81QString cmbParam::toString() const {
[2933]82
[2990]83 QString outStr;
84
85 if (type == AC_offset) {
[2992]86 outStr = "AC offset " + AC;
[2990]87 }
88 else if (type == Sat_offset) {
[2992]89 outStr = "Sat Offset " + AC + " " + prn;
[2990]90 }
91 else if (type == clk) {
[2992]92 outStr = "Clk Corr " + prn;
[2990]93 }
[2933]94
[2990]95 return outStr;
96}
97
[2933]98// Constructor
99////////////////////////////////////////////////////////////////////////////
[2898]100bncComb::bncComb() {
[2910]101
102 bncSettings settings;
103
104 QStringList combineStreams = settings.value("combineStreams").toStringList();
[2918]105
[3143]106 if (combineStreams.size() >= 1 && !combineStreams[0].isEmpty()) {
[2910]107 QListIterator<QString> it(combineStreams);
108 while (it.hasNext()) {
109 QStringList hlp = it.next().split(" ");
[2918]110 cmbAC* newAC = new cmbAC();
111 newAC->mountPoint = hlp[0];
112 newAC->name = hlp[1];
113 newAC->weight = hlp[2].toDouble();
[3064]114 if (_masterAC.isEmpty()) {
115 _masterAC = newAC->name;
116 }
[2918]117 _ACs[newAC->mountPoint] = newAC;
[2910]118 }
119 }
[2927]120
[3211]121 _rtnetDecoder = 0;
[3201]122
[2990]123 connect(this, SIGNAL(newMessage(QByteArray,bool)),
124 ((bncApp*)qApp), SLOT(slotMessage(const QByteArray,bool)));
[2933]125
[3032]126
127 // A Priori Sigmas (in Meters)
128 // ---------------------------
129 double sigAC_0 = 100.0;
130 double sigAC_P = 100.0;
131 double sigSat_0 = 100.0;
132 double sigSat_P = 0.0;
133 double sigClk_0 = 100.0;
134 double sigClk_P = 100.0;
135
136 // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
137 // ----------------------------------------------------------------------
[2933]138 int nextPar = 0;
[2991]139 QMapIterator<QString, cmbAC*> it(_ACs);
140 while (it.hasNext()) {
141 it.next();
142 cmbAC* AC = it.value();
[3134]143 _params.push_back(new cmbParam(cmbParam::AC_offset, ++nextPar,
144 AC->name, "", sigAC_0, sigAC_P));
145 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
146 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
147 _params.push_back(new cmbParam(cmbParam::Sat_offset, ++nextPar,
148 AC->name, prn, sigSat_0, sigSat_P));
[2991]149 }
150 }
[3134]151 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
[2933]152 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
[3032]153 _params.push_back(new cmbParam(cmbParam::clk, ++nextPar, "", prn,
154 sigClk_0, sigClk_P));
[2933]155 }
156
[3032]157 // Initialize Variance-Covariance Matrix
158 // -------------------------------------
159 _QQ.ReSize(_params.size());
[2933]160 _QQ = 0.0;
161 for (int iPar = 1; iPar <= _params.size(); iPar++) {
162 cmbParam* pp = _params[iPar-1];
[3032]163 _QQ(iPar,iPar) = pp->sig_0 * pp->sig_0;
[2933]164 }
[3035]165
[3052]166 // ANTEX File
167 // ----------
168 _antex = 0;
169 QString antexFileName = settings.value("pppAntex").toString();
170 if (!antexFileName.isEmpty()) {
171 _antex = new bncAntex();
172 if (_antex->readFile(antexFileName) != success) {
173 emit newMessage("wrong ANTEX file", true);
174 delete _antex;
175 _antex = 0;
176 }
177 }
[3138]178
179 // Not yet regularized
180 // -------------------
181 _firstReg = false;
[2898]182}
183
184// Destructor
185////////////////////////////////////////////////////////////////////////////
186bncComb::~bncComb() {
[2918]187 QMapIterator<QString, cmbAC*> it(_ACs);
188 while (it.hasNext()) {
189 it.next();
190 delete it.value();
191 }
[3201]192 delete _rtnetDecoder;
[3052]193 delete _antex;
[3296]194 for (int iPar = 1; iPar <= _params.size(); iPar++) {
195 delete _params[iPar-1];
196 }
[2898]197}
198
[2928]199// Read and store one correction line
[2898]200////////////////////////////////////////////////////////////////////////////
201void bncComb::processCorrLine(const QString& staID, const QString& line) {
[2906]202 QMutexLocker locker(&_mutex);
[2913]203
[2918]204 // Find the relevant instance of cmbAC class
205 // -----------------------------------------
206 if (_ACs.find(staID) == _ACs.end()) {
207 return;
208 }
209 cmbAC* AC = _ACs[staID];
210
211 // Read the Correction
212 // -------------------
[2913]213 t_corr* newCorr = new t_corr();
214 if (!newCorr->readLine(line) == success) {
215 delete newCorr;
216 return;
217 }
218
[3274]219 // Check Modulo Time
220 // -----------------
221 const int moduloTime = 10;
222 if (int(newCorr->tt.gpssec()) % moduloTime != 0.0) {
223 delete newCorr;
224 return;
225 }
226
[2924]227 // Reject delayed corrections
228 // --------------------------
229 if (_processedBeforeTime.valid() && newCorr->tt < _processedBeforeTime) {
230 delete newCorr;
231 return;
232 }
233
[3029]234 // Check the Ephemeris
235 //--------------------
[2986]236 if (_eph.find(newCorr->prn) == _eph.end()) {
237 delete newCorr;
238 return;
239 }
240 else {
241 t_eph* lastEph = _eph[newCorr->prn]->last;
242 t_eph* prevEph = _eph[newCorr->prn]->prev;
[3029]243 if (lastEph && lastEph->IOD() == newCorr->iod) {
244 newCorr->eph = lastEph;
[2986]245 }
[3029]246 else if (prevEph && prevEph->IOD() == newCorr->iod) {
247 newCorr->eph = prevEph;
248 }
249 else {
[2986]250 delete newCorr;
251 return;
252 }
253 }
254
[2924]255 // Process all older Epochs (if there are any)
256 // -------------------------------------------
[3276]257 const double waitTime = moduloTime;
[2924]258 _processedBeforeTime = newCorr->tt - waitTime;
259
[2927]260 QList<cmbEpoch*> epochsToProcess;
261
262 QMapIterator<QString, cmbAC*> itAC(_ACs);
263 while (itAC.hasNext()) {
264 itAC.next();
265 cmbAC* AC = itAC.value();
266
267 QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
268 while (itEpo.hasNext()) {
269 cmbEpoch* epoch = itEpo.next();
270 if (epoch->time < _processedBeforeTime) {
271 epochsToProcess.append(epoch);
272 itEpo.remove();
273 }
274 }
275 }
276
277 if (epochsToProcess.size()) {
278 processEpochs(epochsToProcess);
279 }
280
[2918]281 // Find/Create the instance of cmbEpoch class
282 // ------------------------------------------
283 cmbEpoch* newEpoch = 0;
284 QListIterator<cmbEpoch*> it(AC->epochs);
285 while (it.hasNext()) {
286 cmbEpoch* hlpEpoch = it.next();
287 if (hlpEpoch->time == newCorr->tt) {
288 newEpoch = hlpEpoch;
289 break;
290 }
291 }
292 if (newEpoch == 0) {
[2927]293 newEpoch = new cmbEpoch(AC->name);
[2918]294 newEpoch->time = newCorr->tt;
295 AC->epochs.append(newEpoch);
296 }
[2924]297
298 // Merge or add the correction
299 // ---------------------------
[2918]300 if (newEpoch->corr.find(newCorr->prn) != newEpoch->corr.end()) {
[2919]301 newEpoch->corr[newCorr->prn]->readLine(line); // merge (multiple messages)
[3298]302 delete newCorr;
[2918]303 }
[2919]304 else {
305 newEpoch->corr[newCorr->prn] = newCorr;
306 }
[2898]307}
308
[2986]309// Change the correction so that it refers to last received ephemeris
310////////////////////////////////////////////////////////////////////////////
[3029]311void bncComb::switchToLastEph(const t_eph* lastEph, t_corr* corr) {
[3028]312
[2987]313 ColumnVector oldXC(4);
314 ColumnVector oldVV(3);
[3029]315 corr->eph->position(corr->tt.gpsw(), corr->tt.gpssec(),
316 oldXC.data(), oldVV.data());
[2988]317
[2987]318 ColumnVector newXC(4);
319 ColumnVector newVV(3);
[3029]320 lastEph->position(corr->tt.gpsw(), corr->tt.gpssec(),
[2987]321 newXC.data(), newVV.data());
[2988]322
323 ColumnVector dX = newXC.Rows(1,3) - oldXC.Rows(1,3);
[2989]324 ColumnVector dV = newVV - oldVV;
325 double dC = newXC(4) - oldXC(4);
326
[2988]327 ColumnVector dRAO(3);
328 XYZ_to_RSW(newXC.Rows(1,3), newVV, dX, dRAO);
[2989]329
330 ColumnVector dDotRAO(3);
331 XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
332
[3029]333 QString msg = "switch " + corr->prn
334 + QString(" %1 -> %2 %3").arg(corr->iod,3)
[3013]335 .arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
336
[3029]337 emit newMessage(msg.toAscii(), false);
[3028]338
[3029]339 corr->iod = lastEph->IOD();
340 corr->eph = lastEph;
[3031]341 corr->rao += dRAO;
342 corr->dotRao += dDotRAO;
[3029]343 corr->dClk -= dC;
[2986]344}
345
[2928]346// Process Epochs
347////////////////////////////////////////////////////////////////////////////
[2927]348void bncComb::processEpochs(const QList<cmbEpoch*>& epochs) {
[2918]349
[2990]350 _log.clear();
351
352 QTextStream out(&_log, QIODevice::WriteOnly);
353
[2991]354 out << "Combination:" << endl
[3275]355 << "------------------------------" << endl;
[2990]356
[3277]357 // Check whether master AC present
358 // -------------------------------
359 if (epochs.first()->acName != _masterAC) {
360 QListIterator<cmbEpoch*> itEpo(epochs);
361 while (itEpo.hasNext()) {
362 cmbEpoch* epo = itEpo.next();
363 bncTime epoTime = epo->time;
364 out << epo->acName.toAscii().data() << " "
365 << epoTime.datestr().c_str() << " "
366 << epoTime.timestr().c_str() << endl;
367 delete epo;
368 }
369 out << "Missing Master AC" << endl;
370 emit newMessage(_log, false);
371 return;
372 }
373
[2933]374 // Predict Parameters Values, Add White Noise
375 // ------------------------------------------
376 for (int iPar = 1; iPar <= _params.size(); iPar++) {
377 cmbParam* pp = _params[iPar-1];
[3032]378 if (pp->sig_P != 0.0) {
[2933]379 pp->xx = 0.0;
380 for (int jj = 1; jj <= _params.size(); jj++) {
381 _QQ(iPar, jj) = 0.0;
382 }
[3032]383 _QQ(iPar,iPar) = pp->sig_P * pp->sig_P;
[2933]384 }
385 }
386
[2928]387 bncTime resTime = epochs.first()->time;
388 QMap<QString, t_corr*> resCorr;
389
[2933]390 int nPar = _params.size();
391 int nObs = 0;
392
393 ColumnVector x0(nPar);
394 for (int iPar = 1; iPar <= _params.size(); iPar++) {
395 cmbParam* pp = _params[iPar-1];
396 x0(iPar) = pp->xx;
397 }
398
399 // Count Observations
400 // ------------------
[2927]401 QListIterator<cmbEpoch*> itEpo(epochs);
402 while (itEpo.hasNext()) {
[3274]403 cmbEpoch* epo = itEpo.next();
404 bncTime epoTime = epo->time;
[3275]405 out << epo->acName.toAscii().data() << " "
406 << epoTime.datestr().c_str() << " "
407 << epoTime.timestr().c_str() << endl;
[3274]408
[3029]409 QMutableMapIterator<QString, t_corr*> itCorr(epo->corr);
[2927]410 while (itCorr.hasNext()) {
411 itCorr.next();
[3029]412 t_corr* corr = itCorr.value();
413
[3032]414 // Switch to last ephemeris
415 // ------------------------
[3029]416 t_eph* lastEph = _eph[corr->prn]->last;
417 if (lastEph == corr->eph) {
418 ++nObs;
419 }
420 else {
421 if (corr->eph == _eph[corr->prn]->prev) {
422 switchToLastEph(lastEph, corr);
423 ++nObs;
424 }
425 else {
426 itCorr.remove();
427 }
428 }
[2933]429 }
430 }
[2928]431
[2933]432 if (nObs > 0) {
[3135]433 const double Pl = 1.0 / (0.05 * 0.05);
434
[3140]435 const int nCon = (_firstReg == false) ? 1 + MAXPRN_GPS : 1;
[3134]436 Matrix AA(nObs+nCon, nPar); AA = 0.0;
437 ColumnVector ll(nObs+nCon); ll = 0.0;
[3135]438 DiagonalMatrix PP(nObs+nCon); PP = Pl;
[2933]439
440 int iObs = 0;
441 QListIterator<cmbEpoch*> itEpo(epochs);
442 while (itEpo.hasNext()) {
443 cmbEpoch* epo = itEpo.next();
444 QMapIterator<QString, t_corr*> itCorr(epo->corr);
445
446 while (itCorr.hasNext()) {
447 itCorr.next();
448 ++iObs;
449 t_corr* corr = itCorr.value();
450
[3032]451 if (epo->acName == _masterAC) {
[2933]452 resCorr[corr->prn] = new t_corr(*corr);
453 }
454
455 for (int iPar = 1; iPar <= _params.size(); iPar++) {
456 cmbParam* pp = _params[iPar-1];
457 AA(iObs, iPar) = pp->partial(epo->acName, corr);
458 }
459
460 ll(iObs) = corr->dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
[3034]461 }
[2933]462 }
[2928]463
[3134]464 // Regularization
465 // --------------
466 const double Ph = 1.e6;
467 int iCond = 1;
468 PP(nObs+iCond) = Ph;
469 for (int iPar = 1; iPar <= _params.size(); iPar++) {
470 cmbParam* pp = _params[iPar-1];
[3136]471 if (pp->type == cmbParam::clk &&
472 AA.Column(iPar).maximum_absolute_value() > 0.0) {
473 AA(nObs+iCond, iPar) = 1.0;
[3134]474 }
475 }
476
[3138]477 if (!_firstReg) {
478 _firstReg = true;
479 for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
480 ++iCond;
481 QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
482 PP(nObs+1+iGps) = Ph;
483 for (int iPar = 1; iPar <= _params.size(); iPar++) {
484 cmbParam* pp = _params[iPar-1];
485 if (pp->type == cmbParam::Sat_offset && pp->prn == prn) {
486 AA(nObs+iCond, iPar) = 1.0;
487 }
[3134]488 }
489 }
490 }
491
[3081]492 const double MAXRES = 999.10; // TODO: make it an option
[3080]493
[2933]494 ColumnVector dx;
[3080]495 SymmetricMatrix QQ_sav = _QQ;
[2933]496
[3080]497 for (int ii = 1; ii < 10; ii++) {
498 bncModel::kalman(AA, ll, PP, _QQ, dx);
499 ColumnVector vv = ll - AA * dx;
500
501 int maxResIndex;
502 double maxRes = vv.maximum_absolute_value1(maxResIndex);
503 out.setRealNumberNotation(QTextStream::FixedNotation);
504 out.setRealNumberPrecision(3);
505 out << "Maximum Residuum " << maxRes << " (index " << maxResIndex << ")\n";
506
507 if (maxRes > MAXRES) {
508 out << "Outlier Detected" << endl;
509 _QQ = QQ_sav;
510 AA.Row(maxResIndex) = 0.0;
511 ll.Row(maxResIndex) = 0.0;
512 }
513 else {
514 break;
515 }
516 }
517
[2933]518 for (int iPar = 1; iPar <= _params.size(); iPar++) {
519 cmbParam* pp = _params[iPar-1];
520 pp->xx += dx(iPar);
[2935]521 if (pp->type == cmbParam::clk) {
[2936]522 if (resCorr.find(pp->prn) != resCorr.end()) {
523 resCorr[pp->prn]->dClk = pp->xx / t_CST::c;
524 }
[2935]525 }
[3011]526 out << currentDateAndTimeGPS().toString("yy-MM-dd hh:mm:ss ").toAscii().data();
[2990]527 out.setRealNumberNotation(QTextStream::FixedNotation);
528 out.setFieldWidth(8);
529 out.setRealNumberPrecision(4);
530 out << pp->toString() << " "
[2991]531 << pp->xx << " +- " << sqrt(_QQ(pp->index,pp->index)) << endl;
[2918]532 }
533 }
[2919]534
[3015]535 printResults(out, resTime, resCorr);
[2928]536 dumpResults(resTime, resCorr);
537
[2990]538 emit newMessage(_log, false);
[3296]539
540 QListIterator<cmbEpoch*> itEpo2(epochs);
541 while (itEpo2.hasNext()) {
542 cmbEpoch* epo = itEpo2.next();
543 delete epo;
544 }
[2918]545}
[3011]546
[3201]547// Print results
[3011]548////////////////////////////////////////////////////////////////////////////
[3015]549void bncComb::printResults(QTextStream& out, const bncTime& resTime,
[3011]550 const QMap<QString, t_corr*>& resCorr) {
551
552 QMapIterator<QString, t_corr*> it(resCorr);
553 while (it.hasNext()) {
554 it.next();
555 t_corr* corr = it.value();
[3029]556 const t_eph* eph = corr->eph;
[3015]557 if (eph) {
558 double xx, yy, zz, cc;
559 eph->position(resTime.gpsw(), resTime.gpssec(), xx, yy, zz, cc);
560
561 out << currentDateAndTimeGPS().toString("yy-MM-dd hh:mm:ss ").toAscii().data();
562 out.setFieldWidth(3);
563 out << "Full Clock " << corr->prn << " " << corr->iod << " ";
564 out.setFieldWidth(14);
565 out << (cc + corr->dClk) * t_CST::c << endl;
566 }
567 else {
568 out << "bncComb::printResuls bug" << endl;
569 }
[3011]570 }
571}
[3202]572
573// Send results to RTNet Decoder and directly to PPP Client
574////////////////////////////////////////////////////////////////////////////
575void bncComb::dumpResults(const bncTime& resTime,
576 const QMap<QString, t_corr*>& resCorr) {
577
[3214]578 ostringstream out; out.setf(std::ios::fixed);
[3216]579 QStringList corrLines;
[3214]580
581 unsigned year, month, day, hour, minute;
582 double sec;
583 resTime.civil_date(year, month, day);
584 resTime.civil_time(hour, minute, sec);
585
586 out << "* "
587 << setw(4) << year << " "
588 << setw(2) << month << " "
589 << setw(2) << day << " "
590 << setw(2) << hour << " "
591 << setw(2) << minute << " "
592 << setw(12) << setprecision(8) << sec << " "
593 << endl;
594
[3202]595 QMapIterator<QString, t_corr*> it(resCorr);
596 while (it.hasNext()) {
597 it.next();
598 t_corr* corr = it.value();
599
[3214]600 double dT = 60.0;
[3202]601
[3214]602 for (int iTime = 1; iTime <= 2; iTime++) {
603
604 bncTime time12 = (iTime == 1) ? resTime : resTime + dT;
605
606 ColumnVector xc(4);
607 ColumnVector vv(3);
608 corr->eph->position(time12.gpsw(), time12.gpssec(),
609 xc.data(), vv.data());
610 bncPPPclient::applyCorr(time12, corr, xc, vv);
611
612 // Relativistic Correction
613 // -----------------------
614 double relCorr = - 2.0 * DotProduct(xc.Rows(1,3),vv) / t_CST::c / t_CST::c;
615 xc(4) -= relCorr;
616
617 // Code Biases
618 // -----------
619 double dcbP1C1 = 0.0;
620 double dcbP1P2 = 0.0;
621
622 // Correction Phase Center --> CoM
623 // -------------------------------
624 ColumnVector dx(3); dx = 0.0;
625 if (_antex) {
626 double Mjd = time12.mjd() + time12.daysec()/86400.0;
627 if (_antex->satCoMcorrection(corr->prn, Mjd, xc.Rows(1,3), dx) == success) {
628 xc(1) -= dx(1);
629 xc(2) -= dx(2);
630 xc(3) -= dx(3);
631 }
632 else {
633 cout << "antenna not found" << endl;
634 }
635 }
636
637 if (iTime == 1) {
638 out << 'P' << corr->prn.toAscii().data()
639 << setw(14) << setprecision(6) << xc(1) / 1000.0
640 << setw(14) << setprecision(6) << xc(2) / 1000.0
641 << setw(14) << setprecision(6) << xc(3) / 1000.0
642 << setw(14) << setprecision(6) << xc(4) * 1e6
643 << setw(14) << setprecision(6) << relCorr * 1e6
644 << setw(8) << setprecision(3) << dx(1)
645 << setw(8) << setprecision(3) << dx(2)
646 << setw(8) << setprecision(3) << dx(3)
647 << setw(8) << setprecision(3) << dcbP1C1
648 << setw(8) << setprecision(3) << dcbP1P2
649 << setw(6) << setprecision(1) << dT;
[3216]650
[3218]651 QString line;
[3217]652 int messageType = COTYPE_GPSCOMBINED;
[3218]653 int updateInt = 0;
654 line.sprintf("%d %d %d %.1f %s"
655 " %3d"
656 " %8.3f %8.3f %8.3f %8.3f"
657 " %10.5f %10.5f %10.5f %10.5f"
[3262]658 " %10.5f %10.5f %10.5f %10.5f INTERNAL",
[3218]659 messageType, updateInt, time12.gpsw(), time12.gpssec(),
660 corr->prn.toAscii().data(),
661 corr->iod,
[3219]662 corr->dClk * t_CST::c,
[3218]663 corr->rao[0],
664 corr->rao[1],
665 corr->rao[2],
[3219]666 corr->dotDClk * t_CST::c,
[3218]667 corr->dotRao[0],
668 corr->dotRao[1],
669 corr->dotRao[2],
[3262]670 corr->dotDotDClk * t_CST::c,
671 corr->dotDotRao[0],
672 corr->dotDotRao[1],
673 corr->dotDotRao[2]);
[3220]674 corrLines << line;
[3214]675 }
676 else {
677 out << setw(14) << setprecision(6) << xc(1) / 1000.0
678 << setw(14) << setprecision(6) << xc(2) / 1000.0
679 << setw(14) << setprecision(6) << xc(3) / 1000.0 << endl;
680 }
681 }
682
683 delete corr;
684 }
[3228]685 out << "EOE" << endl; // End Of Epoch flag
[3214]686
[3215]687 if (!_rtnetDecoder) {
688 _rtnetDecoder = new bncRtnetDecoder();
689 }
[3221]690
[3215]691 vector<string> errmsg;
[3221]692 _rtnetDecoder->Decode((char*) out.str().data(), out.str().size(), errmsg);
[3215]693
[3216]694 // Optionally send new Corrections to PPP
695 // --------------------------------------
696 bncApp* app = (bncApp*) qApp;
697 if (app->_bncPPPclient) {
698 app->_bncPPPclient->slotNewCorrections(corrLines);
699 }
[3202]700}
Note: See TracBrowser for help on using the repository browser.