[3222] | 1 | /* -------------------------------------------------------------------------
|
---|
| 2 | * BKG NTRIP Server
|
---|
| 3 | * -------------------------------------------------------------------------
|
---|
| 4 | *
|
---|
[3224] | 5 | * Class: bncRtnetUploadCaster
|
---|
[3222] | 6 | *
|
---|
| 7 | * Purpose: Connection to NTRIP Caster
|
---|
| 8 | *
|
---|
| 9 | * Author: L. Mervart
|
---|
| 10 | *
|
---|
| 11 | * Created: 29-Mar-2011
|
---|
| 12 | *
|
---|
[5662] | 13 | * Changes:
|
---|
[3222] | 14 | *
|
---|
| 15 | * -----------------------------------------------------------------------*/
|
---|
| 16 |
|
---|
| 17 | #include <math.h>
|
---|
[5662] | 18 | #include "bncrtnetuploadcaster.h"
|
---|
[3222] | 19 | #include "bncsettings.h"
|
---|
[3224] | 20 | #include "bncephuser.h"
|
---|
[3222] | 21 | #include "bncclockrinex.h"
|
---|
| 22 | #include "bncsp3.h"
|
---|
[6812] | 23 | #include "gnss.h"
|
---|
[3222] | 24 |
|
---|
| 25 | using namespace std;
|
---|
| 26 |
|
---|
| 27 | // Constructor
|
---|
| 28 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 29 | bncRtnetUploadCaster::bncRtnetUploadCaster(const QString& mountpoint,
|
---|
[3222] | 30 | const QString& outHost, int outPort,
|
---|
[5662] | 31 | const QString& password,
|
---|
| 32 | const QString& crdTrafo, bool CoM,
|
---|
[3222] | 33 | const QString& sp3FileName,
|
---|
| 34 | const QString& rnxFileName,
|
---|
[4111] | 35 | int PID, int SID, int IOD, int iRow) :
|
---|
[3273] | 36 | bncUploadCaster(mountpoint, outHost, outPort, password, iRow, 0) {
|
---|
[3224] | 37 |
|
---|
[5130] | 38 | if (!outHost.isEmpty()) {
|
---|
| 39 | _casterID += outHost;
|
---|
| 40 | }
|
---|
| 41 | if (!crdTrafo.isEmpty()) {
|
---|
| 42 | _casterID += " " + crdTrafo;
|
---|
| 43 | }
|
---|
| 44 | if (!sp3FileName.isEmpty()) {
|
---|
| 45 | _casterID += " " + sp3FileName;
|
---|
| 46 | }
|
---|
| 47 | if (!rnxFileName.isEmpty()) {
|
---|
| 48 | _casterID += " " + rnxFileName;
|
---|
| 49 | }
|
---|
| 50 |
|
---|
[3222] | 51 | _crdTrafo = crdTrafo;
|
---|
| 52 | _CoM = CoM;
|
---|
[4111] | 53 | _PID = PID;
|
---|
| 54 | _SID = SID;
|
---|
| 55 | _IOD = IOD;
|
---|
[3222] | 56 |
|
---|
[3224] | 57 | // Member that receives the ephemeris
|
---|
| 58 | // ----------------------------------
|
---|
[6441] | 59 | _ephUser = new bncEphUser(true);
|
---|
[3222] | 60 |
|
---|
[3272] | 61 | bncSettings settings;
|
---|
| 62 | QString intr = settings.value("uploadIntr").toString();
|
---|
[6559] | 63 | QStringList hlp = settings.value("combineStreams").toStringList();
|
---|
| 64 | _samplRtcmEphCorr = settings.value("uploadSamplRtcmEphCorr").toDouble();
|
---|
| 65 | if (hlp.size() > 1) { // combination stream upload
|
---|
[6557] | 66 | _samplRtcmClkCorr = settings.value("cmbSampl").toInt();
|
---|
| 67 | } else { // single stream upload or sp3 file generation
|
---|
| 68 | _samplRtcmClkCorr = 5; // default
|
---|
| 69 | }
|
---|
| 70 | int samplClkRnx = settings.value("uploadSamplClkRnx").toInt();
|
---|
| 71 | int samplSp3 = settings.value("uploadSamplSp3").toInt() * 60;
|
---|
[4174] | 72 |
|
---|
| 73 | if (_samplRtcmEphCorr == 0.0) {
|
---|
[3753] | 74 | _usedEph = 0;
|
---|
| 75 | }
|
---|
| 76 | else {
|
---|
[6442] | 77 | _usedEph = new QMap<QString, const t_eph*>;
|
---|
[3753] | 78 | }
|
---|
[3272] | 79 |
|
---|
[3222] | 80 | // RINEX writer
|
---|
| 81 | // ------------
|
---|
| 82 | if (!rnxFileName.isEmpty()) {
|
---|
[4174] | 83 | _rnx = new bncClockRinex(rnxFileName, intr, samplClkRnx);
|
---|
[3222] | 84 | }
|
---|
| 85 | else {
|
---|
| 86 | _rnx = 0;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | // SP3 writer
|
---|
| 90 | // ----------
|
---|
| 91 | if (!sp3FileName.isEmpty()) {
|
---|
[4174] | 92 | _sp3 = new bncSP3(sp3FileName, intr, samplSp3);
|
---|
[3222] | 93 | }
|
---|
| 94 | else {
|
---|
| 95 | _sp3 = 0;
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | // Set Transformation Parameters
|
---|
| 99 | // -----------------------------
|
---|
| 100 | if (_crdTrafo == "ETRF2000") {
|
---|
[3890] | 101 | _dx = 0.0521;
|
---|
| 102 | _dy = 0.0493;
|
---|
| 103 | _dz = -0.0585;
|
---|
| 104 | _dxr = 0.0001;
|
---|
[3222] | 105 | _dyr = 0.0001;
|
---|
| 106 | _dzr = -0.0018;
|
---|
| 107 | _ox = 0.000891;
|
---|
| 108 | _oy = 0.005390;
|
---|
| 109 | _oz = -0.008712;
|
---|
| 110 | _oxr = 0.000081;
|
---|
| 111 | _oyr = 0.000490;
|
---|
| 112 | _ozr = -0.000792;
|
---|
[3890] | 113 | _sc = 1.34;
|
---|
[3222] | 114 | _scr = 0.08;
|
---|
| 115 | _t0 = 2000.0;
|
---|
| 116 | }
|
---|
| 117 | else if (_crdTrafo == "NAD83") {
|
---|
[5345] | 118 | _dx = 0.99343;
|
---|
| 119 | _dy = -1.90331;
|
---|
| 120 | _dz = -0.52655;
|
---|
| 121 | _dxr = 0.00079;
|
---|
| 122 | _dyr = -0.00060;
|
---|
| 123 | _dzr = -0.00134;
|
---|
| 124 | _ox = -0.02591467;
|
---|
| 125 | _oy = -0.00942645;
|
---|
| 126 | _oz = -0.01159935;
|
---|
| 127 | _oxr = -0.00006667;
|
---|
| 128 | _oyr = 0.00075744;
|
---|
| 129 | _ozr = 0.00005133;
|
---|
| 130 | _sc = 1.71504;
|
---|
[5348] | 131 | _scr = -0.10201;
|
---|
[5345] | 132 | _t0 = 1997.0;
|
---|
[3222] | 133 | }
|
---|
| 134 | else if (_crdTrafo == "GDA94") {
|
---|
[4963] | 135 | _dx = -0.08468;
|
---|
| 136 | _dy = -0.01942;
|
---|
| 137 | _dz = 0.03201;
|
---|
| 138 | _dxr = 0.00142;
|
---|
| 139 | _dyr = 0.00134;
|
---|
| 140 | _dzr = 0.00090;
|
---|
| 141 | _ox = 0.0004254;
|
---|
| 142 | _oy = -0.0022578;
|
---|
| 143 | _oz = -0.0024015;
|
---|
| 144 | _oxr = -0.0015461;
|
---|
| 145 | _oyr = -0.0011820;
|
---|
| 146 | _ozr = -0.0011551;
|
---|
| 147 | _sc = 9.710;
|
---|
| 148 | _scr = 0.109;
|
---|
[3222] | 149 | _t0 = 1994.0;
|
---|
| 150 | }
|
---|
| 151 | else if (_crdTrafo == "SIRGAS2000") {
|
---|
[4956] | 152 | _dx = 0.0020;
|
---|
| 153 | _dy = 0.0041;
|
---|
| 154 | _dz = 0.0039;
|
---|
[3222] | 155 | _dxr = 0.0000;
|
---|
| 156 | _dyr = 0.0000;
|
---|
| 157 | _dzr = 0.0000;
|
---|
[4956] | 158 | _ox = 0.000170;
|
---|
| 159 | _oy = -0.000030;
|
---|
| 160 | _oz = 0.000070;
|
---|
[3222] | 161 | _oxr = 0.000000;
|
---|
| 162 | _oyr = 0.000000;
|
---|
| 163 | _ozr = 0.000000;
|
---|
[5662] | 164 | _sc = -1.000;
|
---|
[3222] | 165 | _scr = 0.000;
|
---|
| 166 | _t0 = 0000.0;
|
---|
| 167 | }
|
---|
| 168 | else if (_crdTrafo == "SIRGAS95") {
|
---|
| 169 | _dx = 0.0077;
|
---|
| 170 | _dy = 0.0058;
|
---|
| 171 | _dz = -0.0138;
|
---|
| 172 | _dxr = 0.0000;
|
---|
| 173 | _dyr = 0.0000;
|
---|
| 174 | _dzr = 0.0000;
|
---|
| 175 | _ox = 0.000000;
|
---|
| 176 | _oy = 0.000000;
|
---|
| 177 | _oz = -0.000030;
|
---|
| 178 | _oxr = 0.000000;
|
---|
| 179 | _oyr = 0.000000;
|
---|
| 180 | _ozr = 0.000000;
|
---|
| 181 | _sc = 1.570;
|
---|
| 182 | _scr = 0.000;
|
---|
| 183 | _t0 = 0000.0;
|
---|
| 184 | }
|
---|
[5347] | 185 | else if (_crdTrafo == "DREF91") {
|
---|
[5340] | 186 | _dx = -0.0118;
|
---|
| 187 | _dy = 0.1432;
|
---|
| 188 | _dz = -0.1117;
|
---|
| 189 | _dxr = 0.0001;
|
---|
| 190 | _dyr = 0.0001;
|
---|
| 191 | _dzr = -0.0018;
|
---|
| 192 | _ox = 0.003291;
|
---|
| 193 | _oy = 0.006190;
|
---|
| 194 | _oz = -0.011012;
|
---|
| 195 | _oxr = 0.000081;
|
---|
| 196 | _oyr = 0.000490;
|
---|
| 197 | _ozr = -0.000792;
|
---|
| 198 | _sc = 12.24;
|
---|
| 199 | _scr = 0.08;
|
---|
| 200 | _t0 = 2000.0;
|
---|
| 201 | }
|
---|
[3222] | 202 | else if (_crdTrafo == "Custom") {
|
---|
| 203 | _dx = settings.value("trafo_dx").toDouble();
|
---|
| 204 | _dy = settings.value("trafo_dy").toDouble();
|
---|
| 205 | _dz = settings.value("trafo_dz").toDouble();
|
---|
| 206 | _dxr = settings.value("trafo_dxr").toDouble();
|
---|
| 207 | _dyr = settings.value("trafo_dyr").toDouble();
|
---|
| 208 | _dzr = settings.value("trafo_dzr").toDouble();
|
---|
| 209 | _ox = settings.value("trafo_ox").toDouble();
|
---|
| 210 | _oy = settings.value("trafo_oy").toDouble();
|
---|
| 211 | _oz = settings.value("trafo_oz").toDouble();
|
---|
| 212 | _oxr = settings.value("trafo_oxr").toDouble();
|
---|
| 213 | _oyr = settings.value("trafo_oyr").toDouble();
|
---|
| 214 | _ozr = settings.value("trafo_ozr").toDouble();
|
---|
| 215 | _sc = settings.value("trafo_sc").toDouble();
|
---|
| 216 | _scr = settings.value("trafo_scr").toDouble();
|
---|
| 217 | _t0 = settings.value("trafo_t0").toDouble();
|
---|
| 218 | }
|
---|
| 219 | }
|
---|
| 220 |
|
---|
| 221 | // Destructor
|
---|
| 222 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 223 | bncRtnetUploadCaster::~bncRtnetUploadCaster() {
|
---|
[3222] | 224 | if (isRunning()) {
|
---|
| 225 | wait();
|
---|
| 226 | }
|
---|
| 227 | delete _rnx;
|
---|
| 228 | delete _sp3;
|
---|
| 229 | delete _ephUser;
|
---|
[3753] | 230 | delete _usedEph;
|
---|
[3222] | 231 | }
|
---|
| 232 |
|
---|
[5662] | 233 | //
|
---|
[3222] | 234 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 235 | void bncRtnetUploadCaster::decodeRtnetStream(char* buffer, int bufLen) {
|
---|
[5662] | 236 |
|
---|
[3222] | 237 | QMutexLocker locker(&_mutex);
|
---|
| 238 |
|
---|
[3230] | 239 | // Append to internal buffer
|
---|
| 240 | // -------------------------
|
---|
[3222] | 241 | _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
|
---|
[3230] | 242 |
|
---|
| 243 | // Select buffer part that contains last epoch
|
---|
| 244 | // -------------------------------------------
|
---|
| 245 | QStringList lines;
|
---|
| 246 | int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch
|
---|
| 247 | if (iEpoBeg == -1) {
|
---|
[3226] | 248 | _rtnetStreamBuffer.clear();
|
---|
| 249 | return;
|
---|
[3222] | 250 | }
|
---|
[3230] | 251 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
|
---|
| 252 |
|
---|
| 253 | int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
|
---|
| 254 | if (iEpoEnd == -1) {
|
---|
| 255 | return;
|
---|
| 256 | }
|
---|
[3226] | 257 | else {
|
---|
[3230] | 258 | lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
|
---|
| 259 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
|
---|
[3226] | 260 | }
|
---|
[3222] | 261 |
|
---|
[3226] | 262 | if (lines.size() < 2) {
|
---|
[3222] | 263 | return;
|
---|
| 264 | }
|
---|
| 265 |
|
---|
[3226] | 266 | // Keep the last unfinished line in buffer
|
---|
| 267 | // ---------------------------------------
|
---|
| 268 | int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');
|
---|
| 269 | if (iLastEOL != -1) {
|
---|
| 270 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);
|
---|
| 271 | }
|
---|
| 272 |
|
---|
| 273 | // Read first line (with epoch time)
|
---|
| 274 | // ---------------------------------
|
---|
| 275 | QTextStream in(lines[0].toAscii());
|
---|
| 276 | QString hlp;
|
---|
| 277 | int year, month, day, hour, min;
|
---|
| 278 | double sec;
|
---|
| 279 | in >> hlp >> year >> month >> day >> hour >> min >> sec;
|
---|
| 280 | bncTime epoTime; epoTime.set( year, month, day, hour, min, sec);
|
---|
| 281 |
|
---|
[5662] | 282 | emit(newMessage("bncRtnetUploadCaster: decode " +
|
---|
[5131] | 283 | QByteArray(epoTime.datestr().c_str()) + " " +
|
---|
[5662] | 284 | QByteArray(epoTime.timestr().c_str()) + " " +
|
---|
[5132] | 285 | _casterID.toAscii(), false));
|
---|
[4808] | 286 |
|
---|
[3222] | 287 | struct ClockOrbit co;
|
---|
| 288 | memset(&co, 0, sizeof(co));
|
---|
[5672] | 289 | co.EpochTime[CLOCKORBIT_SATGPS] = static_cast<int>(epoTime.gpssec());
|
---|
| 290 | double gt = epoTime.gpssec() + 3 * 3600 - gnumleap(year, month, day);
|
---|
| 291 | co.EpochTime[CLOCKORBIT_SATGLONASS] = static_cast<int>(fmod(gt, 86400.0));
|
---|
| 292 |
|
---|
[5666] | 293 | co.Supplied[COBOFS_CLOCK] = 1;
|
---|
| 294 | co.Supplied[COBOFS_ORBIT] = 1;
|
---|
[3222] | 295 | co.SatRefDatum = DATUM_ITRF;
|
---|
[4111] | 296 | co.SSRIOD = _IOD;
|
---|
| 297 | co.SSRProviderID = _PID; // 256 .. BKG, 257 ... EUREF
|
---|
| 298 | co.SSRSolutionID = _SID;
|
---|
[5662] | 299 |
|
---|
[5666] | 300 | struct CodeBias bias;
|
---|
[3222] | 301 | memset(&bias, 0, sizeof(bias));
|
---|
[5666] | 302 | bias.EpochTime[CLOCKORBIT_SATGPS] = co.EpochTime[CLOCKORBIT_SATGPS];
|
---|
| 303 | bias.EpochTime[CLOCKORBIT_SATGLONASS] = co.EpochTime[CLOCKORBIT_SATGLONASS];
|
---|
[5662] | 304 |
|
---|
[4753] | 305 | // Default Update Interval
|
---|
| 306 | // -----------------------
|
---|
[4754] | 307 | int clkUpdInd = 2; // 5 sec
|
---|
| 308 | int ephUpdInd = clkUpdInd; // default
|
---|
[6557] | 309 |
|
---|
[6559] | 310 | if (_samplRtcmClkCorr > 5.0 && _samplRtcmEphCorr <= 5.0) { // combined orb and clock
|
---|
| 311 | ephUpdInd = determineUpdateInd(_samplRtcmClkCorr);
|
---|
[4754] | 312 | }
|
---|
[6559] | 313 | if (_samplRtcmClkCorr > 5.0) {
|
---|
[6557] | 314 | clkUpdInd = determineUpdateInd(_samplRtcmClkCorr);
|
---|
[4754] | 315 | }
|
---|
[6559] | 316 | if (_samplRtcmEphCorr > 5.0) {
|
---|
| 317 | ephUpdInd = determineUpdateInd(_samplRtcmEphCorr);
|
---|
| 318 | }
|
---|
[4753] | 319 |
|
---|
[4754] | 320 | co.UpdateInterval = clkUpdInd;
|
---|
| 321 | bias.UpdateInterval = clkUpdInd;
|
---|
[4753] | 322 |
|
---|
[3226] | 323 | for (int ii = 1; ii < lines.size(); ii++) {
|
---|
[5662] | 324 |
|
---|
[3222] | 325 | QString prn;
|
---|
[4991] | 326 | ColumnVector rtnAPC;
|
---|
| 327 | ColumnVector rtnVel;
|
---|
| 328 | ColumnVector rtnCoM;
|
---|
| 329 | double rtnClk;
|
---|
[5662] | 330 |
|
---|
[3222] | 331 | QTextStream in(lines[ii].toAscii());
|
---|
| 332 |
|
---|
| 333 | in >> prn;
|
---|
| 334 |
|
---|
[6442] | 335 | const t_eph* ephLast = _ephUser->ephLast(prn);
|
---|
| 336 | const t_eph* ephPrev = _ephUser->ephPrev(prn);
|
---|
| 337 | const t_eph* eph = ephLast;
|
---|
[3222] | 338 |
|
---|
[6442] | 339 | if (eph) {
|
---|
[3754] | 340 |
|
---|
[4098] | 341 | // Use previous ephemeris if the last one is too recent
|
---|
| 342 | // ----------------------------------------------------
|
---|
| 343 | const int MINAGE = 60; // seconds
|
---|
[6442] | 344 | if (ephPrev && eph->receptDateTime().isValid() &&
|
---|
[4098] | 345 | eph->receptDateTime().secsTo(currentDateAndTimeGPS()) < MINAGE) {
|
---|
[6442] | 346 | eph = ephPrev;
|
---|
[4098] | 347 | }
|
---|
[3754] | 348 |
|
---|
[3753] | 349 | // Make sure the clock messages refer to same IOD as orbit messages
|
---|
| 350 | // ----------------------------------------------------------------
|
---|
| 351 | if (_usedEph) {
|
---|
[4174] | 352 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[3753] | 353 | (*_usedEph)[prn] = eph;
|
---|
| 354 | }
|
---|
| 355 | else {
|
---|
| 356 | eph = 0;
|
---|
| 357 | if (_usedEph->contains(prn)) {
|
---|
[6442] | 358 | const t_eph* usedEph = _usedEph->value(prn);
|
---|
| 359 | if (usedEph == ephLast) {
|
---|
| 360 | eph = ephLast;
|
---|
[3753] | 361 | }
|
---|
[6442] | 362 | else if (usedEph == ephPrev) {
|
---|
| 363 | eph = ephPrev;
|
---|
[3753] | 364 | }
|
---|
| 365 | }
|
---|
| 366 | }
|
---|
| 367 | }
|
---|
| 368 | }
|
---|
| 369 |
|
---|
| 370 | if (eph) {
|
---|
| 371 |
|
---|
[5503] | 372 | QMap<QString, double> codeBiases;
|
---|
| 373 |
|
---|
[4991] | 374 | while (true) {
|
---|
| 375 | QString key;
|
---|
| 376 | int numVal = 0;
|
---|
| 377 | in >> key >> numVal;
|
---|
| 378 | if (in.status() != QTextStream::Ok) {
|
---|
| 379 | break;
|
---|
| 380 | }
|
---|
| 381 | if (key == "APC") {
|
---|
| 382 | rtnAPC.ReSize(3);
|
---|
| 383 | in >> rtnAPC[0] >> rtnAPC[1] >> rtnAPC[2];
|
---|
| 384 | }
|
---|
| 385 | else if (key == "Clk") {
|
---|
| 386 | in >> rtnClk;
|
---|
| 387 | }
|
---|
| 388 | else if (key == "Vel") {
|
---|
| 389 | rtnVel.ReSize(3);
|
---|
| 390 | in >> rtnVel[0] >> rtnVel[1] >> rtnVel[2];
|
---|
| 391 | }
|
---|
| 392 | else if (key == "CoM") {
|
---|
| 393 | rtnCoM.ReSize(3);
|
---|
| 394 | in >> rtnCoM[0] >> rtnCoM[1] >> rtnCoM[2];
|
---|
| 395 | }
|
---|
[5503] | 396 | else if (key == "CodeBias") {
|
---|
| 397 | for (int ii = 0; ii < numVal; ii++) {
|
---|
| 398 | QString type;
|
---|
| 399 | double value;
|
---|
| 400 | in >> type >> value;
|
---|
| 401 | codeBiases[type] = value;
|
---|
| 402 | }
|
---|
| 403 | }
|
---|
[4991] | 404 | else {
|
---|
| 405 | for (int ii = 0; ii < numVal; ii++) {
|
---|
| 406 | double dummy;
|
---|
| 407 | in >> dummy;
|
---|
| 408 | }
|
---|
| 409 | }
|
---|
[5662] | 410 | }
|
---|
[3222] | 411 | struct ClockOrbit::SatData* sd = 0;
|
---|
| 412 | if (prn[0] == 'G') {
|
---|
[5666] | 413 | sd = co.Sat + co.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
| 414 | ++co.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
[3222] | 415 | }
|
---|
| 416 | else if (prn[0] == 'R') {
|
---|
[6844] | 417 | sd = co.Sat + CLOCKORBIT_NUMGPS
|
---|
| 418 | + co.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[5666] | 419 | ++co.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[3222] | 420 | }
|
---|
[6844] | 421 | else if (prn[0] == 'E') {
|
---|
| 422 | sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
|
---|
| 423 | + co.NumberOfSat[CLOCKORBIT_SATGALILEO];
|
---|
| 424 | ++co.NumberOfSat[CLOCKORBIT_SATGALILEO];
|
---|
| 425 | }
|
---|
| 426 | else if (prn[0] == 'J') {
|
---|
| 427 | sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 428 | + co.NumberOfSat[CLOCKORBIT_SATQZSS];
|
---|
| 429 | ++co.NumberOfSat[CLOCKORBIT_SATQZSS];
|
---|
| 430 | }
|
---|
| 431 | else if (prn[0] == 'S') {
|
---|
| 432 | sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 433 | + CLOCKORBIT_NUMQZSS
|
---|
| 434 | + co.NumberOfSat[CLOCKORBIT_SATSBAS];
|
---|
| 435 | ++co.NumberOfSat[CLOCKORBIT_SATSBAS];
|
---|
| 436 | }
|
---|
| 437 | else if (prn[0] == 'C') {
|
---|
| 438 | sd = co.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 439 | + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
|
---|
| 440 | + co.NumberOfSat[CLOCKORBIT_SATBDS];
|
---|
| 441 | ++co.NumberOfSat[CLOCKORBIT_SATBDS];
|
---|
| 442 | }
|
---|
[3222] | 443 | if (sd) {
|
---|
| 444 | QString outLine;
|
---|
[5662] | 445 | processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prn,
|
---|
[4991] | 446 | rtnAPC, rtnClk, rtnVel, rtnCoM, sd, outLine);
|
---|
[3222] | 447 | }
|
---|
[5662] | 448 |
|
---|
[5666] | 449 | struct CodeBias::BiasSat* biasSat = 0;
|
---|
[3222] | 450 | if (prn[0] == 'G') {
|
---|
[5666] | 451 | biasSat = bias.Sat + bias.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
| 452 | ++bias.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
[3222] | 453 | }
|
---|
| 454 | else if (prn[0] == 'R') {
|
---|
[6844] | 455 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS
|
---|
| 456 | + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[5666] | 457 | ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[3222] | 458 | }
|
---|
[6844] | 459 | else if (prn[0] == 'E') {
|
---|
| 460 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS
|
---|
| 461 | + bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
|
---|
| 462 | ++bias.NumberOfSat[CLOCKORBIT_SATGALILEO];
|
---|
| 463 | }
|
---|
| 464 | else if (prn[0] == 'J') {
|
---|
| 465 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 466 | + bias.NumberOfSat[CLOCKORBIT_SATQZSS];
|
---|
| 467 | ++bias.NumberOfSat[CLOCKORBIT_SATQZSS];
|
---|
| 468 | }
|
---|
| 469 | else if (prn[0] == 'S') {
|
---|
| 470 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 471 | + CLOCKORBIT_NUMQZSS
|
---|
| 472 | + bias.NumberOfSat[CLOCKORBIT_SATSBAS];
|
---|
| 473 | ++bias.NumberOfSat[CLOCKORBIT_SATSBAS];
|
---|
| 474 | }
|
---|
| 475 | else if (prn[0] == 'C') {
|
---|
| 476 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS + CLOCKORBIT_NUMGLONASS + CLOCKORBIT_NUMGALILEO
|
---|
| 477 | + CLOCKORBIT_NUMQZSS + CLOCKORBIT_NUMSBAS
|
---|
| 478 | + bias.NumberOfSat[CLOCKORBIT_SATBDS];
|
---|
| 479 | ++bias.NumberOfSat[CLOCKORBIT_SATBDS];
|
---|
| 480 | }
|
---|
[5662] | 481 |
|
---|
[5503] | 482 | // Code Biases
|
---|
| 483 | // -----------
|
---|
[3222] | 484 | if (biasSat) {
|
---|
| 485 | biasSat->ID = prn.mid(1).toInt();
|
---|
[5503] | 486 | biasSat->NumberOfCodeBiases = 0;
|
---|
[3222] | 487 | if (prn[0] == 'G') {
|
---|
[5503] | 488 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 489 | while (it.hasNext()) {
|
---|
| 490 | it.next();
|
---|
[5504] | 491 | if (it.key() == "1C") {
|
---|
[5503] | 492 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 493 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 494 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
|
---|
| 495 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 496 | }
|
---|
[5504] | 497 | else if (it.key() == "1P") {
|
---|
[5503] | 498 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 499 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 500 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
|
---|
| 501 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 502 | }
|
---|
[5504] | 503 | else if (it.key() == "1W") {
|
---|
[5503] | 504 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 505 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 506 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
|
---|
| 507 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 508 | }
|
---|
[5504] | 509 | else if (it.key() == "2C") {
|
---|
[5503] | 510 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 511 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 512 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
|
---|
| 513 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 514 | }
|
---|
[5504] | 515 | else if (it.key() == "2D") {
|
---|
[5503] | 516 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 517 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 518 | biasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
|
---|
| 519 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 520 | }
|
---|
[5504] | 521 | else if (it.key() == "2S") {
|
---|
[5503] | 522 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 523 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 524 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
|
---|
| 525 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 526 | }
|
---|
[5504] | 527 | else if (it.key() == "2L") {
|
---|
[5503] | 528 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 529 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 530 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
|
---|
| 531 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 532 | }
|
---|
[5504] | 533 | else if (it.key() == "2X") {
|
---|
[5503] | 534 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 535 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 536 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
|
---|
| 537 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 538 | }
|
---|
[5504] | 539 | else if (it.key() == "2P") {
|
---|
[5503] | 540 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 541 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 542 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
|
---|
| 543 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 544 | }
|
---|
[5510] | 545 | else if (it.key() == "2W") {
|
---|
[5503] | 546 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 547 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 548 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
|
---|
| 549 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 550 | }
|
---|
[5504] | 551 | else if (it.key() == "5I") {
|
---|
[5503] | 552 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 553 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 554 | biasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
|
---|
| 555 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 556 | }
|
---|
[5504] | 557 | else if (it.key() == "5Q") {
|
---|
[5503] | 558 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 559 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 560 | biasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
|
---|
| 561 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 562 | }
|
---|
[6844] | 563 | else if (it.key() == "5X") {
|
---|
| 564 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 565 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 566 | biasSat->Biases[ii].Type = CODETYPEGPS_L5_IQ;
|
---|
| 567 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 568 | }
|
---|
[5503] | 569 | }
|
---|
[3222] | 570 | }
|
---|
| 571 | else if (prn[0] == 'R') {
|
---|
[5503] | 572 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 573 | while (it.hasNext()) {
|
---|
| 574 | it.next();
|
---|
[5504] | 575 | if (it.key() == "1C") {
|
---|
[5503] | 576 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 577 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 578 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
|
---|
| 579 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 580 | }
|
---|
[5504] | 581 | else if (it.key() == "1P") {
|
---|
[5503] | 582 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 583 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 584 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
|
---|
| 585 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 586 | }
|
---|
[5504] | 587 | else if (it.key() == "2C") {
|
---|
[5503] | 588 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 589 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 590 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
|
---|
| 591 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 592 | }
|
---|
[5504] | 593 | else if (it.key() == "2P") {
|
---|
[5503] | 594 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 595 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 596 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
|
---|
| 597 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 598 | }
|
---|
| 599 | }
|
---|
[3222] | 600 | }
|
---|
[6844] | 601 | else if (prn[0] == 'E') {
|
---|
| 602 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 603 | while (it.hasNext()) {
|
---|
| 604 | it.next();
|
---|
| 605 | if (it.key() == "1A") {
|
---|
| 606 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 607 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 608 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_A;
|
---|
| 609 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 610 | }
|
---|
| 611 | else if (it.key() == "1B") {
|
---|
| 612 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 613 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 614 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_B;
|
---|
| 615 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 616 | }
|
---|
| 617 | else if (it.key() == "1C") {
|
---|
| 618 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 619 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 620 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E1_C;
|
---|
| 621 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 622 | }
|
---|
| 623 | else if (it.key() == "5I") {
|
---|
| 624 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 625 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 626 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_I;
|
---|
| 627 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 628 | }
|
---|
| 629 | else if (it.key() == "5Q") {
|
---|
| 630 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 631 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 632 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5A_Q;
|
---|
| 633 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 634 | }
|
---|
| 635 | else if (it.key() == "7I") {
|
---|
| 636 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 637 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 638 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_I;
|
---|
| 639 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 640 | }
|
---|
| 641 | else if (it.key() == "7Q") {
|
---|
| 642 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 643 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 644 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5B_Q;
|
---|
| 645 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 646 | }
|
---|
| 647 | else if (it.key() == "8I") {
|
---|
| 648 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 649 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 650 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_I;
|
---|
| 651 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 652 | }
|
---|
| 653 | else if (it.key() == "8Q") {
|
---|
| 654 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 655 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 656 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E5_Q;
|
---|
| 657 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 658 | }
|
---|
| 659 | else if (it.key() == "6A") {
|
---|
| 660 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 661 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 662 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_A;
|
---|
| 663 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 664 | }
|
---|
| 665 | else if (it.key() == "6B") {
|
---|
| 666 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 667 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 668 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_B;
|
---|
| 669 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 670 | }
|
---|
| 671 | else if (it.key() == "6C") {
|
---|
| 672 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 673 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 674 | biasSat->Biases[ii].Type = CODETYPEGALILEO_E6_C;
|
---|
| 675 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 676 | }
|
---|
| 677 | }
|
---|
| 678 | }
|
---|
| 679 | else if (prn[0] == 'J') {
|
---|
| 680 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 681 | while (it.hasNext()) {
|
---|
| 682 | it.next();
|
---|
| 683 | if (it.key() == "1C") {
|
---|
| 684 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 685 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 686 | biasSat->Biases[ii].Type = CODETYPEQZSS_L1_CA;
|
---|
| 687 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 688 | }
|
---|
| 689 | else if (it.key() == "1S") {
|
---|
| 690 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 691 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 692 | biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_D;
|
---|
| 693 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 694 | }
|
---|
| 695 | else if (it.key() == "1L") {
|
---|
| 696 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 697 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 698 | biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_P;
|
---|
| 699 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 700 | }
|
---|
| 701 | else if (it.key() == "1X") {
|
---|
| 702 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 703 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 704 | biasSat->Biases[ii].Type = CODETYPEQZSS_L1C_DP;
|
---|
| 705 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 706 | }
|
---|
| 707 | else if (it.key() == "2S") {
|
---|
| 708 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 709 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 710 | biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CM;
|
---|
| 711 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 712 | }
|
---|
| 713 | else if (it.key() == "2L") {
|
---|
| 714 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 715 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 716 | biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CL;
|
---|
| 717 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 718 | }
|
---|
| 719 | else if (it.key() == "2X") {
|
---|
| 720 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 721 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 722 | biasSat->Biases[ii].Type = CODETYPEQZSS_L2_CML;
|
---|
| 723 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 724 | }
|
---|
| 725 | else if (it.key() == "5I") {
|
---|
| 726 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 727 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 728 | biasSat->Biases[ii].Type = CODETYPEQZSS_L5_I;
|
---|
| 729 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 730 | }
|
---|
| 731 | else if (it.key() == "5Q") {
|
---|
| 732 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 733 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 734 | biasSat->Biases[ii].Type = CODETYPEQZSS_L5_Q;
|
---|
| 735 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 736 | }
|
---|
| 737 | else if (it.key() == "5X") {
|
---|
| 738 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 739 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 740 | biasSat->Biases[ii].Type = CODETYPEQZSS_L5_IQ;
|
---|
| 741 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 742 | }
|
---|
| 743 | else if (it.key() == "6S") {
|
---|
| 744 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 745 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 746 | biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_S;
|
---|
| 747 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 748 | }
|
---|
| 749 | else if (it.key() == "6L") {
|
---|
| 750 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 751 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 752 | biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_L;
|
---|
| 753 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 754 | }
|
---|
| 755 | else if (it.key() == "6X") {
|
---|
| 756 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 757 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 758 | biasSat->Biases[ii].Type = CODETYPEQZSS_LEX_SL;
|
---|
| 759 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 760 | }
|
---|
| 761 | }
|
---|
| 762 | }
|
---|
| 763 | else if (prn[0] == 'S') {
|
---|
| 764 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 765 | while (it.hasNext()) {
|
---|
| 766 | it.next();
|
---|
| 767 | if (it.key() == "1C") {
|
---|
| 768 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 769 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 770 | biasSat->Biases[ii].Type = CODETYPE_SBAS_L1_CA;
|
---|
| 771 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 772 | }
|
---|
| 773 | else if (it.key() == "5I") {
|
---|
| 774 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 775 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 776 | biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_I;
|
---|
| 777 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 778 | }
|
---|
| 779 | else if (it.key() == "5Q") {
|
---|
| 780 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 781 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 782 | biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_Q;
|
---|
| 783 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 784 | }
|
---|
| 785 | else if (it.key() == "5X") {
|
---|
| 786 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 787 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 788 | biasSat->Biases[ii].Type = CODETYPE_SBAS_L5_IQ;
|
---|
| 789 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 790 | }
|
---|
| 791 | }
|
---|
| 792 | }
|
---|
| 793 | else if (prn[0] == 'C') {
|
---|
| 794 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 795 | while (it.hasNext()) {
|
---|
| 796 | it.next();
|
---|
| 797 | if (it.key() == "2I") {
|
---|
| 798 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 799 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 800 | biasSat->Biases[ii].Type = CODETYPE_BDS_B1_I;
|
---|
| 801 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 802 | }
|
---|
| 803 | else if (it.key() == "2Q") {
|
---|
| 804 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 805 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 806 | biasSat->Biases[ii].Type = CODETYPE_BDS_B1_Q;
|
---|
| 807 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 808 | }
|
---|
| 809 | else if (it.key() == "2X") {
|
---|
| 810 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 811 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 812 | biasSat->Biases[ii].Type = CODETYPE_BDS_B1_IQ;
|
---|
| 813 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 814 | }
|
---|
| 815 | else if (it.key() == "6I") {
|
---|
| 816 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 817 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 818 | biasSat->Biases[ii].Type = CODETYPE_BDS_B3_I;
|
---|
| 819 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 820 | }
|
---|
| 821 | else if (it.key() == "6Q") {
|
---|
| 822 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 823 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 824 | biasSat->Biases[ii].Type = CODETYPE_BDS_B3_Q;
|
---|
| 825 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 826 | }
|
---|
| 827 | else if (it.key() == "6X") {
|
---|
| 828 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 829 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 830 | biasSat->Biases[ii].Type = CODETYPE_BDS_B3_IQ;
|
---|
| 831 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 832 | }
|
---|
| 833 | else if (it.key() == "7I") {
|
---|
| 834 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 835 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 836 | biasSat->Biases[ii].Type = CODETYPE_BDS_B2_I;
|
---|
| 837 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 838 | }
|
---|
| 839 | else if (it.key() == "7Q") {
|
---|
| 840 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 841 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 842 | biasSat->Biases[ii].Type = CODETYPE_BDS_B2_Q;
|
---|
| 843 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 844 | }
|
---|
| 845 | else if (it.key() == "7X") {
|
---|
| 846 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 847 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 848 | biasSat->Biases[ii].Type = CODETYPE_BDS_B2_IQ;
|
---|
| 849 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 850 | }
|
---|
| 851 | }
|
---|
| 852 | }
|
---|
[3222] | 853 | }
|
---|
| 854 | }
|
---|
| 855 | }
|
---|
[3227] | 856 |
|
---|
[5662] | 857 | QByteArray hlpBufferCo;
|
---|
[3493] | 858 |
|
---|
| 859 | // Orbit and Clock Corrections together
|
---|
| 860 | // ------------------------------------
|
---|
[4174] | 861 | if (_samplRtcmEphCorr == 0.0) {
|
---|
[6844] | 862 | if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0 ||
|
---|
| 863 | co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0 ||
|
---|
| 864 | co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0 ||
|
---|
| 865 | co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0 ||
|
---|
| 866 | co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 ||
|
---|
| 867 | co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
|
---|
[3493] | 868 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 869 | int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
|
---|
| 870 | if (len > 0) {
|
---|
| 871 | hlpBufferCo = QByteArray(obuffer, len);
|
---|
| 872 | }
|
---|
[3222] | 873 | }
|
---|
| 874 | }
|
---|
[3493] | 875 |
|
---|
| 876 | // Orbit and Clock Corrections separately
|
---|
| 877 | // --------------------------------------
|
---|
| 878 | else {
|
---|
[5666] | 879 | if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
|
---|
[3493] | 880 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[4174] | 881 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[4754] | 882 | co.UpdateInterval = ephUpdInd;
|
---|
[3591] | 883 | int len1 = MakeClockOrbit(&co, COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
[4754] | 884 | co.UpdateInterval = clkUpdInd;
|
---|
[3493] | 885 | if (len1 > 0) {
|
---|
| 886 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 887 | }
|
---|
| 888 | }
|
---|
[5666] | 889 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) ? 1 : 0;
|
---|
[3591] | 890 | int len2 = MakeClockOrbit(&co, COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
[3493] | 891 | if (len2 > 0) {
|
---|
| 892 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 893 | }
|
---|
| 894 | }
|
---|
[5666] | 895 | if (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
|
---|
[3493] | 896 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[4174] | 897 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[4754] | 898 | co.UpdateInterval = ephUpdInd;
|
---|
[3591] | 899 | int len1 = MakeClockOrbit(&co, COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
[4754] | 900 | co.UpdateInterval = clkUpdInd;
|
---|
[3493] | 901 | if (len1 > 0) {
|
---|
| 902 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 903 | }
|
---|
| 904 | }
|
---|
[6844] | 905 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) ? 1 : 0;
|
---|
| 906 | int len2 = MakeClockOrbit(&co, COTYPE_GLONASSCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
[3493] | 907 | if (len2 > 0) {
|
---|
| 908 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 909 | }
|
---|
| 910 | }
|
---|
[6844] | 911 | if (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) {
|
---|
| 912 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 913 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
| 914 | co.UpdateInterval = ephUpdInd;
|
---|
| 915 | int len1 = MakeClockOrbit(&co, COTYPE_GALILEOORBIT, 1, obuffer, sizeof(obuffer));
|
---|
| 916 | co.UpdateInterval = clkUpdInd;
|
---|
| 917 | if (len1 > 0) {
|
---|
| 918 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 919 | }
|
---|
| 920 | }
|
---|
| 921 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) ? 1 : 0;
|
---|
| 922 | int len2 = MakeClockOrbit(&co, COTYPE_GALILEOCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
| 923 | if (len2 > 0) {
|
---|
| 924 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 925 | }
|
---|
| 926 | }
|
---|
| 927 | if (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) {
|
---|
| 928 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 929 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
| 930 | co.UpdateInterval = ephUpdInd;
|
---|
| 931 | int len1 = MakeClockOrbit(&co, COTYPE_QZSSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
| 932 | co.UpdateInterval = clkUpdInd;
|
---|
| 933 | if (len1 > 0) {
|
---|
| 934 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 935 | }
|
---|
| 936 | }
|
---|
| 937 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) ? 1 : 0;
|
---|
| 938 | int len2 = MakeClockOrbit(&co, COTYPE_QZSSCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
| 939 | if (len2 > 0) {
|
---|
| 940 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 941 | }
|
---|
| 942 | }
|
---|
| 943 | if (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) {
|
---|
| 944 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 945 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
| 946 | co.UpdateInterval = ephUpdInd;
|
---|
| 947 | int len1 = MakeClockOrbit(&co, COTYPE_SBASORBIT, 1, obuffer, sizeof(obuffer));
|
---|
| 948 | co.UpdateInterval = clkUpdInd;
|
---|
| 949 | if (len1 > 0) {
|
---|
| 950 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 951 | }
|
---|
| 952 | }
|
---|
| 953 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) ? 1 : 0;
|
---|
| 954 | int len2 = MakeClockOrbit(&co, COTYPE_SBASCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
| 955 | if (len2 > 0) {
|
---|
| 956 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 957 | }
|
---|
| 958 | }
|
---|
| 959 | if (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
|
---|
| 960 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 961 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
| 962 | co.UpdateInterval = ephUpdInd;
|
---|
| 963 | int len1 = MakeClockOrbit(&co, COTYPE_BDSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
| 964 | co.UpdateInterval = clkUpdInd;
|
---|
| 965 | if (len1 > 0) {
|
---|
| 966 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 967 | }
|
---|
| 968 | }
|
---|
| 969 | int len2 = MakeClockOrbit(&co, COTYPE_BDSCLOCK, 0, obuffer, sizeof(obuffer));
|
---|
| 970 | if (len2 > 0) {
|
---|
| 971 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 972 | }
|
---|
| 973 | }
|
---|
[3493] | 974 | }
|
---|
[5662] | 975 |
|
---|
[3493] | 976 | // Biases
|
---|
| 977 | // ------
|
---|
[5662] | 978 | QByteArray hlpBufferBias;
|
---|
[6844] | 979 | if (bias.NumberOfSat[CLOCKORBIT_SATGPS] > 0 ||
|
---|
| 980 | bias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0 ||
|
---|
| 981 | bias.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0 ||
|
---|
| 982 | bias.NumberOfSat[CLOCKORBIT_SATQZSS] > 0 ||
|
---|
| 983 | bias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 ||
|
---|
| 984 | bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) {
|
---|
[3222] | 985 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[5666] | 986 | int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
|
---|
[3222] | 987 | if (len > 0) {
|
---|
[3227] | 988 | hlpBufferBias = QByteArray(obuffer, len);
|
---|
[3222] | 989 | }
|
---|
| 990 | }
|
---|
[3227] | 991 |
|
---|
[4808] | 992 | _outBuffer += hlpBufferCo + hlpBufferBias;
|
---|
[3222] | 993 | }
|
---|
| 994 |
|
---|
[5662] | 995 | //
|
---|
[3222] | 996 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6442] | 997 | void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
|
---|
[4991] | 998 | double GPSweeks, const QString& prn,
|
---|
| 999 | const ColumnVector& rtnAPC,
|
---|
| 1000 | double rtnClk,
|
---|
| 1001 | const ColumnVector& rtnVel,
|
---|
| 1002 | const ColumnVector& rtnCoM,
|
---|
| 1003 | struct ClockOrbit::SatData* sd,
|
---|
| 1004 | QString& outLine) {
|
---|
[3222] | 1005 |
|
---|
[4930] | 1006 | // Broadcast Position and Velocity
|
---|
| 1007 | // -------------------------------
|
---|
| 1008 | ColumnVector xB(4);
|
---|
| 1009 | ColumnVector vB(3);
|
---|
[6109] | 1010 | eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
|
---|
[5662] | 1011 |
|
---|
[4991] | 1012 | // Precise Position
|
---|
| 1013 | // ----------------
|
---|
| 1014 | ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
|
---|
[3222] | 1015 |
|
---|
[5662] | 1016 | double dc = 0.0;
|
---|
[4930] | 1017 | if (_crdTrafo != "IGS08") {
|
---|
| 1018 | crdTrafo(GPSweek, xP, dc);
|
---|
| 1019 | }
|
---|
[5662] | 1020 |
|
---|
[4930] | 1021 | // Difference in xyz
|
---|
| 1022 | // -----------------
|
---|
| 1023 | ColumnVector dx = xB.Rows(1,3) - xP;
|
---|
[4991] | 1024 | ColumnVector dv = vB - rtnVel;
|
---|
[5662] | 1025 |
|
---|
[4930] | 1026 | // Difference in RSW
|
---|
| 1027 | // -----------------
|
---|
[3222] | 1028 | ColumnVector rsw(3);
|
---|
[4930] | 1029 | XYZ_to_RSW(xB.Rows(1,3), vB, dx, rsw);
|
---|
[3222] | 1030 |
|
---|
[4930] | 1031 | ColumnVector dotRsw(3);
|
---|
| 1032 | XYZ_to_RSW(xB.Rows(1,3), vB, dv, dotRsw);
|
---|
[3222] | 1033 |
|
---|
[4930] | 1034 | // Clock Correction
|
---|
| 1035 | // ----------------
|
---|
[4991] | 1036 | double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
|
---|
[3222] | 1037 |
|
---|
| 1038 | if (sd) {
|
---|
[4930] | 1039 | sd->ID = prn.mid(1).toInt();
|
---|
| 1040 | sd->IOD = eph->IOD();
|
---|
| 1041 | sd->Clock.DeltaA0 = dClk;
|
---|
[5655] | 1042 | sd->Clock.DeltaA1 = 0.0; // TODO
|
---|
| 1043 | sd->Clock.DeltaA2 = 0.0; // TODO
|
---|
[4930] | 1044 | sd->Orbit.DeltaRadial = rsw(1);
|
---|
| 1045 | sd->Orbit.DeltaAlongTrack = rsw(2);
|
---|
| 1046 | sd->Orbit.DeltaCrossTrack = rsw(3);
|
---|
| 1047 | sd->Orbit.DotDeltaRadial = dotRsw(1);
|
---|
| 1048 | sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
|
---|
| 1049 | sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
|
---|
[3222] | 1050 | }
|
---|
| 1051 |
|
---|
[5662] | 1052 | outLine.sprintf("%d %.1f %s %3d %10.3f %8.3f %8.3f %8.3f\n",
|
---|
[5776] | 1053 | GPSweek, GPSweeks, eph->prn().toString().c_str(),
|
---|
[3222] | 1054 | eph->IOD(), dClk, rsw(1), rsw(2), rsw(3));
|
---|
| 1055 |
|
---|
[4991] | 1056 | double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
|
---|
| 1057 | double sp3Clk = (rtnClk - relativity) / t_CST::c; // in seconds
|
---|
| 1058 |
|
---|
[3222] | 1059 | if (_rnx) {
|
---|
[4991] | 1060 | _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
|
---|
[3222] | 1061 | }
|
---|
| 1062 | if (_sp3) {
|
---|
[4991] | 1063 | _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
|
---|
[3222] | 1064 | }
|
---|
| 1065 | }
|
---|
| 1066 |
|
---|
| 1067 | // Transform Coordinates
|
---|
| 1068 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5662] | 1069 | void bncRtnetUploadCaster::crdTrafo(int GPSWeek, ColumnVector& xyz,
|
---|
[4803] | 1070 | double& dc) {
|
---|
[3222] | 1071 |
|
---|
| 1072 | // Current epoch minus 2000.0 in years
|
---|
| 1073 | // ------------------------------------
|
---|
| 1074 | double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
|
---|
| 1075 |
|
---|
| 1076 | ColumnVector dx(3);
|
---|
| 1077 |
|
---|
| 1078 | dx(1) = _dx + dt * _dxr;
|
---|
| 1079 | dx(2) = _dy + dt * _dyr;
|
---|
| 1080 | dx(3) = _dz + dt * _dzr;
|
---|
| 1081 |
|
---|
| 1082 | static const double arcSec = 180.0 * 3600.0 / M_PI;
|
---|
| 1083 |
|
---|
| 1084 | double ox = (_ox + dt * _oxr) / arcSec;
|
---|
| 1085 | double oy = (_oy + dt * _oyr) / arcSec;
|
---|
| 1086 | double oz = (_oz + dt * _ozr) / arcSec;
|
---|
| 1087 |
|
---|
| 1088 | double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
|
---|
| 1089 |
|
---|
[4912] | 1090 | // Specify approximate center of area
|
---|
| 1091 | // ----------------------------------
|
---|
| 1092 | ColumnVector meanSta(3);
|
---|
| 1093 |
|
---|
| 1094 | if (_crdTrafo == "ETRF2000") {
|
---|
[4973] | 1095 | meanSta(1) = 3661090.0;
|
---|
| 1096 | meanSta(2) = 845230.0;
|
---|
| 1097 | meanSta(3) = 5136850.0;
|
---|
[4908] | 1098 | }
|
---|
[4912] | 1099 | else if (_crdTrafo == "NAD83") {
|
---|
[4973] | 1100 | meanSta(1) = -1092950.0;
|
---|
| 1101 | meanSta(2) = -4383600.0;
|
---|
| 1102 | meanSta(3) = 4487420.0;
|
---|
[4912] | 1103 | }
|
---|
| 1104 | else if (_crdTrafo == "GDA94") {
|
---|
[4973] | 1105 | meanSta(1) = -4052050.0;
|
---|
| 1106 | meanSta(2) = 4212840.0;
|
---|
| 1107 | meanSta(3) = -2545110.0;
|
---|
[4912] | 1108 | }
|
---|
| 1109 | else if (_crdTrafo == "SIRGAS2000") {
|
---|
[4973] | 1110 | meanSta(1) = 3740860.0;
|
---|
| 1111 | meanSta(2) = -4964290.0;
|
---|
| 1112 | meanSta(3) = -1425420.0;
|
---|
[4912] | 1113 | }
|
---|
| 1114 | else if (_crdTrafo == "SIRGAS95") {
|
---|
[4973] | 1115 | meanSta(1) = 3135390.0;
|
---|
| 1116 | meanSta(2) = -5017670.0;
|
---|
| 1117 | meanSta(3) = -2374440.0;
|
---|
[4912] | 1118 | }
|
---|
[5343] | 1119 | else if (_crdTrafo == "DREF91") {
|
---|
| 1120 | meanSta(1) = 3959579.0;
|
---|
| 1121 | meanSta(2) = 721719.0;
|
---|
| 1122 | meanSta(3) = 4931539.0;
|
---|
| 1123 | }
|
---|
[4912] | 1124 | else if (_crdTrafo == "Custom") {
|
---|
| 1125 | meanSta(1) = 0.0; // TODO
|
---|
| 1126 | meanSta(2) = 0.0; // TODO
|
---|
| 1127 | meanSta(3) = 0.0; // TODO
|
---|
| 1128 | }
|
---|
[4908] | 1129 |
|
---|
[4912] | 1130 | // Clock correction proportional to topocentric distance to satellites
|
---|
| 1131 | // -------------------------------------------------------------------
|
---|
| 1132 | double rho = (xyz - meanSta).norm_Frobenius();
|
---|
[4913] | 1133 | dc = rho * (sc - 1.0) / sc / t_CST::c;
|
---|
[4908] | 1134 |
|
---|
[3222] | 1135 | Matrix rMat(3,3);
|
---|
| 1136 | rMat(1,1) = 1.0;
|
---|
| 1137 | rMat(1,2) = -oz;
|
---|
| 1138 | rMat(1,3) = oy;
|
---|
| 1139 | rMat(2,1) = oz;
|
---|
| 1140 | rMat(2,2) = 1.0;
|
---|
| 1141 | rMat(2,3) = -ox;
|
---|
| 1142 | rMat(3,1) = -oy;
|
---|
| 1143 | rMat(3,2) = ox;
|
---|
| 1144 | rMat(3,3) = 1.0;
|
---|
| 1145 |
|
---|
| 1146 | xyz = sc * rMat * xyz + dx;
|
---|
| 1147 | }
|
---|
| 1148 |
|
---|
[6557] | 1149 | int bncRtnetUploadCaster::determineUpdateInd(double samplingRate) {
|
---|
| 1150 |
|
---|
| 1151 | if (samplingRate == 10.0) {
|
---|
| 1152 | return 3;
|
---|
| 1153 | }
|
---|
| 1154 | else if (samplingRate == 15.0) {
|
---|
| 1155 | return 4;
|
---|
| 1156 | }
|
---|
| 1157 | else if (samplingRate == 30.0) {
|
---|
| 1158 | return 5;
|
---|
| 1159 | }
|
---|
| 1160 | else if (samplingRate == 60.0) {
|
---|
| 1161 | return 6;
|
---|
| 1162 | }
|
---|
| 1163 | else if (samplingRate == 120.0) {
|
---|
| 1164 | return 7;
|
---|
| 1165 | }
|
---|
| 1166 | else if (samplingRate == 240.0) {
|
---|
| 1167 | return 8;
|
---|
| 1168 | }
|
---|
| 1169 | else if (samplingRate == 300.0) {
|
---|
| 1170 | return 9;
|
---|
| 1171 | }
|
---|
| 1172 | else if (samplingRate == 600.0) {
|
---|
| 1173 | return 10;
|
---|
| 1174 | }
|
---|
| 1175 | else if (samplingRate == 900.0) {
|
---|
| 1176 | return 11;
|
---|
| 1177 | }
|
---|
| 1178 | else if (samplingRate == 1800.0) {
|
---|
| 1179 | return 12;
|
---|
| 1180 | }
|
---|
| 1181 | else if (samplingRate == 3600.0) {
|
---|
| 1182 | return 13;
|
---|
| 1183 | }
|
---|
| 1184 | else if (samplingRate == 7200.0) {
|
---|
| 1185 | return 14;
|
---|
| 1186 | }
|
---|
| 1187 | else if (samplingRate == 10800.0) {
|
---|
| 1188 | return 15;
|
---|
| 1189 | }
|
---|
| 1190 | return 2;// default
|
---|
| 1191 | }
|
---|