[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 | *
|
---|
[7297] | 13 | * Changes:
|
---|
[2898] | 14 | *
|
---|
| 15 | * -----------------------------------------------------------------------*/
|
---|
| 16 |
|
---|
[2933] | 17 | #include <newmatio.h>
|
---|
[2921] | 18 | #include <iomanip>
|
---|
[3214] | 19 | #include <sstream>
|
---|
[2898] | 20 |
|
---|
| 21 | #include "bnccomb.h"
|
---|
[5070] | 22 | #include "bnccore.h"
|
---|
[3201] | 23 | #include "upload/bncrtnetdecoder.h"
|
---|
[2910] | 24 | #include "bncsettings.h"
|
---|
[2988] | 25 | #include "bncutils.h"
|
---|
[3181] | 26 | #include "bncsp3.h"
|
---|
[3052] | 27 | #include "bncantex.h"
|
---|
[5742] | 28 | #include "t_prn.h"
|
---|
[2898] | 29 |
|
---|
[3455] | 30 | const double sig0_offAC = 1000.0;
|
---|
| 31 | const double sig0_offACSat = 100.0;
|
---|
[3468] | 32 | const double sigP_offACSat = 0.01;
|
---|
[3455] | 33 | const double sig0_clkSat = 100.0;
|
---|
| 34 |
|
---|
| 35 | const double sigObs = 0.05;
|
---|
| 36 |
|
---|
| 37 | using namespace std;
|
---|
| 38 |
|
---|
[2898] | 39 | // Constructor
|
---|
| 40 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 41 | bncComb::cmbParam::cmbParam(parType type_, int index_, const QString& ac_, const QString& prn_) {
|
---|
[3032] | 42 |
|
---|
[3433] | 43 | type = type_;
|
---|
| 44 | index = index_;
|
---|
| 45 | AC = ac_;
|
---|
| 46 | prn = prn_;
|
---|
| 47 | xx = 0.0;
|
---|
[3455] | 48 | eph = 0;
|
---|
[3429] | 49 |
|
---|
[9258] | 50 | if (type == offACgnss) {
|
---|
[3455] | 51 | epoSpec = true;
|
---|
| 52 | sig0 = sig0_offAC;
|
---|
| 53 | sigP = sig0;
|
---|
[3429] | 54 | }
|
---|
| 55 | else if (type == offACSat) {
|
---|
[3455] | 56 | epoSpec = false;
|
---|
| 57 | sig0 = sig0_offACSat;
|
---|
| 58 | sigP = sigP_offACSat;
|
---|
[3429] | 59 | }
|
---|
| 60 | else if (type == clkSat) {
|
---|
[3455] | 61 | epoSpec = true;
|
---|
| 62 | sig0 = sig0_clkSat;
|
---|
| 63 | sigP = sig0;
|
---|
[3429] | 64 | }
|
---|
[2933] | 65 | }
|
---|
| 66 |
|
---|
| 67 | // Destructor
|
---|
| 68 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 69 | bncComb::cmbParam::~cmbParam() {
|
---|
[2933] | 70 | }
|
---|
| 71 |
|
---|
| 72 | // Partial
|
---|
| 73 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 74 | double bncComb::cmbParam::partial(char sys, const QString& AC_, const QString& prn_) {
|
---|
[7297] | 75 |
|
---|
[9258] | 76 | if (type == offACgnss) {
|
---|
| 77 | if (AC == AC_ && prn_[0].toLatin1() == sys) {
|
---|
[2934] | 78 | return 1.0;
|
---|
| 79 | }
|
---|
| 80 | }
|
---|
[3429] | 81 | else if (type == offACSat) {
|
---|
| 82 | if (AC == AC_ && prn == prn_) {
|
---|
[2933] | 83 | return 1.0;
|
---|
| 84 | }
|
---|
| 85 | }
|
---|
[3429] | 86 | else if (type == clkSat) {
|
---|
| 87 | if (prn == prn_) {
|
---|
[2933] | 88 | return 1.0;
|
---|
| 89 | }
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | return 0.0;
|
---|
| 93 | }
|
---|
| 94 |
|
---|
[7297] | 95 | //
|
---|
[2990] | 96 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 97 | QString bncComb::cmbParam::toString(char sys) const {
|
---|
[2933] | 98 |
|
---|
[2990] | 99 | QString outStr;
|
---|
[7297] | 100 |
|
---|
[9258] | 101 | if (type == offACgnss) {
|
---|
[9262] | 102 | outStr = "AC Offset " + AC + " " + sys + " ";
|
---|
[2990] | 103 | }
|
---|
[3429] | 104 | else if (type == offACSat) {
|
---|
[7008] | 105 | outStr = "Sat Offset " + AC + " " + prn.mid(0,3);
|
---|
[2990] | 106 | }
|
---|
[3429] | 107 | else if (type == clkSat) {
|
---|
[7008] | 108 | outStr = "Clk Corr " + prn.mid(0,3);
|
---|
[2990] | 109 | }
|
---|
[2933] | 110 |
|
---|
[2990] | 111 | return outStr;
|
---|
| 112 | }
|
---|
| 113 |
|
---|
[7299] | 114 | // Singleton
|
---|
| 115 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 116 | bncComb* bncComb::instance() {
|
---|
| 117 | static bncComb _bncComb;
|
---|
| 118 | return &_bncComb;
|
---|
| 119 | }
|
---|
| 120 |
|
---|
[2933] | 121 | // Constructor
|
---|
| 122 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6443] | 123 | bncComb::bncComb() : _ephUser(true) {
|
---|
[2910] | 124 |
|
---|
| 125 | bncSettings settings;
|
---|
| 126 |
|
---|
[7297] | 127 | QStringList cmbStreams = settings.value("cmbStreams").toStringList();
|
---|
[2918] | 128 |
|
---|
[4183] | 129 | _cmbSampl = settings.value("cmbSampl").toInt();
|
---|
| 130 | if (_cmbSampl <= 0) {
|
---|
| 131 | _cmbSampl = 10;
|
---|
| 132 | }
|
---|
| 133 |
|
---|
[9258] | 134 | _cmbSysPrn['G'] = t_prn::MAXPRN_GPS; _masterMissingEpochs['G'] = 0;
|
---|
| 135 | _cmbSysPrn['R'] = t_prn::MAXPRN_GLONASS; _masterMissingEpochs['R'] = 0;
|
---|
| 136 | _cmbSysPrn['E'] = t_prn::MAXPRN_GALILEO; _masterMissingEpochs['E'] = 0;
|
---|
| 137 | _cmbSysPrn['C'] = t_prn::MAXPRN_BDS; _masterMissingEpochs['C'] = 0;/*
|
---|
| 138 | _cmbSysPrn['J'] = t_prn::MAXPRN_QZSS; _masterMissingEpochs['J'] = 0;
|
---|
| 139 | _cmbSysPrn['S'] = t_prn::MAXPRN_SBAS; _masterMissingEpochs['S'] = 0;
|
---|
| 140 | */
|
---|
[3455] | 141 |
|
---|
[7297] | 142 | if (cmbStreams.size() >= 1 && !cmbStreams[0].isEmpty()) {
|
---|
| 143 | QListIterator<QString> it(cmbStreams);
|
---|
[2910] | 144 | while (it.hasNext()) {
|
---|
| 145 | QStringList hlp = it.next().split(" ");
|
---|
[2918] | 146 | cmbAC* newAC = new cmbAC();
|
---|
| 147 | newAC->mountPoint = hlp[0];
|
---|
| 148 | newAC->name = hlp[1];
|
---|
| 149 | newAC->weight = hlp[2].toDouble();
|
---|
[9258] | 150 | QMapIterator<char, unsigned> itSys(_cmbSysPrn);
|
---|
| 151 | // init
|
---|
| 152 | while (itSys.hasNext()) {
|
---|
| 153 | itSys.next();
|
---|
| 154 | char sys = itSys.key();
|
---|
| 155 | if (_masterOrbitAC.isEmpty()) {
|
---|
| 156 | _masterOrbitAC[sys] = newAC->name;
|
---|
| 157 | }
|
---|
[3453] | 158 | }
|
---|
[3429] | 159 | _ACs.append(newAC);
|
---|
[2910] | 160 | }
|
---|
| 161 | }
|
---|
[2927] | 162 |
|
---|
[9025] | 163 | QString ssrFormat;
|
---|
[9258] | 164 | _ssrCorr = 0;
|
---|
[9025] | 165 | QListIterator<QString> it(settings.value("uploadMountpointsOut").toStringList());
|
---|
| 166 | while (it.hasNext()) {
|
---|
| 167 | QStringList hlp = it.next().split(",");
|
---|
| 168 | if (hlp.size() > 7) {
|
---|
| 169 | ssrFormat = hlp[7];
|
---|
| 170 | }
|
---|
| 171 | }
|
---|
| 172 | if (ssrFormat == "IGS-SSR") {
|
---|
| 173 | _ssrCorr = new SsrCorrIgs();
|
---|
| 174 | }
|
---|
| 175 | else if (ssrFormat == "RTCM-SSR") {
|
---|
| 176 | _ssrCorr = new SsrCorrRtcm();
|
---|
| 177 | }
|
---|
[9258] | 178 | else { // default
|
---|
| 179 | _ssrCorr = new SsrCorrIgs();
|
---|
| 180 | }
|
---|
[9025] | 181 |
|
---|
[3211] | 182 | _rtnetDecoder = 0;
|
---|
[3201] | 183 |
|
---|
[7297] | 184 | connect(this, SIGNAL(newMessage(QByteArray,bool)),
|
---|
[5068] | 185 | BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
|
---|
[2933] | 186 |
|
---|
[5583] | 187 | connect(BNC_CORE, SIGNAL(providerIDChanged(QString)),
|
---|
[6155] | 188 | this, SLOT(slotProviderIDChanged(QString)));
|
---|
[5583] | 189 |
|
---|
[6155] | 190 | connect(BNC_CORE, SIGNAL(newOrbCorrections(QList<t_orbCorr>)),
|
---|
| 191 | this, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
|
---|
| 192 |
|
---|
| 193 | connect(BNC_CORE, SIGNAL(newClkCorrections(QList<t_clkCorr>)),
|
---|
| 194 | this, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
|
---|
| 195 |
|
---|
[3470] | 196 | // Combination Method
|
---|
| 197 | // ------------------
|
---|
[3481] | 198 | if (settings.value("cmbMethod").toString() == "Single-Epoch") {
|
---|
| 199 | _method = singleEpoch;
|
---|
[3470] | 200 | }
|
---|
| 201 | else {
|
---|
[3481] | 202 | _method = filter;
|
---|
[3470] | 203 | }
|
---|
[3032] | 204 |
|
---|
| 205 | // Initialize Parameters (model: Clk_Corr = AC_Offset + Sat_Offset + Clk)
|
---|
| 206 | // ----------------------------------------------------------------------
|
---|
[3470] | 207 | if (_method == filter) {
|
---|
[9258] | 208 | // SYSTEM
|
---|
| 209 | QMapIterator<char, unsigned> itSys(_cmbSysPrn);
|
---|
| 210 | while (itSys.hasNext()) {
|
---|
| 211 | itSys.next();
|
---|
| 212 | int nextPar = 0;
|
---|
| 213 | char sys = itSys.key();
|
---|
| 214 | unsigned maxPrn = itSys.value();
|
---|
| 215 | unsigned flag = 0;
|
---|
| 216 | if (sys == 'E') {
|
---|
| 217 | flag = 1;
|
---|
[3470] | 218 | }
|
---|
[9258] | 219 | // AC
|
---|
| 220 | QListIterator<cmbAC*> itAc(_ACs);
|
---|
| 221 | while (itAc.hasNext()) {
|
---|
| 222 | cmbAC* AC = itAc.next();
|
---|
| 223 | _params[sys].push_back(new cmbParam(cmbParam::offACgnss, ++nextPar, AC->name, ""));
|
---|
| 224 | for (unsigned iGnss = 1; iGnss <= maxPrn; iGnss++) {
|
---|
| 225 | QString prn = QString("%1%2_%3").arg(sys).arg(iGnss, 2, 10, QChar('0')).arg(flag);
|
---|
| 226 | _params[sys].push_back(new cmbParam(cmbParam::offACSat, ++nextPar, AC->name, prn));
|
---|
[3483] | 227 | }
|
---|
| 228 | }
|
---|
[9258] | 229 | for (unsigned iGnss = 1; iGnss <= maxPrn; iGnss++) {
|
---|
| 230 | QString prn = QString("%1%2_%3").arg(sys).arg(iGnss, 2, 10, QChar('0')).arg(flag);
|
---|
| 231 | _params[sys].push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
|
---|
[3483] | 232 | }
|
---|
[9258] | 233 | // Initialize Variance-Covariance Matrix
|
---|
| 234 | // -------------------------------------
|
---|
| 235 | _QQ[sys].ReSize(_params[sys].size());
|
---|
| 236 | _QQ[sys] = 0.0;
|
---|
| 237 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 238 | cmbParam* pp = _params[sys][iPar-1];
|
---|
| 239 | _QQ[sys](iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
| 240 | }
|
---|
[3483] | 241 | }
|
---|
[2991] | 242 | }
|
---|
[2933] | 243 |
|
---|
[3052] | 244 | // ANTEX File
|
---|
| 245 | // ----------
|
---|
| 246 | _antex = 0;
|
---|
[6667] | 247 | QString antexFileName = settings.value("uploadAntexFile").toString();
|
---|
[3052] | 248 | if (!antexFileName.isEmpty()) {
|
---|
| 249 | _antex = new bncAntex();
|
---|
| 250 | if (_antex->readFile(antexFileName) != success) {
|
---|
| 251 | emit newMessage("wrong ANTEX file", true);
|
---|
| 252 | delete _antex;
|
---|
| 253 | _antex = 0;
|
---|
| 254 | }
|
---|
| 255 | }
|
---|
[3138] | 256 |
|
---|
[3329] | 257 | // Maximal Residuum
|
---|
| 258 | // ----------------
|
---|
| 259 | _MAXRES = settings.value("cmbMaxres").toDouble();
|
---|
| 260 | if (_MAXRES <= 0.0) {
|
---|
| 261 | _MAXRES = 999.0;
|
---|
| 262 | }
|
---|
[2898] | 263 | }
|
---|
| 264 |
|
---|
| 265 | // Destructor
|
---|
| 266 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 267 | bncComb::~bncComb() {
|
---|
[3429] | 268 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 269 | while (icAC.hasNext()) {
|
---|
| 270 | delete icAC.next();
|
---|
[2918] | 271 | }
|
---|
[3201] | 272 | delete _rtnetDecoder;
|
---|
[9025] | 273 | if (_ssrCorr) {
|
---|
| 274 | delete _ssrCorr;
|
---|
| 275 | }
|
---|
[3052] | 276 | delete _antex;
|
---|
[9258] | 277 | QMapIterator<char, unsigned> itSys(_cmbSysPrn);
|
---|
| 278 | while (itSys.hasNext()) {
|
---|
| 279 | itSys.next();
|
---|
| 280 | char sys = itSys.key();
|
---|
| 281 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 282 | delete _params[sys][iPar-1];
|
---|
| 283 | }
|
---|
| 284 | QListIterator<bncTime> itTime(_buffer[sys].keys());
|
---|
| 285 | while (itTime.hasNext()) {
|
---|
| 286 | bncTime epoTime = itTime.next();
|
---|
| 287 | _buffer[sys].remove(epoTime);
|
---|
| 288 | }
|
---|
[3296] | 289 | }
|
---|
[9258] | 290 |
|
---|
[2898] | 291 | }
|
---|
| 292 |
|
---|
[6155] | 293 | // Remember orbit corrections
|
---|
[2898] | 294 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6155] | 295 | void bncComb::slotNewOrbCorrections(QList<t_orbCorr> orbCorrections) {
|
---|
[2906] | 296 | QMutexLocker locker(&_mutex);
|
---|
[2913] | 297 |
|
---|
[6155] | 298 | for (int ii = 0; ii < orbCorrections.size(); ii++) {
|
---|
| 299 | t_orbCorr& orbCorr = orbCorrections[ii];
|
---|
| 300 | QString staID(orbCorr._staID.c_str());
|
---|
[7008] | 301 | QString prn(orbCorr._prn.toInternalString().c_str());
|
---|
[6155] | 302 |
|
---|
| 303 | // Find/Check the AC Name
|
---|
| 304 | // ----------------------
|
---|
| 305 | QString acName;
|
---|
| 306 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 307 | while (icAC.hasNext()) {
|
---|
| 308 | cmbAC* AC = icAC.next();
|
---|
| 309 | if (AC->mountPoint == staID) {
|
---|
| 310 | acName = AC->name;
|
---|
| 311 | break;
|
---|
| 312 | }
|
---|
[3431] | 313 | }
|
---|
[6155] | 314 | if (acName.isEmpty()) {
|
---|
| 315 | continue;
|
---|
| 316 | }
|
---|
[3431] | 317 |
|
---|
[6155] | 318 | // Store the correction
|
---|
| 319 | // --------------------
|
---|
| 320 | QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
|
---|
| 321 | storage[orbCorr._prn] = orbCorr;
|
---|
[2913] | 322 | }
|
---|
[6155] | 323 | }
|
---|
[2913] | 324 |
|
---|
[6155] | 325 | // Process clock corrections
|
---|
| 326 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 327 | void bncComb::slotNewClkCorrections(QList<t_clkCorr> clkCorrections) {
|
---|
| 328 | QMutexLocker locker(&_mutex);
|
---|
| 329 |
|
---|
| 330 | bncTime lastTime;
|
---|
| 331 |
|
---|
| 332 | for (int ii = 0; ii < clkCorrections.size(); ii++) {
|
---|
| 333 | t_clkCorr& clkCorr = clkCorrections[ii];
|
---|
| 334 | QString staID(clkCorr._staID.c_str());
|
---|
[6961] | 335 | QString prn(clkCorr._prn.toInternalString().c_str());
|
---|
[9258] | 336 | char sys = clkCorr._prn.system();
|
---|
[6155] | 337 |
|
---|
| 338 | // Set the last time
|
---|
| 339 | // -----------------
|
---|
| 340 | if (lastTime.undef() || clkCorr._time > lastTime) {
|
---|
| 341 | lastTime = clkCorr._time;
|
---|
[3483] | 342 | }
|
---|
| 343 |
|
---|
[6155] | 344 | // Find/Check the AC Name
|
---|
| 345 | // ----------------------
|
---|
| 346 | QString acName;
|
---|
| 347 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 348 | while (icAC.hasNext()) {
|
---|
| 349 | cmbAC* AC = icAC.next();
|
---|
| 350 | if (AC->mountPoint == staID) {
|
---|
| 351 | acName = AC->name;
|
---|
| 352 | break;
|
---|
| 353 | }
|
---|
[3588] | 354 | }
|
---|
[6155] | 355 | if (acName.isEmpty()) {
|
---|
| 356 | continue;
|
---|
| 357 | }
|
---|
[3588] | 358 |
|
---|
[6155] | 359 | // Check Modulo Time
|
---|
| 360 | // -----------------
|
---|
[8447] | 361 | int sec = int(nint(clkCorr._time.gpssec()*10));
|
---|
| 362 | if (sec % (_cmbSampl*10) != 0.0) {
|
---|
[6155] | 363 | continue;
|
---|
| 364 | }
|
---|
[3274] | 365 |
|
---|
[6155] | 366 | // Check Correction Age
|
---|
| 367 | // --------------------
|
---|
| 368 | if (_resTime.valid() && clkCorr._time <= _resTime) {
|
---|
[8204] | 369 | emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + prn.mid(0,3).toLatin1(), true);
|
---|
[6155] | 370 | continue;
|
---|
| 371 | }
|
---|
[7297] | 372 |
|
---|
[6155] | 373 | // Create new correction
|
---|
| 374 | // ---------------------
|
---|
| 375 | cmbCorr* newCorr = new cmbCorr();
|
---|
[6157] | 376 | newCorr->_prn = prn;
|
---|
[6155] | 377 | newCorr->_time = clkCorr._time;
|
---|
| 378 | newCorr->_iod = clkCorr._iod;
|
---|
| 379 | newCorr->_acName = acName;
|
---|
[6159] | 380 | newCorr->_clkCorr = clkCorr;
|
---|
[6155] | 381 |
|
---|
[6156] | 382 | // Check orbit correction
|
---|
| 383 | // ----------------------
|
---|
| 384 | if (!_orbCorrections.contains(acName)) {
|
---|
| 385 | delete newCorr;
|
---|
| 386 | continue;
|
---|
| 387 | }
|
---|
| 388 | else {
|
---|
| 389 | QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
|
---|
[9258] | 390 | if (!storage.contains(clkCorr._prn) ||
|
---|
| 391 | storage[clkCorr._prn]._iod != newCorr->_iod) {
|
---|
[6156] | 392 | delete newCorr;
|
---|
| 393 | continue;
|
---|
| 394 | }
|
---|
| 395 | else {
|
---|
[6159] | 396 | newCorr->_orbCorr = storage[clkCorr._prn];
|
---|
[6156] | 397 | }
|
---|
| 398 | }
|
---|
| 399 |
|
---|
[6155] | 400 | // Check the Ephemeris
|
---|
| 401 | //--------------------
|
---|
[7012] | 402 | t_eph* ephLast = _ephUser.ephLast(prn);
|
---|
| 403 | t_eph* ephPrev = _ephUser.ephPrev(prn);
|
---|
[6443] | 404 | if (ephLast == 0) {
|
---|
[9265] | 405 | emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1(), true);
|
---|
[6155] | 406 | delete newCorr;
|
---|
| 407 | continue;
|
---|
[2986] | 408 | }
|
---|
[9268] | 409 | else if (ephLast->checkState() == t_eph::bad ||
|
---|
| 410 | ephLast->checkState() == t_eph::outdated ||
|
---|
| 411 | ephLast->checkState() == t_eph::unhealthy) {
|
---|
| 412 | emit newMessage("bncComb: ephLast not ok for " + prn.mid(0,3).toLatin1(), true);
|
---|
[9266] | 413 | delete newCorr;
|
---|
| 414 | continue;
|
---|
| 415 | }
|
---|
[3029] | 416 | else {
|
---|
[6443] | 417 | if (ephLast->IOD() == newCorr->_iod) {
|
---|
| 418 | newCorr->_eph = ephLast;
|
---|
[6155] | 419 | }
|
---|
[9268] | 420 | else if (ephPrev && ephPrev->checkState() == t_eph::ok &&
|
---|
| 421 | ephPrev->IOD() == newCorr->_iod) {
|
---|
[6443] | 422 | newCorr->_eph = ephPrev;
|
---|
| 423 | switchToLastEph(ephLast, newCorr);
|
---|
[6155] | 424 | }
|
---|
| 425 | else {
|
---|
[9265] | 426 | emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1() +
|
---|
| 427 | QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true);
|
---|
[6155] | 428 | delete newCorr;
|
---|
| 429 | continue;
|
---|
| 430 | }
|
---|
[2986] | 431 | }
|
---|
[6155] | 432 |
|
---|
| 433 | // Store correction into the buffer
|
---|
| 434 | // --------------------------------
|
---|
[9258] | 435 | QVector<cmbCorr*>& corrs = _buffer[sys][newCorr->_time].corrs;
|
---|
[6155] | 436 | corrs.push_back(newCorr);
|
---|
[2986] | 437 | }
|
---|
| 438 |
|
---|
[3435] | 439 | // Process previous Epoch(s)
|
---|
| 440 | // -------------------------
|
---|
[7392] | 441 | const double outWait = 1.0 * _cmbSampl;
|
---|
[9258] | 442 | QMapIterator<char, unsigned> itSys(_cmbSysPrn);
|
---|
| 443 | while (itSys.hasNext()) {
|
---|
| 444 | itSys.next();
|
---|
| 445 | char sys = itSys.key();
|
---|
| 446 | QListIterator<bncTime> itTime(_buffer[sys].keys());
|
---|
| 447 | while (itTime.hasNext()) {
|
---|
| 448 | bncTime epoTime = itTime.next();
|
---|
| 449 | if (epoTime < lastTime - outWait) {
|
---|
| 450 | _resTime = epoTime;
|
---|
| 451 | processEpoch(sys);
|
---|
| 452 | }
|
---|
[3435] | 453 | }
|
---|
[2927] | 454 | }
|
---|
[2898] | 455 | }
|
---|
| 456 |
|
---|
[7297] | 457 | // Change the correction so that it refers to last received ephemeris
|
---|
[2986] | 458 | ////////////////////////////////////////////////////////////////////////////
|
---|
[7012] | 459 | void bncComb::switchToLastEph(t_eph* lastEph, cmbCorr* corr) {
|
---|
[3028] | 460 |
|
---|
[6155] | 461 | if (corr->_eph == lastEph) {
|
---|
[3429] | 462 | return;
|
---|
| 463 | }
|
---|
[9266] | 464 |
|
---|
[8542] | 465 | ColumnVector oldXC(6);
|
---|
[2987] | 466 | ColumnVector oldVV(3);
|
---|
[9266] | 467 | if (corr->_eph->getCrd(corr->_time, oldXC, oldVV, false) != success) {
|
---|
| 468 | return;
|
---|
| 469 | }
|
---|
[2988] | 470 |
|
---|
[8542] | 471 | ColumnVector newXC(6);
|
---|
[2987] | 472 | ColumnVector newVV(3);
|
---|
[9266] | 473 | if (lastEph->getCrd(corr->_time, newXC, newVV, false) != success) {
|
---|
| 474 | return;
|
---|
| 475 | }
|
---|
[2988] | 476 |
|
---|
| 477 | ColumnVector dX = newXC.Rows(1,3) - oldXC.Rows(1,3);
|
---|
[2989] | 478 | ColumnVector dV = newVV - oldVV;
|
---|
| 479 | double dC = newXC(4) - oldXC(4);
|
---|
[9266] | 480 |
|
---|
[2988] | 481 | ColumnVector dRAO(3);
|
---|
| 482 | XYZ_to_RSW(newXC.Rows(1,3), newVV, dX, dRAO);
|
---|
[2989] | 483 |
|
---|
| 484 | ColumnVector dDotRAO(3);
|
---|
| 485 | XYZ_to_RSW(newXC.Rows(1,3), newVV, dV, dDotRAO);
|
---|
| 486 |
|
---|
[6963] | 487 | QString msg = "switch corr " + corr->_prn.mid(0,3)
|
---|
[6155] | 488 | + QString(" %1 -> %2 %3").arg(corr->_iod,3).arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
|
---|
[3013] | 489 |
|
---|
[8204] | 490 | emit newMessage(msg.toLatin1(), false);
|
---|
[3028] | 491 |
|
---|
[6155] | 492 | corr->_iod = lastEph->IOD();
|
---|
| 493 | corr->_eph = lastEph;
|
---|
| 494 |
|
---|
[6159] | 495 | corr->_orbCorr._xr += dRAO;
|
---|
| 496 | corr->_orbCorr._dotXr += dDotRAO;
|
---|
| 497 | corr->_clkCorr._dClk -= dC;
|
---|
[2986] | 498 | }
|
---|
| 499 |
|
---|
[3429] | 500 | // Process Epoch
|
---|
[2928] | 501 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 502 | void bncComb::processEpoch(char sys) {
|
---|
[2918] | 503 |
|
---|
[2990] | 504 | _log.clear();
|
---|
| 505 |
|
---|
| 506 | QTextStream out(&_log, QIODevice::WriteOnly);
|
---|
| 507 |
|
---|
[9258] | 508 | out << endl << "Combination: " << sys << endl
|
---|
| 509 | << "--------------------------------" << endl;
|
---|
[2990] | 510 |
|
---|
[3433] | 511 | // Observation Statistics
|
---|
| 512 | // ----------------------
|
---|
[3455] | 513 | bool masterPresent = false;
|
---|
[3433] | 514 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 515 | while (icAC.hasNext()) {
|
---|
| 516 | cmbAC* AC = icAC.next();
|
---|
[9258] | 517 | AC->numObs[sys] = 0;
|
---|
| 518 | QVectorIterator<cmbCorr*> itCorr(corrs(sys));
|
---|
[3433] | 519 | while (itCorr.hasNext()) {
|
---|
| 520 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 521 | if (corr->_acName == AC->name) {
|
---|
[9258] | 522 | AC->numObs[sys] += 1;
|
---|
| 523 | if (AC->name == _masterOrbitAC[sys]) {
|
---|
[3453] | 524 | masterPresent = true;
|
---|
| 525 | }
|
---|
[3433] | 526 | }
|
---|
| 527 | }
|
---|
[9258] | 528 | out << AC->name.toLatin1().data() << ": " << AC->numObs[sys] << endl;
|
---|
[3433] | 529 | }
|
---|
| 530 |
|
---|
[3453] | 531 | // If Master not present, switch to another one
|
---|
| 532 | // --------------------------------------------
|
---|
[4889] | 533 | const unsigned switchMasterAfterGap = 1;
|
---|
[3456] | 534 | if (masterPresent) {
|
---|
[9258] | 535 | _masterMissingEpochs[sys] = 0;
|
---|
[3456] | 536 | }
|
---|
| 537 | else {
|
---|
[9258] | 538 | ++_masterMissingEpochs[sys];
|
---|
| 539 | if (_masterMissingEpochs[sys] < switchMasterAfterGap) {
|
---|
[3457] | 540 | out << "Missing Master, Epoch skipped" << endl;
|
---|
[9258] | 541 | _buffer[sys].remove(_resTime);
|
---|
[3455] | 542 | emit newMessage(_log, false);
|
---|
| 543 | return;
|
---|
[3453] | 544 | }
|
---|
[3455] | 545 | else {
|
---|
[9258] | 546 | _masterMissingEpochs[sys] = 0;
|
---|
[3455] | 547 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 548 | while (icAC.hasNext()) {
|
---|
| 549 | cmbAC* AC = icAC.next();
|
---|
[9258] | 550 | if (AC->numObs[sys] > 0) {
|
---|
[3455] | 551 | out << "Switching Master AC "
|
---|
[9258] | 552 | << _masterOrbitAC[sys].toLatin1().data() << " --> "
|
---|
[8204] | 553 | << AC->name.toLatin1().data() << " "
|
---|
[7297] | 554 | << _resTime.datestr().c_str() << " "
|
---|
[3455] | 555 | << _resTime.timestr().c_str() << endl;
|
---|
[9258] | 556 | _masterOrbitAC[sys] = AC->name;
|
---|
[3455] | 557 | break;
|
---|
| 558 | }
|
---|
[3452] | 559 | }
|
---|
| 560 | }
|
---|
| 561 | }
|
---|
| 562 |
|
---|
[6157] | 563 | QMap<QString, cmbCorr*> resCorr;
|
---|
[3472] | 564 |
|
---|
| 565 | // Perform the actual Combination using selected Method
|
---|
| 566 | // ----------------------------------------------------
|
---|
| 567 | t_irc irc;
|
---|
[3475] | 568 | ColumnVector dx;
|
---|
[3472] | 569 | if (_method == filter) {
|
---|
[9258] | 570 | irc = processEpoch_filter(sys, out, resCorr, dx);
|
---|
[3472] | 571 | }
|
---|
| 572 | else {
|
---|
[9258] | 573 | irc = processEpoch_singleEpoch(sys, out, resCorr, dx);
|
---|
[3472] | 574 | }
|
---|
| 575 |
|
---|
[3475] | 576 | // Update Parameter Values, Print Results
|
---|
| 577 | // --------------------------------------
|
---|
[3472] | 578 | if (irc == success) {
|
---|
[9258] | 579 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 580 | cmbParam* pp = _params[sys][iPar-1];
|
---|
[3475] | 581 | pp->xx += dx(iPar);
|
---|
| 582 | if (pp->type == cmbParam::clkSat) {
|
---|
| 583 | if (resCorr.find(pp->prn) != resCorr.end()) {
|
---|
[6160] | 584 | resCorr[pp->prn]->_dClkResult = pp->xx / t_CST::c;
|
---|
[3475] | 585 | }
|
---|
| 586 | }
|
---|
[7297] | 587 | out << _resTime.datestr().c_str() << " "
|
---|
[3475] | 588 | << _resTime.timestr().c_str() << " ";
|
---|
| 589 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
| 590 | out.setFieldWidth(8);
|
---|
| 591 | out.setRealNumberPrecision(4);
|
---|
[9258] | 592 | out << pp->toString(sys) << " "
|
---|
| 593 | << pp->xx << " +- " << sqrt(_QQ[sys](pp->index,pp->index)) << endl;
|
---|
[3475] | 594 | out.setFieldWidth(0);
|
---|
| 595 | }
|
---|
[3472] | 596 | printResults(out, resCorr);
|
---|
| 597 | dumpResults(resCorr);
|
---|
| 598 | }
|
---|
| 599 |
|
---|
| 600 | // Delete Data, emit Message
|
---|
| 601 | // -------------------------
|
---|
[9258] | 602 | _buffer[sys].remove(_resTime);
|
---|
[3472] | 603 | emit newMessage(_log, false);
|
---|
| 604 | }
|
---|
| 605 |
|
---|
| 606 | // Process Epoch - Filter Method
|
---|
| 607 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 608 | t_irc bncComb::processEpoch_filter(char sys, QTextStream& out,
|
---|
[6157] | 609 | QMap<QString, cmbCorr*>& resCorr,
|
---|
[3475] | 610 | ColumnVector& dx) {
|
---|
[3472] | 611 |
|
---|
[3429] | 612 | // Prediction Step
|
---|
| 613 | // ---------------
|
---|
[9258] | 614 | int nPar = _params[sys].size();
|
---|
[2933] | 615 | ColumnVector x0(nPar);
|
---|
[9258] | 616 | for (int iPar = 1; iPar <= nPar; iPar++) {
|
---|
| 617 | cmbParam* pp = _params[sys][iPar-1];
|
---|
[3455] | 618 | if (pp->epoSpec) {
|
---|
[3451] | 619 | pp->xx = 0.0;
|
---|
[9258] | 620 | _QQ[sys].Row(iPar) = 0.0;
|
---|
| 621 | _QQ[sys].Column(iPar) = 0.0;
|
---|
| 622 | _QQ[sys](iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
[3451] | 623 | }
|
---|
[3455] | 624 | else {
|
---|
[9258] | 625 | _QQ[sys](iPar,iPar) += pp->sigP * pp->sigP;
|
---|
[3455] | 626 | }
|
---|
[2933] | 627 | x0(iPar) = pp->xx;
|
---|
| 628 | }
|
---|
| 629 |
|
---|
[3487] | 630 | // Check Satellite Positions for Outliers
|
---|
| 631 | // --------------------------------------
|
---|
[9258] | 632 | if (checkOrbits(sys, out) != success) {
|
---|
[3487] | 633 | return failure;
|
---|
| 634 | }
|
---|
[3441] | 635 |
|
---|
[3455] | 636 | // Update and outlier detection loop
|
---|
| 637 | // ---------------------------------
|
---|
[9258] | 638 | SymmetricMatrix QQ_sav = _QQ[sys];
|
---|
[3455] | 639 | while (true) {
|
---|
[3135] | 640 |
|
---|
[3455] | 641 | Matrix AA;
|
---|
| 642 | ColumnVector ll;
|
---|
| 643 | DiagonalMatrix PP;
|
---|
[3429] | 644 |
|
---|
[9258] | 645 | if (createAmat(sys, AA, ll, PP, x0, resCorr) != success) {
|
---|
[3472] | 646 | return failure;
|
---|
[3441] | 647 | }
|
---|
[2933] | 648 |
|
---|
[6169] | 649 | dx.ReSize(nPar); dx = 0.0;
|
---|
[9258] | 650 | kalman(AA, ll, PP, _QQ[sys], dx);
|
---|
[6164] | 651 |
|
---|
[3429] | 652 | ColumnVector vv = ll - AA * dx;
|
---|
[3080] | 653 |
|
---|
[3429] | 654 | int maxResIndex;
|
---|
[7297] | 655 | double maxRes = vv.maximum_absolute_value1(maxResIndex);
|
---|
[3429] | 656 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 657 | out.setRealNumberPrecision(3);
|
---|
[3429] | 658 | out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
|
---|
[3432] | 659 | << " Maximum Residuum " << maxRes << ' '
|
---|
[9258] | 660 | << corrs(sys)[maxResIndex-1]->_acName << ' ' << corrs(sys)[maxResIndex-1]->_prn.mid(0,3);
|
---|
[3432] | 661 | if (maxRes > _MAXRES) {
|
---|
[9258] | 662 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 663 | cmbParam* pp = _params[sys][iPar-1];
|
---|
[7297] | 664 | if (pp->type == cmbParam::offACSat &&
|
---|
[9258] | 665 | pp->AC == corrs(sys)[maxResIndex-1]->_acName &&
|
---|
| 666 | pp->prn == corrs(sys)[maxResIndex-1]->_prn.mid(0,3)) {
|
---|
[3432] | 667 | QQ_sav.Row(iPar) = 0.0;
|
---|
| 668 | QQ_sav.Column(iPar) = 0.0;
|
---|
[3455] | 669 | QQ_sav(iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
[3432] | 670 | }
|
---|
| 671 | }
|
---|
| 672 |
|
---|
| 673 | out << " Outlier" << endl;
|
---|
[9258] | 674 | _QQ[sys] = QQ_sav;
|
---|
| 675 | corrs(sys).remove(maxResIndex-1);
|
---|
[3432] | 676 | }
|
---|
| 677 | else {
|
---|
| 678 | out << " OK" << endl;
|
---|
[6330] | 679 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
| 680 | out.setRealNumberPrecision(4);
|
---|
[9258] | 681 | for (int ii = 0; ii < corrs(sys).size(); ii++) {
|
---|
| 682 | const cmbCorr* corr = corrs(sys)[ii];
|
---|
[6330] | 683 | out << _resTime.datestr().c_str() << ' '
|
---|
| 684 | << _resTime.timestr().c_str() << " "
|
---|
[6962] | 685 | << corr->_acName << ' ' << corr->_prn.mid(0,3);
|
---|
[6330] | 686 | out.setFieldWidth(10);
|
---|
| 687 | out << " res = " << vv[ii] << endl;
|
---|
| 688 | out.setFieldWidth(0);
|
---|
| 689 | }
|
---|
[3432] | 690 | break;
|
---|
| 691 | }
|
---|
| 692 | }
|
---|
| 693 |
|
---|
[3472] | 694 | return success;
|
---|
[2918] | 695 | }
|
---|
[3011] | 696 |
|
---|
[3201] | 697 | // Print results
|
---|
[3011] | 698 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3429] | 699 | void bncComb::printResults(QTextStream& out,
|
---|
[6157] | 700 | const QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3011] | 701 |
|
---|
[6157] | 702 | QMapIterator<QString, cmbCorr*> it(resCorr);
|
---|
[3011] | 703 | while (it.hasNext()) {
|
---|
| 704 | it.next();
|
---|
[6157] | 705 | cmbCorr* corr = it.value();
|
---|
| 706 | const t_eph* eph = corr->_eph;
|
---|
[3015] | 707 | if (eph) {
|
---|
[8542] | 708 | ColumnVector xc(6);
|
---|
[6109] | 709 | ColumnVector vv(3);
|
---|
[9268] | 710 | if (eph->getCrd(_resTime, xc, vv, false) != success) {
|
---|
| 711 | continue;
|
---|
| 712 | }
|
---|
[7297] | 713 | out << _resTime.datestr().c_str() << " "
|
---|
[3429] | 714 | << _resTime.timestr().c_str() << " ";
|
---|
[3015] | 715 | out.setFieldWidth(3);
|
---|
[6962] | 716 | out << "Full Clock " << corr->_prn.mid(0,3) << " " << corr->_iod << " ";
|
---|
[3015] | 717 | out.setFieldWidth(14);
|
---|
[6160] | 718 | out << (xc(4) + corr->_dClkResult) * t_CST::c << endl;
|
---|
[3370] | 719 | out.setFieldWidth(0);
|
---|
[3015] | 720 | }
|
---|
| 721 | else {
|
---|
| 722 | out << "bncComb::printResuls bug" << endl;
|
---|
| 723 | }
|
---|
[3011] | 724 | }
|
---|
| 725 | }
|
---|
[3202] | 726 |
|
---|
| 727 | // Send results to RTNet Decoder and directly to PPP Client
|
---|
| 728 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6157] | 729 | void bncComb::dumpResults(const QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3202] | 730 |
|
---|
[6161] | 731 | QList<t_orbCorr> orbCorrections;
|
---|
| 732 | QList<t_clkCorr> clkCorrections;
|
---|
| 733 |
|
---|
[5337] | 734 | QString outLines;
|
---|
[3214] | 735 |
|
---|
| 736 | unsigned year, month, day, hour, minute;
|
---|
| 737 | double sec;
|
---|
[3429] | 738 | _resTime.civil_date(year, month, day);
|
---|
| 739 | _resTime.civil_time(hour, minute, sec);
|
---|
[3214] | 740 |
|
---|
[7297] | 741 | outLines.sprintf("* %4d %2d %2d %d %d %12.8f\n",
|
---|
[5337] | 742 | year, month, day, hour, minute, sec);
|
---|
[3214] | 743 |
|
---|
[6157] | 744 | QMapIterator<QString, cmbCorr*> it(resCorr);
|
---|
[3202] | 745 | while (it.hasNext()) {
|
---|
| 746 | it.next();
|
---|
[6157] | 747 | cmbCorr* corr = it.value();
|
---|
[3202] | 748 |
|
---|
[7013] | 749 | t_orbCorr orbCorr(corr->_orbCorr);
|
---|
| 750 | orbCorr._staID = "INTERNAL";
|
---|
| 751 | orbCorrections.push_back(orbCorr);
|
---|
| 752 |
|
---|
| 753 | t_clkCorr clkCorr(corr->_clkCorr);
|
---|
| 754 | clkCorr._staID = "INTERNAL";
|
---|
| 755 | clkCorr._dClk = corr->_dClkResult;
|
---|
| 756 | clkCorr._dotDClk = 0.0;
|
---|
| 757 | clkCorr._dotDotDClk = 0.0;
|
---|
| 758 | clkCorrections.push_back(clkCorr);
|
---|
| 759 |
|
---|
[8542] | 760 | ColumnVector xc(6);
|
---|
[4978] | 761 | ColumnVector vv(3);
|
---|
[7013] | 762 | corr->_eph->setClkCorr(dynamic_cast<const t_clkCorr*>(&clkCorr));
|
---|
| 763 | corr->_eph->setOrbCorr(dynamic_cast<const t_orbCorr*>(&orbCorr));
|
---|
[9268] | 764 | if (corr->_eph->getCrd(_resTime, xc, vv, true) != success) {
|
---|
| 765 | delete corr;
|
---|
| 766 | continue;
|
---|
| 767 | }
|
---|
[7012] | 768 |
|
---|
[4978] | 769 | // Correction Phase Center --> CoM
|
---|
| 770 | // -------------------------------
|
---|
| 771 | ColumnVector dx(3); dx = 0.0;
|
---|
| 772 | if (_antex) {
|
---|
| 773 | double Mjd = _resTime.mjd() + _resTime.daysec()/86400.0;
|
---|
[6157] | 774 | if (_antex->satCoMcorrection(corr->_prn, Mjd, xc.Rows(1,3), dx) != success) {
|
---|
[4992] | 775 | dx = 0;
|
---|
[8204] | 776 | _log += "antenna not found " + corr->_prn.mid(0,3).toLatin1() + '\n';
|
---|
[3214] | 777 | }
|
---|
| 778 | }
|
---|
[7012] | 779 |
|
---|
| 780 | outLines += corr->_prn.mid(0,3);
|
---|
[5337] | 781 | QString hlp;
|
---|
| 782 | hlp.sprintf(" APC 3 %15.4f %15.4f %15.4f"
|
---|
| 783 | " Clk 1 %15.4f"
|
---|
| 784 | " Vel 3 %15.4f %15.4f %15.4f"
|
---|
| 785 | " CoM 3 %15.4f %15.4f %15.4f\n",
|
---|
[7012] | 786 | xc(1), xc(2), xc(3),
|
---|
| 787 | xc(4) * t_CST::c,
|
---|
[5337] | 788 | vv(1), vv(2), vv(3),
|
---|
| 789 | xc(1)-dx(1), xc(2)-dx(2), xc(3)-dx(3));
|
---|
| 790 | outLines += hlp;
|
---|
| 791 |
|
---|
[4978] | 792 | QString line;
|
---|
[9025] | 793 | int messageType = _ssrCorr->COTYPE_GPSCOMBINED;
|
---|
[5564] | 794 | int updateInt = 0;
|
---|
[4978] | 795 | line.sprintf("%d %d %d %.1f %s"
|
---|
[7055] | 796 | " %lu"
|
---|
[4978] | 797 | " %8.3f %8.3f %8.3f %8.3f"
|
---|
| 798 | " %10.5f %10.5f %10.5f %10.5f"
|
---|
[5576] | 799 | " %10.5f INTERNAL",
|
---|
[4978] | 800 | messageType, updateInt, _resTime.gpsw(), _resTime.gpssec(),
|
---|
[8204] | 801 | corr->_prn.mid(0,3).toLatin1().data(),
|
---|
[6157] | 802 | corr->_iod,
|
---|
[6160] | 803 | corr->_dClkResult * t_CST::c,
|
---|
[6159] | 804 | corr->_orbCorr._xr[0],
|
---|
| 805 | corr->_orbCorr._xr[1],
|
---|
| 806 | corr->_orbCorr._xr[2],
|
---|
[6157] | 807 | 0.0,
|
---|
[6159] | 808 | corr->_orbCorr._dotXr[0],
|
---|
| 809 | corr->_orbCorr._dotXr[1],
|
---|
| 810 | corr->_orbCorr._dotXr[2],
|
---|
[6157] | 811 | 0.0);
|
---|
[4978] | 812 |
|
---|
[3214] | 813 | delete corr;
|
---|
| 814 | }
|
---|
| 815 |
|
---|
[5337] | 816 | outLines += "EOE\n"; // End Of Epoch flag
|
---|
| 817 |
|
---|
[3215] | 818 | if (!_rtnetDecoder) {
|
---|
| 819 | _rtnetDecoder = new bncRtnetDecoder();
|
---|
| 820 | }
|
---|
[3221] | 821 |
|
---|
[3215] | 822 | vector<string> errmsg;
|
---|
[8204] | 823 | _rtnetDecoder->Decode(outLines.toLatin1().data(), outLines.length(), errmsg);
|
---|
[3215] | 824 |
|
---|
[5861] | 825 | // Send new Corrections to PPP etc.
|
---|
| 826 | // --------------------------------
|
---|
[6161] | 827 | if (orbCorrections.size() > 0 && clkCorrections.size() > 0) {
|
---|
| 828 | emit newOrbCorrections(orbCorrections);
|
---|
| 829 | emit newClkCorrections(clkCorrections);
|
---|
| 830 | }
|
---|
[3202] | 831 | }
|
---|
[3455] | 832 |
|
---|
| 833 | // Create First Design Matrix and Vector of Measurements
|
---|
| 834 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 835 | t_irc bncComb::createAmat(char sys, Matrix& AA, ColumnVector& ll, DiagonalMatrix& PP,
|
---|
| 836 | const ColumnVector& x0, QMap<QString, cmbCorr*>& resCorr) {
|
---|
[3455] | 837 |
|
---|
[9258] | 838 | unsigned nPar = _params[sys].size();
|
---|
| 839 | unsigned nObs = corrs(sys).size();
|
---|
[3455] | 840 |
|
---|
| 841 | if (nObs == 0) {
|
---|
| 842 | return failure;
|
---|
| 843 | }
|
---|
| 844 |
|
---|
[9258] | 845 | int maxSat = _cmbSysPrn[sys];
|
---|
[3455] | 846 |
|
---|
[9259] | 847 | const int nCon = (_method == filter) ? 1 + maxSat : 0;
|
---|
[3483] | 848 |
|
---|
[3455] | 849 | AA.ReSize(nObs+nCon, nPar); AA = 0.0;
|
---|
| 850 | ll.ReSize(nObs+nCon); ll = 0.0;
|
---|
| 851 | PP.ReSize(nObs+nCon); PP = 1.0 / (sigObs * sigObs);
|
---|
| 852 |
|
---|
| 853 | int iObs = 0;
|
---|
[9258] | 854 | QVectorIterator<cmbCorr*> itCorr(corrs(sys));
|
---|
[3455] | 855 | while (itCorr.hasNext()) {
|
---|
| 856 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 857 | QString prn = corr->_prn;
|
---|
[3487] | 858 |
|
---|
[3455] | 859 | ++iObs;
|
---|
| 860 |
|
---|
[9258] | 861 | if (corr->_acName == _masterOrbitAC[sys] && resCorr.find(prn) == resCorr.end()) {
|
---|
[6157] | 862 | resCorr[prn] = new cmbCorr(*corr);
|
---|
[3455] | 863 | }
|
---|
| 864 |
|
---|
[9258] | 865 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 866 | cmbParam* pp = _params[sys][iPar-1];
|
---|
| 867 | AA(iObs, iPar) = pp->partial(sys, corr->_acName, prn);
|
---|
[3455] | 868 | }
|
---|
| 869 |
|
---|
[6160] | 870 | ll(iObs) = corr->_clkCorr._dClk * t_CST::c - DotProduct(AA.Row(iObs), x0);
|
---|
[3455] | 871 | }
|
---|
| 872 |
|
---|
| 873 | // Regularization
|
---|
| 874 | // --------------
|
---|
[3474] | 875 | if (_method == filter) {
|
---|
| 876 | const double Ph = 1.e6;
|
---|
| 877 | PP(nObs+1) = Ph;
|
---|
[9258] | 878 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 879 | cmbParam* pp = _params[sys][iPar-1];
|
---|
[3465] | 880 | if ( AA.Column(iPar).maximum_absolute_value() > 0.0 &&
|
---|
[3474] | 881 | pp->type == cmbParam::clkSat ) {
|
---|
| 882 | AA(nObs+1, iPar) = 1.0;
|
---|
[3455] | 883 | }
|
---|
| 884 | }
|
---|
[9258] | 885 | unsigned flag = 0;
|
---|
| 886 | if (sys == 'E') {
|
---|
| 887 | flag = 1;
|
---|
| 888 | }
|
---|
[9259] | 889 | if (sys == 'R') {
|
---|
| 890 | return success;
|
---|
| 891 | }
|
---|
| 892 | int iCond = 1;
|
---|
| 893 | // GNSS
|
---|
[9258] | 894 | for (unsigned iGnss = 1; iGnss <= _cmbSysPrn[sys]; iGnss++) {
|
---|
| 895 | QString prn = QString("%1%2_%3").arg(sys).arg(iGnss, 2, 10, QChar('0')).arg(flag);
|
---|
[3474] | 896 | ++iCond;
|
---|
| 897 | PP(nObs+iCond) = Ph;
|
---|
[9258] | 898 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 899 | cmbParam* pp = _params[sys][iPar-1];
|
---|
[7299] | 900 | if ( pp &&
|
---|
| 901 | AA.Column(iPar).maximum_absolute_value() > 0.0 &&
|
---|
[7297] | 902 | pp->type == cmbParam::offACSat &&
|
---|
[3474] | 903 | pp->prn == prn) {
|
---|
| 904 | AA(nObs+iCond, iPar) = 1.0;
|
---|
| 905 | }
|
---|
| 906 | }
|
---|
| 907 | }
|
---|
[3455] | 908 | }
|
---|
| 909 |
|
---|
| 910 | return success;
|
---|
| 911 | }
|
---|
[3470] | 912 |
|
---|
| 913 | // Process Epoch - Single-Epoch Method
|
---|
| 914 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 915 | t_irc bncComb::processEpoch_singleEpoch(char sys, QTextStream& out,
|
---|
[6157] | 916 | QMap<QString, cmbCorr*>& resCorr,
|
---|
[3475] | 917 | ColumnVector& dx) {
|
---|
[3470] | 918 |
|
---|
[3487] | 919 | // Check Satellite Positions for Outliers
|
---|
| 920 | // --------------------------------------
|
---|
[9258] | 921 | if (checkOrbits(sys, out) != success) {
|
---|
[3487] | 922 | return failure;
|
---|
| 923 | }
|
---|
| 924 |
|
---|
[3482] | 925 | // Outlier Detection Loop
|
---|
| 926 | // ----------------------
|
---|
| 927 | while (true) {
|
---|
[7297] | 928 |
|
---|
[3482] | 929 | // Remove Satellites that are not in Master
|
---|
| 930 | // ----------------------------------------
|
---|
[9258] | 931 | QMutableVectorIterator<cmbCorr*> it(corrs(sys));
|
---|
[3482] | 932 | while (it.hasNext()) {
|
---|
| 933 | cmbCorr* corr = it.next();
|
---|
[6157] | 934 | QString prn = corr->_prn;
|
---|
[3482] | 935 | bool foundMaster = false;
|
---|
[9258] | 936 | QVectorIterator<cmbCorr*> itHlp(corrs(sys));
|
---|
[3482] | 937 | while (itHlp.hasNext()) {
|
---|
| 938 | cmbCorr* corrHlp = itHlp.next();
|
---|
[6157] | 939 | QString prnHlp = corrHlp->_prn;
|
---|
| 940 | QString ACHlp = corrHlp->_acName;
|
---|
[9258] | 941 | if (ACHlp == _masterOrbitAC[sys] && prn == prnHlp) {
|
---|
[3482] | 942 | foundMaster = true;
|
---|
| 943 | break;
|
---|
| 944 | }
|
---|
[3476] | 945 | }
|
---|
[3482] | 946 | if (!foundMaster) {
|
---|
[3556] | 947 | delete corr;
|
---|
[3482] | 948 | it.remove();
|
---|
| 949 | }
|
---|
[3473] | 950 | }
|
---|
[7297] | 951 |
|
---|
[3482] | 952 | // Count Number of Observations per Satellite and per AC
|
---|
| 953 | // -----------------------------------------------------
|
---|
| 954 | QMap<QString, int> numObsPrn;
|
---|
| 955 | QMap<QString, int> numObsAC;
|
---|
[9258] | 956 | QVectorIterator<cmbCorr*> itCorr(corrs(sys));
|
---|
[3482] | 957 | while (itCorr.hasNext()) {
|
---|
| 958 | cmbCorr* corr = itCorr.next();
|
---|
[6157] | 959 | QString prn = corr->_prn;
|
---|
| 960 | QString AC = corr->_acName;
|
---|
[3482] | 961 | if (numObsPrn.find(prn) == numObsPrn.end()) {
|
---|
| 962 | numObsPrn[prn] = 1;
|
---|
| 963 | }
|
---|
| 964 | else {
|
---|
| 965 | numObsPrn[prn] += 1;
|
---|
| 966 | }
|
---|
| 967 | if (numObsAC.find(AC) == numObsAC.end()) {
|
---|
| 968 | numObsAC[AC] = 1;
|
---|
| 969 | }
|
---|
| 970 | else {
|
---|
| 971 | numObsAC[AC] += 1;
|
---|
| 972 | }
|
---|
[3476] | 973 | }
|
---|
[7297] | 974 |
|
---|
[9258] | 975 | // Clean-Up the Parameters
|
---|
| 976 | // -----------------------
|
---|
| 977 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 978 | delete _params[sys][iPar-1];
|
---|
[3474] | 979 | }
|
---|
[9258] | 980 | _params[sys].clear();
|
---|
[7297] | 981 |
|
---|
[3482] | 982 | // Set new Parameters
|
---|
| 983 | // ------------------
|
---|
| 984 | int nextPar = 0;
|
---|
[7297] | 985 |
|
---|
[3482] | 986 | QMapIterator<QString, int> itAC(numObsAC);
|
---|
| 987 | while (itAC.hasNext()) {
|
---|
| 988 | itAC.next();
|
---|
| 989 | const QString& AC = itAC.key();
|
---|
| 990 | int numObs = itAC.value();
|
---|
[9258] | 991 | if (AC != _masterOrbitAC[sys] && numObs > 0) {
|
---|
| 992 | _params[sys].push_back(new cmbParam(cmbParam::offACgnss, ++nextPar, AC, ""));
|
---|
[3482] | 993 | }
|
---|
[7297] | 994 | }
|
---|
| 995 |
|
---|
[3482] | 996 | QMapIterator<QString, int> itPrn(numObsPrn);
|
---|
| 997 | while (itPrn.hasNext()) {
|
---|
| 998 | itPrn.next();
|
---|
| 999 | const QString& prn = itPrn.key();
|
---|
| 1000 | int numObs = itPrn.value();
|
---|
| 1001 | if (numObs > 0) {
|
---|
[9258] | 1002 | _params[sys].push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
|
---|
[3482] | 1003 | }
|
---|
[7297] | 1004 | }
|
---|
| 1005 |
|
---|
[9258] | 1006 | int nPar = _params[sys].size();
|
---|
[7297] | 1007 | ColumnVector x0(nPar);
|
---|
[3482] | 1008 | x0 = 0.0;
|
---|
[7297] | 1009 |
|
---|
[3482] | 1010 | // Create First-Design Matrix
|
---|
| 1011 | // --------------------------
|
---|
| 1012 | Matrix AA;
|
---|
| 1013 | ColumnVector ll;
|
---|
| 1014 | DiagonalMatrix PP;
|
---|
[9258] | 1015 | if (createAmat(sys, AA, ll, PP, x0, resCorr) != success) {
|
---|
[3482] | 1016 | return failure;
|
---|
[3476] | 1017 | }
|
---|
[7297] | 1018 |
|
---|
[3482] | 1019 | ColumnVector vv;
|
---|
| 1020 | try {
|
---|
| 1021 | Matrix ATP = AA.t() * PP;
|
---|
| 1022 | SymmetricMatrix NN; NN << ATP * AA;
|
---|
| 1023 | ColumnVector bb = ATP * ll;
|
---|
[9258] | 1024 | _QQ[sys] = NN.i();
|
---|
| 1025 | dx = _QQ[sys] * bb;
|
---|
[3482] | 1026 | vv = ll - AA * dx;
|
---|
[3476] | 1027 | }
|
---|
[3482] | 1028 | catch (Exception& exc) {
|
---|
| 1029 | out << exc.what() << endl;
|
---|
| 1030 | return failure;
|
---|
[3476] | 1031 | }
|
---|
[3474] | 1032 |
|
---|
[3482] | 1033 | int maxResIndex;
|
---|
[7297] | 1034 | double maxRes = vv.maximum_absolute_value1(maxResIndex);
|
---|
[3482] | 1035 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 1036 | out.setRealNumberPrecision(3);
|
---|
[3482] | 1037 | out << _resTime.datestr().c_str() << " " << _resTime.timestr().c_str()
|
---|
| 1038 | << " Maximum Residuum " << maxRes << ' '
|
---|
[9258] | 1039 | << corrs(sys)[maxResIndex-1]->_acName << ' ' << corrs(sys)[maxResIndex-1]->_prn.mid(0,3);
|
---|
[3474] | 1040 |
|
---|
[3482] | 1041 | if (maxRes > _MAXRES) {
|
---|
| 1042 | out << " Outlier" << endl;
|
---|
[9258] | 1043 | delete corrs(sys)[maxResIndex-1];
|
---|
| 1044 | corrs(sys).remove(maxResIndex-1);
|
---|
[3474] | 1045 | }
|
---|
[3482] | 1046 | else {
|
---|
| 1047 | out << " OK" << endl;
|
---|
| 1048 | out.setRealNumberNotation(QTextStream::FixedNotation);
|
---|
[7297] | 1049 | out.setRealNumberPrecision(3);
|
---|
[3482] | 1050 | for (int ii = 0; ii < vv.Nrows(); ii++) {
|
---|
[9258] | 1051 | const cmbCorr* corr = corrs(sys)[ii];
|
---|
[7297] | 1052 | out << _resTime.datestr().c_str() << ' '
|
---|
[3482] | 1053 | << _resTime.timestr().c_str() << " "
|
---|
[6962] | 1054 | << corr->_acName << ' ' << corr->_prn.mid(0,3);
|
---|
[3482] | 1055 | out.setFieldWidth(6);
|
---|
[6330] | 1056 | out << " res = " << vv[ii] << endl;
|
---|
[3482] | 1057 | out.setFieldWidth(0);
|
---|
| 1058 | }
|
---|
| 1059 | return success;
|
---|
[3474] | 1060 | }
|
---|
| 1061 |
|
---|
[3473] | 1062 | }
|
---|
[3474] | 1063 |
|
---|
[3482] | 1064 | return failure;
|
---|
[3470] | 1065 | }
|
---|
[3487] | 1066 |
|
---|
| 1067 | // Check Satellite Positions for Outliers
|
---|
| 1068 | ////////////////////////////////////////////////////////////////////////////
|
---|
[9258] | 1069 | t_irc bncComb::checkOrbits(char sys, QTextStream& out) {
|
---|
[3487] | 1070 |
|
---|
[3489] | 1071 | const double MAX_DISPLACEMENT = 0.20;
|
---|
[3488] | 1072 |
|
---|
[3502] | 1073 | // Switch to last ephemeris (if possible)
|
---|
| 1074 | // --------------------------------------
|
---|
[9258] | 1075 | QMutableVectorIterator<cmbCorr*> im(corrs(sys));
|
---|
[3501] | 1076 | while (im.hasNext()) {
|
---|
| 1077 | cmbCorr* corr = im.next();
|
---|
[6157] | 1078 | QString prn = corr->_prn;
|
---|
[6443] | 1079 |
|
---|
[7012] | 1080 | t_eph* ephLast = _ephUser.ephLast(prn);
|
---|
| 1081 | t_eph* ephPrev = _ephUser.ephPrev(prn);
|
---|
[6443] | 1082 |
|
---|
| 1083 | if (ephLast == 0) {
|
---|
[6962] | 1084 | out << "checkOrbit: missing eph (not found) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1085 | delete corr;
|
---|
[3501] | 1086 | im.remove();
|
---|
| 1087 | }
|
---|
[6157] | 1088 | else if (corr->_eph == 0) {
|
---|
[6962] | 1089 | out << "checkOrbit: missing eph (zero) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1090 | delete corr;
|
---|
[3503] | 1091 | im.remove();
|
---|
| 1092 | }
|
---|
[3502] | 1093 | else {
|
---|
[6443] | 1094 | if ( corr->_eph == ephLast || corr->_eph == ephPrev ) {
|
---|
| 1095 | switchToLastEph(ephLast, corr);
|
---|
[3502] | 1096 | }
|
---|
| 1097 | else {
|
---|
[6962] | 1098 | out << "checkOrbit: missing eph (deleted) " << corr->_prn.mid(0,3) << endl;
|
---|
[3556] | 1099 | delete corr;
|
---|
[3502] | 1100 | im.remove();
|
---|
| 1101 | }
|
---|
| 1102 | }
|
---|
[3501] | 1103 | }
|
---|
| 1104 |
|
---|
[3488] | 1105 | while (true) {
|
---|
| 1106 |
|
---|
| 1107 | // Compute Mean Corrections for all Satellites
|
---|
| 1108 | // -------------------------------------------
|
---|
[3489] | 1109 | QMap<QString, int> numCorr;
|
---|
[3488] | 1110 | QMap<QString, ColumnVector> meanRao;
|
---|
[9258] | 1111 | QVectorIterator<cmbCorr*> it(corrs(sys));
|
---|
[3488] | 1112 | while (it.hasNext()) {
|
---|
| 1113 | cmbCorr* corr = it.next();
|
---|
[6157] | 1114 | QString prn = corr->_prn;
|
---|
[3488] | 1115 | if (meanRao.find(prn) == meanRao.end()) {
|
---|
| 1116 | meanRao[prn].ReSize(4);
|
---|
[6159] | 1117 | meanRao[prn].Rows(1,3) = corr->_orbCorr._xr;
|
---|
[7297] | 1118 | meanRao[prn](4) = 1;
|
---|
[3488] | 1119 | }
|
---|
| 1120 | else {
|
---|
[6159] | 1121 | meanRao[prn].Rows(1,3) += corr->_orbCorr._xr;
|
---|
[7297] | 1122 | meanRao[prn](4) += 1;
|
---|
[3488] | 1123 | }
|
---|
[3489] | 1124 | if (numCorr.find(prn) == numCorr.end()) {
|
---|
| 1125 | numCorr[prn] = 1;
|
---|
| 1126 | }
|
---|
| 1127 | else {
|
---|
| 1128 | numCorr[prn] += 1;
|
---|
| 1129 | }
|
---|
[3487] | 1130 | }
|
---|
[7297] | 1131 |
|
---|
[9258] | 1132 | // Compute Differences wrt. Mean, find Maximum
|
---|
| 1133 | // -------------------------------------------
|
---|
[3488] | 1134 | QMap<QString, cmbCorr*> maxDiff;
|
---|
| 1135 | it.toFront();
|
---|
| 1136 | while (it.hasNext()) {
|
---|
| 1137 | cmbCorr* corr = it.next();
|
---|
[6157] | 1138 | QString prn = corr->_prn;
|
---|
[3488] | 1139 | if (meanRao[prn](4) != 0) {
|
---|
| 1140 | meanRao[prn] /= meanRao[prn](4);
|
---|
| 1141 | meanRao[prn](4) = 0;
|
---|
| 1142 | }
|
---|
[6159] | 1143 | corr->_diffRao = corr->_orbCorr._xr - meanRao[prn].Rows(1,3);
|
---|
[3488] | 1144 | if (maxDiff.find(prn) == maxDiff.end()) {
|
---|
| 1145 | maxDiff[prn] = corr;
|
---|
| 1146 | }
|
---|
| 1147 | else {
|
---|
[8901] | 1148 | double normMax = maxDiff[prn]->_diffRao.NormFrobenius();
|
---|
| 1149 | double norm = corr->_diffRao.NormFrobenius();
|
---|
[3488] | 1150 | if (norm > normMax) {
|
---|
| 1151 | maxDiff[prn] = corr;
|
---|
| 1152 | }
|
---|
[7297] | 1153 | }
|
---|
[3487] | 1154 | }
|
---|
[7297] | 1155 |
|
---|
[3655] | 1156 | if (_ACs.size() == 1) {
|
---|
| 1157 | break;
|
---|
| 1158 | }
|
---|
| 1159 |
|
---|
[3488] | 1160 | // Remove Outliers
|
---|
| 1161 | // ---------------
|
---|
| 1162 | bool removed = false;
|
---|
[9258] | 1163 | QMutableVectorIterator<cmbCorr*> im(corrs(sys));
|
---|
[3488] | 1164 | while (im.hasNext()) {
|
---|
| 1165 | cmbCorr* corr = im.next();
|
---|
[6157] | 1166 | QString prn = corr->_prn;
|
---|
[3489] | 1167 | if (numCorr[prn] < 2) {
|
---|
[3556] | 1168 | delete corr;
|
---|
[3489] | 1169 | im.remove();
|
---|
| 1170 | }
|
---|
| 1171 | else if (corr == maxDiff[prn]) {
|
---|
[8901] | 1172 | double norm = corr->_diffRao.NormFrobenius();
|
---|
[3488] | 1173 | if (norm > MAX_DISPLACEMENT) {
|
---|
[3497] | 1174 | out << _resTime.datestr().c_str() << " "
|
---|
| 1175 | << _resTime.timestr().c_str() << " "
|
---|
[7297] | 1176 | << "Orbit Outlier: "
|
---|
[8204] | 1177 | << corr->_acName.toLatin1().data() << " "
|
---|
| 1178 | << prn.mid(0,3).toLatin1().data() << " "
|
---|
[7297] | 1179 | << corr->_iod << " "
|
---|
[6157] | 1180 | << norm << endl;
|
---|
[3556] | 1181 | delete corr;
|
---|
[3488] | 1182 | im.remove();
|
---|
| 1183 | removed = true;
|
---|
| 1184 | }
|
---|
| 1185 | }
|
---|
[3487] | 1186 | }
|
---|
[7297] | 1187 |
|
---|
[3488] | 1188 | if (!removed) {
|
---|
| 1189 | break;
|
---|
| 1190 | }
|
---|
[3487] | 1191 | }
|
---|
| 1192 |
|
---|
| 1193 | return success;
|
---|
| 1194 | }
|
---|
[3588] | 1195 |
|
---|
[7297] | 1196 | //
|
---|
[3588] | 1197 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5583] | 1198 | void bncComb::slotProviderIDChanged(QString mountPoint) {
|
---|
| 1199 | QMutexLocker locker(&_mutex);
|
---|
| 1200 |
|
---|
[8065] | 1201 | QTextStream out(&_log, QIODevice::WriteOnly);
|
---|
| 1202 |
|
---|
[5583] | 1203 | // Find the AC Name
|
---|
| 1204 | // ----------------
|
---|
| 1205 | QString acName;
|
---|
| 1206 | QListIterator<cmbAC*> icAC(_ACs);
|
---|
| 1207 | while (icAC.hasNext()) {
|
---|
| 1208 | cmbAC* AC = icAC.next();
|
---|
| 1209 | if (AC->mountPoint == mountPoint) {
|
---|
| 1210 | acName = AC->name;
|
---|
[8204] | 1211 | out << "Provider ID changed: AC " << AC->name.toLatin1().data() << " "
|
---|
[8065] | 1212 | << _resTime.datestr().c_str() << " "
|
---|
| 1213 | << _resTime.timestr().c_str() << endl;
|
---|
[5583] | 1214 | break;
|
---|
| 1215 | }
|
---|
| 1216 | }
|
---|
| 1217 | if (acName.isEmpty()) {
|
---|
| 1218 | return;
|
---|
| 1219 | }
|
---|
[9258] | 1220 | QMapIterator<char, unsigned> itSys(_cmbSysPrn);
|
---|
| 1221 | while (itSys.hasNext()) {
|
---|
| 1222 | itSys.next();
|
---|
| 1223 | char sys = itSys.key();
|
---|
| 1224 | // Remove all corrections of the corresponding AC
|
---|
| 1225 | // ----------------------------------------------
|
---|
| 1226 | QListIterator<bncTime> itTime(_buffer[sys].keys());
|
---|
| 1227 | while (itTime.hasNext()) {
|
---|
| 1228 | bncTime epoTime = itTime.next();
|
---|
| 1229 | QVector<cmbCorr*>& corrVec = _buffer[sys][epoTime].corrs;
|
---|
| 1230 | QMutableVectorIterator<cmbCorr*> it(corrVec);
|
---|
| 1231 | while (it.hasNext()) {
|
---|
| 1232 | cmbCorr* corr = it.next();
|
---|
| 1233 | if (acName == corr->_acName) {
|
---|
| 1234 | delete corr;
|
---|
| 1235 | it.remove();
|
---|
| 1236 | }
|
---|
[5583] | 1237 | }
|
---|
| 1238 | }
|
---|
[5585] | 1239 |
|
---|
[9258] | 1240 | // Reset Satellite Offsets
|
---|
| 1241 | // -----------------------
|
---|
| 1242 | if (_method == filter) {
|
---|
| 1243 | for (int iPar = 1; iPar <= _params[sys].size(); iPar++) {
|
---|
| 1244 | cmbParam* pp = _params[sys][iPar-1];
|
---|
| 1245 | if (pp->AC == acName && pp->type == cmbParam::offACSat) {
|
---|
| 1246 | pp->xx = 0.0;
|
---|
| 1247 | _QQ[sys].Row(iPar) = 0.0;
|
---|
| 1248 | _QQ[sys].Column(iPar) = 0.0;
|
---|
| 1249 | _QQ[sys](iPar,iPar) = pp->sig0 * pp->sig0;
|
---|
| 1250 | }
|
---|
[5585] | 1251 | }
|
---|
| 1252 | }
|
---|
| 1253 | }
|
---|
[5583] | 1254 | }
|
---|