[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"
|
---|
| 23 |
|
---|
[6139] | 24 | extern "C" {
|
---|
| 25 | # include "rtcm3torinex.h"
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[3222] | 28 | using namespace std;
|
---|
| 29 |
|
---|
| 30 | // Constructor
|
---|
| 31 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 32 | bncRtnetUploadCaster::bncRtnetUploadCaster(const QString& mountpoint,
|
---|
[3222] | 33 | const QString& outHost, int outPort,
|
---|
[5662] | 34 | const QString& password,
|
---|
| 35 | const QString& crdTrafo, bool CoM,
|
---|
[3222] | 36 | const QString& sp3FileName,
|
---|
| 37 | const QString& rnxFileName,
|
---|
[4111] | 38 | int PID, int SID, int IOD, int iRow) :
|
---|
[3273] | 39 | bncUploadCaster(mountpoint, outHost, outPort, password, iRow, 0) {
|
---|
[3224] | 40 |
|
---|
[5130] | 41 | if (!outHost.isEmpty()) {
|
---|
| 42 | _casterID += outHost;
|
---|
| 43 | }
|
---|
| 44 | if (!crdTrafo.isEmpty()) {
|
---|
| 45 | _casterID += " " + crdTrafo;
|
---|
| 46 | }
|
---|
| 47 | if (!sp3FileName.isEmpty()) {
|
---|
| 48 | _casterID += " " + sp3FileName;
|
---|
| 49 | }
|
---|
| 50 | if (!rnxFileName.isEmpty()) {
|
---|
| 51 | _casterID += " " + rnxFileName;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
[3222] | 54 | _crdTrafo = crdTrafo;
|
---|
| 55 | _CoM = CoM;
|
---|
[4111] | 56 | _PID = PID;
|
---|
| 57 | _SID = SID;
|
---|
| 58 | _IOD = IOD;
|
---|
[3222] | 59 |
|
---|
[3224] | 60 | // Member that receives the ephemeris
|
---|
| 61 | // ----------------------------------
|
---|
[6441] | 62 | _ephUser = new bncEphUser(true);
|
---|
[3222] | 63 |
|
---|
[3272] | 64 | bncSettings settings;
|
---|
| 65 | QString intr = settings.value("uploadIntr").toString();
|
---|
[6559] | 66 | QStringList hlp = settings.value("combineStreams").toStringList();
|
---|
| 67 | _samplRtcmEphCorr = settings.value("uploadSamplRtcmEphCorr").toDouble();
|
---|
| 68 | if (hlp.size() > 1) { // combination stream upload
|
---|
[6557] | 69 | _samplRtcmClkCorr = settings.value("cmbSampl").toInt();
|
---|
| 70 | } else { // single stream upload or sp3 file generation
|
---|
| 71 | _samplRtcmClkCorr = 5; // default
|
---|
| 72 | }
|
---|
| 73 | int samplClkRnx = settings.value("uploadSamplClkRnx").toInt();
|
---|
| 74 | int samplSp3 = settings.value("uploadSamplSp3").toInt() * 60;
|
---|
[4174] | 75 |
|
---|
| 76 | if (_samplRtcmEphCorr == 0.0) {
|
---|
[3753] | 77 | _usedEph = 0;
|
---|
| 78 | }
|
---|
| 79 | else {
|
---|
[6442] | 80 | _usedEph = new QMap<QString, const t_eph*>;
|
---|
[3753] | 81 | }
|
---|
[3272] | 82 |
|
---|
[3222] | 83 | // RINEX writer
|
---|
| 84 | // ------------
|
---|
| 85 | if (!rnxFileName.isEmpty()) {
|
---|
[4174] | 86 | _rnx = new bncClockRinex(rnxFileName, intr, samplClkRnx);
|
---|
[3222] | 87 | }
|
---|
| 88 | else {
|
---|
| 89 | _rnx = 0;
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | // SP3 writer
|
---|
| 93 | // ----------
|
---|
| 94 | if (!sp3FileName.isEmpty()) {
|
---|
[4174] | 95 | _sp3 = new bncSP3(sp3FileName, intr, samplSp3);
|
---|
[3222] | 96 | }
|
---|
| 97 | else {
|
---|
| 98 | _sp3 = 0;
|
---|
| 99 | }
|
---|
| 100 |
|
---|
| 101 | // Set Transformation Parameters
|
---|
| 102 | // -----------------------------
|
---|
| 103 | if (_crdTrafo == "ETRF2000") {
|
---|
[3890] | 104 | _dx = 0.0521;
|
---|
| 105 | _dy = 0.0493;
|
---|
| 106 | _dz = -0.0585;
|
---|
| 107 | _dxr = 0.0001;
|
---|
[3222] | 108 | _dyr = 0.0001;
|
---|
| 109 | _dzr = -0.0018;
|
---|
| 110 | _ox = 0.000891;
|
---|
| 111 | _oy = 0.005390;
|
---|
| 112 | _oz = -0.008712;
|
---|
| 113 | _oxr = 0.000081;
|
---|
| 114 | _oyr = 0.000490;
|
---|
| 115 | _ozr = -0.000792;
|
---|
[3890] | 116 | _sc = 1.34;
|
---|
[3222] | 117 | _scr = 0.08;
|
---|
| 118 | _t0 = 2000.0;
|
---|
| 119 | }
|
---|
| 120 | else if (_crdTrafo == "NAD83") {
|
---|
[5345] | 121 | _dx = 0.99343;
|
---|
| 122 | _dy = -1.90331;
|
---|
| 123 | _dz = -0.52655;
|
---|
| 124 | _dxr = 0.00079;
|
---|
| 125 | _dyr = -0.00060;
|
---|
| 126 | _dzr = -0.00134;
|
---|
| 127 | _ox = -0.02591467;
|
---|
| 128 | _oy = -0.00942645;
|
---|
| 129 | _oz = -0.01159935;
|
---|
| 130 | _oxr = -0.00006667;
|
---|
| 131 | _oyr = 0.00075744;
|
---|
| 132 | _ozr = 0.00005133;
|
---|
| 133 | _sc = 1.71504;
|
---|
[5348] | 134 | _scr = -0.10201;
|
---|
[5345] | 135 | _t0 = 1997.0;
|
---|
[3222] | 136 | }
|
---|
| 137 | else if (_crdTrafo == "GDA94") {
|
---|
[4963] | 138 | _dx = -0.08468;
|
---|
| 139 | _dy = -0.01942;
|
---|
| 140 | _dz = 0.03201;
|
---|
| 141 | _dxr = 0.00142;
|
---|
| 142 | _dyr = 0.00134;
|
---|
| 143 | _dzr = 0.00090;
|
---|
| 144 | _ox = 0.0004254;
|
---|
| 145 | _oy = -0.0022578;
|
---|
| 146 | _oz = -0.0024015;
|
---|
| 147 | _oxr = -0.0015461;
|
---|
| 148 | _oyr = -0.0011820;
|
---|
| 149 | _ozr = -0.0011551;
|
---|
| 150 | _sc = 9.710;
|
---|
| 151 | _scr = 0.109;
|
---|
[3222] | 152 | _t0 = 1994.0;
|
---|
| 153 | }
|
---|
| 154 | else if (_crdTrafo == "SIRGAS2000") {
|
---|
[4956] | 155 | _dx = 0.0020;
|
---|
| 156 | _dy = 0.0041;
|
---|
| 157 | _dz = 0.0039;
|
---|
[3222] | 158 | _dxr = 0.0000;
|
---|
| 159 | _dyr = 0.0000;
|
---|
| 160 | _dzr = 0.0000;
|
---|
[4956] | 161 | _ox = 0.000170;
|
---|
| 162 | _oy = -0.000030;
|
---|
| 163 | _oz = 0.000070;
|
---|
[3222] | 164 | _oxr = 0.000000;
|
---|
| 165 | _oyr = 0.000000;
|
---|
| 166 | _ozr = 0.000000;
|
---|
[5662] | 167 | _sc = -1.000;
|
---|
[3222] | 168 | _scr = 0.000;
|
---|
| 169 | _t0 = 0000.0;
|
---|
| 170 | }
|
---|
| 171 | else if (_crdTrafo == "SIRGAS95") {
|
---|
| 172 | _dx = 0.0077;
|
---|
| 173 | _dy = 0.0058;
|
---|
| 174 | _dz = -0.0138;
|
---|
| 175 | _dxr = 0.0000;
|
---|
| 176 | _dyr = 0.0000;
|
---|
| 177 | _dzr = 0.0000;
|
---|
| 178 | _ox = 0.000000;
|
---|
| 179 | _oy = 0.000000;
|
---|
| 180 | _oz = -0.000030;
|
---|
| 181 | _oxr = 0.000000;
|
---|
| 182 | _oyr = 0.000000;
|
---|
| 183 | _ozr = 0.000000;
|
---|
| 184 | _sc = 1.570;
|
---|
| 185 | _scr = 0.000;
|
---|
| 186 | _t0 = 0000.0;
|
---|
| 187 | }
|
---|
[5347] | 188 | else if (_crdTrafo == "DREF91") {
|
---|
[5340] | 189 | _dx = -0.0118;
|
---|
| 190 | _dy = 0.1432;
|
---|
| 191 | _dz = -0.1117;
|
---|
| 192 | _dxr = 0.0001;
|
---|
| 193 | _dyr = 0.0001;
|
---|
| 194 | _dzr = -0.0018;
|
---|
| 195 | _ox = 0.003291;
|
---|
| 196 | _oy = 0.006190;
|
---|
| 197 | _oz = -0.011012;
|
---|
| 198 | _oxr = 0.000081;
|
---|
| 199 | _oyr = 0.000490;
|
---|
| 200 | _ozr = -0.000792;
|
---|
| 201 | _sc = 12.24;
|
---|
| 202 | _scr = 0.08;
|
---|
| 203 | _t0 = 2000.0;
|
---|
| 204 | }
|
---|
[3222] | 205 | else if (_crdTrafo == "Custom") {
|
---|
| 206 | _dx = settings.value("trafo_dx").toDouble();
|
---|
| 207 | _dy = settings.value("trafo_dy").toDouble();
|
---|
| 208 | _dz = settings.value("trafo_dz").toDouble();
|
---|
| 209 | _dxr = settings.value("trafo_dxr").toDouble();
|
---|
| 210 | _dyr = settings.value("trafo_dyr").toDouble();
|
---|
| 211 | _dzr = settings.value("trafo_dzr").toDouble();
|
---|
| 212 | _ox = settings.value("trafo_ox").toDouble();
|
---|
| 213 | _oy = settings.value("trafo_oy").toDouble();
|
---|
| 214 | _oz = settings.value("trafo_oz").toDouble();
|
---|
| 215 | _oxr = settings.value("trafo_oxr").toDouble();
|
---|
| 216 | _oyr = settings.value("trafo_oyr").toDouble();
|
---|
| 217 | _ozr = settings.value("trafo_ozr").toDouble();
|
---|
| 218 | _sc = settings.value("trafo_sc").toDouble();
|
---|
| 219 | _scr = settings.value("trafo_scr").toDouble();
|
---|
| 220 | _t0 = settings.value("trafo_t0").toDouble();
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 |
|
---|
| 224 | // Destructor
|
---|
| 225 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 226 | bncRtnetUploadCaster::~bncRtnetUploadCaster() {
|
---|
[3222] | 227 | if (isRunning()) {
|
---|
| 228 | wait();
|
---|
| 229 | }
|
---|
| 230 | delete _rnx;
|
---|
| 231 | delete _sp3;
|
---|
| 232 | delete _ephUser;
|
---|
[3753] | 233 | delete _usedEph;
|
---|
[3222] | 234 | }
|
---|
| 235 |
|
---|
[5662] | 236 | //
|
---|
[3222] | 237 | ////////////////////////////////////////////////////////////////////////////
|
---|
[3224] | 238 | void bncRtnetUploadCaster::decodeRtnetStream(char* buffer, int bufLen) {
|
---|
[5662] | 239 |
|
---|
[3222] | 240 | QMutexLocker locker(&_mutex);
|
---|
| 241 |
|
---|
[3230] | 242 | // Append to internal buffer
|
---|
| 243 | // -------------------------
|
---|
[3222] | 244 | _rtnetStreamBuffer.append(QByteArray(buffer, bufLen));
|
---|
[3230] | 245 |
|
---|
| 246 | // Select buffer part that contains last epoch
|
---|
| 247 | // -------------------------------------------
|
---|
| 248 | QStringList lines;
|
---|
| 249 | int iEpoBeg = _rtnetStreamBuffer.lastIndexOf('*'); // begin of last epoch
|
---|
| 250 | if (iEpoBeg == -1) {
|
---|
[3226] | 251 | _rtnetStreamBuffer.clear();
|
---|
| 252 | return;
|
---|
[3222] | 253 | }
|
---|
[3230] | 254 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoBeg);
|
---|
| 255 |
|
---|
| 256 | int iEpoEnd = _rtnetStreamBuffer.lastIndexOf("EOE"); // end of last epoch
|
---|
| 257 | if (iEpoEnd == -1) {
|
---|
| 258 | return;
|
---|
| 259 | }
|
---|
[3226] | 260 | else {
|
---|
[3230] | 261 | lines = _rtnetStreamBuffer.left(iEpoEnd).split('\n', QString::SkipEmptyParts);
|
---|
| 262 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iEpoEnd+3);
|
---|
[3226] | 263 | }
|
---|
[3222] | 264 |
|
---|
[3226] | 265 | if (lines.size() < 2) {
|
---|
[3222] | 266 | return;
|
---|
| 267 | }
|
---|
| 268 |
|
---|
[3226] | 269 | // Keep the last unfinished line in buffer
|
---|
| 270 | // ---------------------------------------
|
---|
| 271 | int iLastEOL = _rtnetStreamBuffer.lastIndexOf('\n');
|
---|
| 272 | if (iLastEOL != -1) {
|
---|
| 273 | _rtnetStreamBuffer = _rtnetStreamBuffer.mid(iLastEOL+1);
|
---|
| 274 | }
|
---|
| 275 |
|
---|
| 276 | // Read first line (with epoch time)
|
---|
| 277 | // ---------------------------------
|
---|
| 278 | QTextStream in(lines[0].toAscii());
|
---|
| 279 | QString hlp;
|
---|
| 280 | int year, month, day, hour, min;
|
---|
| 281 | double sec;
|
---|
| 282 | in >> hlp >> year >> month >> day >> hour >> min >> sec;
|
---|
| 283 | bncTime epoTime; epoTime.set( year, month, day, hour, min, sec);
|
---|
| 284 |
|
---|
[5662] | 285 | emit(newMessage("bncRtnetUploadCaster: decode " +
|
---|
[5131] | 286 | QByteArray(epoTime.datestr().c_str()) + " " +
|
---|
[5662] | 287 | QByteArray(epoTime.timestr().c_str()) + " " +
|
---|
[5132] | 288 | _casterID.toAscii(), false));
|
---|
[4808] | 289 |
|
---|
[3222] | 290 | struct ClockOrbit co;
|
---|
| 291 | memset(&co, 0, sizeof(co));
|
---|
[5672] | 292 | co.EpochTime[CLOCKORBIT_SATGPS] = static_cast<int>(epoTime.gpssec());
|
---|
| 293 | double gt = epoTime.gpssec() + 3 * 3600 - gnumleap(year, month, day);
|
---|
| 294 | co.EpochTime[CLOCKORBIT_SATGLONASS] = static_cast<int>(fmod(gt, 86400.0));
|
---|
| 295 |
|
---|
[5666] | 296 | co.Supplied[COBOFS_CLOCK] = 1;
|
---|
| 297 | co.Supplied[COBOFS_ORBIT] = 1;
|
---|
[3222] | 298 | co.SatRefDatum = DATUM_ITRF;
|
---|
[4111] | 299 | co.SSRIOD = _IOD;
|
---|
| 300 | co.SSRProviderID = _PID; // 256 .. BKG, 257 ... EUREF
|
---|
| 301 | co.SSRSolutionID = _SID;
|
---|
[5662] | 302 |
|
---|
[5666] | 303 | struct CodeBias bias;
|
---|
[3222] | 304 | memset(&bias, 0, sizeof(bias));
|
---|
[5666] | 305 | bias.EpochTime[CLOCKORBIT_SATGPS] = co.EpochTime[CLOCKORBIT_SATGPS];
|
---|
| 306 | bias.EpochTime[CLOCKORBIT_SATGLONASS] = co.EpochTime[CLOCKORBIT_SATGLONASS];
|
---|
[5662] | 307 |
|
---|
[4753] | 308 | // Default Update Interval
|
---|
| 309 | // -----------------------
|
---|
[4754] | 310 | int clkUpdInd = 2; // 5 sec
|
---|
| 311 | int ephUpdInd = clkUpdInd; // default
|
---|
[6557] | 312 |
|
---|
[6559] | 313 | if (_samplRtcmClkCorr > 5.0 && _samplRtcmEphCorr <= 5.0) { // combined orb and clock
|
---|
| 314 | ephUpdInd = determineUpdateInd(_samplRtcmClkCorr);
|
---|
[4754] | 315 | }
|
---|
[6559] | 316 | if (_samplRtcmClkCorr > 5.0) {
|
---|
[6557] | 317 | clkUpdInd = determineUpdateInd(_samplRtcmClkCorr);
|
---|
[4754] | 318 | }
|
---|
[6559] | 319 | if (_samplRtcmEphCorr > 5.0) {
|
---|
| 320 | ephUpdInd = determineUpdateInd(_samplRtcmEphCorr);
|
---|
| 321 | }
|
---|
[4753] | 322 |
|
---|
[4754] | 323 | co.UpdateInterval = clkUpdInd;
|
---|
| 324 | bias.UpdateInterval = clkUpdInd;
|
---|
[4753] | 325 |
|
---|
[3226] | 326 | for (int ii = 1; ii < lines.size(); ii++) {
|
---|
[5662] | 327 |
|
---|
[3222] | 328 | QString prn;
|
---|
[4991] | 329 | ColumnVector rtnAPC;
|
---|
| 330 | ColumnVector rtnVel;
|
---|
| 331 | ColumnVector rtnCoM;
|
---|
| 332 | double rtnClk;
|
---|
[5662] | 333 |
|
---|
[3222] | 334 | QTextStream in(lines[ii].toAscii());
|
---|
| 335 |
|
---|
| 336 | in >> prn;
|
---|
| 337 |
|
---|
[6442] | 338 | const t_eph* ephLast = _ephUser->ephLast(prn);
|
---|
| 339 | const t_eph* ephPrev = _ephUser->ephPrev(prn);
|
---|
| 340 | const t_eph* eph = ephLast;
|
---|
[3222] | 341 |
|
---|
[6442] | 342 | if (eph) {
|
---|
[3754] | 343 |
|
---|
[4098] | 344 | // Use previous ephemeris if the last one is too recent
|
---|
| 345 | // ----------------------------------------------------
|
---|
| 346 | const int MINAGE = 60; // seconds
|
---|
[6442] | 347 | if (ephPrev && eph->receptDateTime().isValid() &&
|
---|
[4098] | 348 | eph->receptDateTime().secsTo(currentDateAndTimeGPS()) < MINAGE) {
|
---|
[6442] | 349 | eph = ephPrev;
|
---|
[4098] | 350 | }
|
---|
[3754] | 351 |
|
---|
[3753] | 352 | // Make sure the clock messages refer to same IOD as orbit messages
|
---|
| 353 | // ----------------------------------------------------------------
|
---|
| 354 | if (_usedEph) {
|
---|
[4174] | 355 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[3753] | 356 | (*_usedEph)[prn] = eph;
|
---|
| 357 | }
|
---|
| 358 | else {
|
---|
| 359 | eph = 0;
|
---|
| 360 | if (_usedEph->contains(prn)) {
|
---|
[6442] | 361 | const t_eph* usedEph = _usedEph->value(prn);
|
---|
| 362 | if (usedEph == ephLast) {
|
---|
| 363 | eph = ephLast;
|
---|
[3753] | 364 | }
|
---|
[6442] | 365 | else if (usedEph == ephPrev) {
|
---|
| 366 | eph = ephPrev;
|
---|
[3753] | 367 | }
|
---|
| 368 | }
|
---|
| 369 | }
|
---|
| 370 | }
|
---|
| 371 | }
|
---|
| 372 |
|
---|
| 373 | if (eph) {
|
---|
| 374 |
|
---|
[5503] | 375 | QMap<QString, double> codeBiases;
|
---|
| 376 |
|
---|
[4991] | 377 | while (true) {
|
---|
| 378 | QString key;
|
---|
| 379 | int numVal = 0;
|
---|
| 380 | in >> key >> numVal;
|
---|
| 381 | if (in.status() != QTextStream::Ok) {
|
---|
| 382 | break;
|
---|
| 383 | }
|
---|
| 384 | if (key == "APC") {
|
---|
| 385 | rtnAPC.ReSize(3);
|
---|
| 386 | in >> rtnAPC[0] >> rtnAPC[1] >> rtnAPC[2];
|
---|
| 387 | }
|
---|
| 388 | else if (key == "Clk") {
|
---|
| 389 | in >> rtnClk;
|
---|
| 390 | }
|
---|
| 391 | else if (key == "Vel") {
|
---|
| 392 | rtnVel.ReSize(3);
|
---|
| 393 | in >> rtnVel[0] >> rtnVel[1] >> rtnVel[2];
|
---|
| 394 | }
|
---|
| 395 | else if (key == "CoM") {
|
---|
| 396 | rtnCoM.ReSize(3);
|
---|
| 397 | in >> rtnCoM[0] >> rtnCoM[1] >> rtnCoM[2];
|
---|
| 398 | }
|
---|
[5503] | 399 | else if (key == "CodeBias") {
|
---|
| 400 | for (int ii = 0; ii < numVal; ii++) {
|
---|
| 401 | QString type;
|
---|
| 402 | double value;
|
---|
| 403 | in >> type >> value;
|
---|
| 404 | codeBiases[type] = value;
|
---|
| 405 | }
|
---|
| 406 | }
|
---|
[4991] | 407 | else {
|
---|
| 408 | for (int ii = 0; ii < numVal; ii++) {
|
---|
| 409 | double dummy;
|
---|
| 410 | in >> dummy;
|
---|
| 411 | }
|
---|
| 412 | }
|
---|
[5662] | 413 | }
|
---|
[3222] | 414 | struct ClockOrbit::SatData* sd = 0;
|
---|
| 415 | if (prn[0] == 'G') {
|
---|
[5666] | 416 | sd = co.Sat + co.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
| 417 | ++co.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
[3222] | 418 | }
|
---|
| 419 | else if (prn[0] == 'R') {
|
---|
[5666] | 420 | sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
| 421 | ++co.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[3222] | 422 | }
|
---|
| 423 | if (sd) {
|
---|
| 424 | QString outLine;
|
---|
[5662] | 425 | processSatellite(eph, epoTime.gpsw(), epoTime.gpssec(), prn,
|
---|
[4991] | 426 | rtnAPC, rtnClk, rtnVel, rtnCoM, sd, outLine);
|
---|
[3222] | 427 | }
|
---|
[5662] | 428 |
|
---|
[5666] | 429 | struct CodeBias::BiasSat* biasSat = 0;
|
---|
[3222] | 430 | if (prn[0] == 'G') {
|
---|
[5666] | 431 | biasSat = bias.Sat + bias.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
| 432 | ++bias.NumberOfSat[CLOCKORBIT_SATGPS];
|
---|
[3222] | 433 | }
|
---|
| 434 | else if (prn[0] == 'R') {
|
---|
[5666] | 435 | biasSat = bias.Sat + CLOCKORBIT_NUMGPS + bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
| 436 | ++bias.NumberOfSat[CLOCKORBIT_SATGLONASS];
|
---|
[3222] | 437 | }
|
---|
[5662] | 438 |
|
---|
[5503] | 439 | // Code Biases
|
---|
| 440 | // -----------
|
---|
[3222] | 441 | if (biasSat) {
|
---|
| 442 | biasSat->ID = prn.mid(1).toInt();
|
---|
[5503] | 443 | biasSat->NumberOfCodeBiases = 0;
|
---|
[3222] | 444 | if (prn[0] == 'G') {
|
---|
[5503] | 445 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 446 | while (it.hasNext()) {
|
---|
| 447 | it.next();
|
---|
[5504] | 448 | if (it.key() == "1C") {
|
---|
[5503] | 449 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 450 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 451 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
|
---|
| 452 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 453 | }
|
---|
[5504] | 454 | else if (it.key() == "1C") {
|
---|
[5503] | 455 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 456 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 457 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_CA;
|
---|
| 458 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 459 | }
|
---|
[5504] | 460 | else if (it.key() == "1P") {
|
---|
[5503] | 461 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 462 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 463 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_P;
|
---|
| 464 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 465 | }
|
---|
[5504] | 466 | else if (it.key() == "1W") {
|
---|
[5503] | 467 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 468 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 469 | biasSat->Biases[ii].Type = CODETYPEGPS_L1_Z;
|
---|
| 470 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 471 | }
|
---|
[5504] | 472 | else if (it.key() == "2C") {
|
---|
[5503] | 473 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 474 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 475 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CA;
|
---|
| 476 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 477 | }
|
---|
[5504] | 478 | else if (it.key() == "2D") {
|
---|
[5503] | 479 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 480 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 481 | biasSat->Biases[ii].Type = CODETYPEGPS_SEMI_CODELESS;
|
---|
| 482 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 483 | }
|
---|
[5504] | 484 | else if (it.key() == "2S") {
|
---|
[5503] | 485 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 486 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 487 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CM;
|
---|
| 488 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 489 | }
|
---|
[5504] | 490 | else if (it.key() == "2L") {
|
---|
[5503] | 491 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 492 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 493 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CL;
|
---|
| 494 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 495 | }
|
---|
[5504] | 496 | else if (it.key() == "2X") {
|
---|
[5503] | 497 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 498 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 499 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_CML;
|
---|
| 500 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 501 | }
|
---|
[5504] | 502 | else if (it.key() == "2P") {
|
---|
[5503] | 503 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 504 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 505 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_P;
|
---|
| 506 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 507 | }
|
---|
[5510] | 508 | else if (it.key() == "2W") {
|
---|
[5503] | 509 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 510 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 511 | biasSat->Biases[ii].Type = CODETYPEGPS_L2_Z;
|
---|
| 512 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 513 | }
|
---|
[5504] | 514 | else if (it.key() == "5I") {
|
---|
[5503] | 515 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 516 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 517 | biasSat->Biases[ii].Type = CODETYPEGPS_L5_I;
|
---|
| 518 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 519 | }
|
---|
[5504] | 520 | else if (it.key() == "5Q") {
|
---|
[5503] | 521 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 522 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 523 | biasSat->Biases[ii].Type = CODETYPEGPS_L5_Q;
|
---|
| 524 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 525 | }
|
---|
| 526 | }
|
---|
[3222] | 527 | }
|
---|
| 528 | else if (prn[0] == 'R') {
|
---|
[5503] | 529 | QMapIterator<QString, double> it(codeBiases);
|
---|
| 530 | while (it.hasNext()) {
|
---|
| 531 | it.next();
|
---|
[5504] | 532 | if (it.key() == "1C") {
|
---|
[5503] | 533 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 534 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 535 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_CA;
|
---|
| 536 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 537 | }
|
---|
[5504] | 538 | else if (it.key() == "1P") {
|
---|
[5503] | 539 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 540 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 541 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L1_P;
|
---|
| 542 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 543 | }
|
---|
[5504] | 544 | else if (it.key() == "2C") {
|
---|
[5503] | 545 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 546 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 547 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_CA;
|
---|
| 548 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 549 | }
|
---|
[5504] | 550 | else if (it.key() == "2P") {
|
---|
[5503] | 551 | int ii = biasSat->NumberOfCodeBiases; if (ii >= CLOCKORBIT_NUMBIAS) break;
|
---|
| 552 | biasSat->NumberOfCodeBiases += 1;
|
---|
| 553 | biasSat->Biases[ii].Type = CODETYPEGLONASS_L2_P;
|
---|
| 554 | biasSat->Biases[ii].Bias = it.value();
|
---|
| 555 | }
|
---|
| 556 | }
|
---|
[3222] | 557 | }
|
---|
| 558 | }
|
---|
| 559 | }
|
---|
| 560 | }
|
---|
[3227] | 561 |
|
---|
[5662] | 562 | QByteArray hlpBufferCo;
|
---|
[3493] | 563 |
|
---|
| 564 | // Orbit and Clock Corrections together
|
---|
| 565 | // ------------------------------------
|
---|
[4174] | 566 | if (_samplRtcmEphCorr == 0.0) {
|
---|
[5666] | 567 | if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0 || co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
|
---|
[3493] | 568 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
| 569 | int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
|
---|
| 570 | if (len > 0) {
|
---|
| 571 | hlpBufferCo = QByteArray(obuffer, len);
|
---|
| 572 | }
|
---|
[3222] | 573 | }
|
---|
| 574 | }
|
---|
[3493] | 575 |
|
---|
| 576 | // Orbit and Clock Corrections separately
|
---|
| 577 | // --------------------------------------
|
---|
| 578 | else {
|
---|
[5666] | 579 | if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
|
---|
[3493] | 580 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[4174] | 581 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[4754] | 582 | co.UpdateInterval = ephUpdInd;
|
---|
[3591] | 583 | int len1 = MakeClockOrbit(&co, COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
[4754] | 584 | co.UpdateInterval = clkUpdInd;
|
---|
[3493] | 585 | if (len1 > 0) {
|
---|
| 586 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 587 | }
|
---|
| 588 | }
|
---|
[5666] | 589 | int mmsg = (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) ? 1 : 0;
|
---|
[3591] | 590 | int len2 = MakeClockOrbit(&co, COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer));
|
---|
[3493] | 591 | if (len2 > 0) {
|
---|
| 592 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 593 | }
|
---|
| 594 | }
|
---|
[5666] | 595 | if (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
|
---|
[3493] | 596 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[4174] | 597 | if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
|
---|
[4754] | 598 | co.UpdateInterval = ephUpdInd;
|
---|
[3591] | 599 | int len1 = MakeClockOrbit(&co, COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer));
|
---|
[4754] | 600 | co.UpdateInterval = clkUpdInd;
|
---|
[3493] | 601 | if (len1 > 0) {
|
---|
| 602 | hlpBufferCo += QByteArray(obuffer, len1);
|
---|
| 603 | }
|
---|
| 604 | }
|
---|
| 605 | int len2 = MakeClockOrbit(&co, COTYPE_GLONASSCLOCK, 0, obuffer, sizeof(obuffer));
|
---|
| 606 | if (len2 > 0) {
|
---|
| 607 | hlpBufferCo += QByteArray(obuffer, len2);
|
---|
| 608 | }
|
---|
| 609 | }
|
---|
| 610 | }
|
---|
[5662] | 611 |
|
---|
[3493] | 612 | // Biases
|
---|
| 613 | // ------
|
---|
[5662] | 614 | QByteArray hlpBufferBias;
|
---|
[5666] | 615 | if (bias.NumberOfSat[CLOCKORBIT_SATGPS] > 0 || bias.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
|
---|
[3222] | 616 | char obuffer[CLOCKORBIT_BUFFERSIZE];
|
---|
[5666] | 617 | int len = MakeCodeBias(&bias, BTYPE_AUTO, 0, obuffer, sizeof(obuffer));
|
---|
[3222] | 618 | if (len > 0) {
|
---|
[3227] | 619 | hlpBufferBias = QByteArray(obuffer, len);
|
---|
[3222] | 620 | }
|
---|
| 621 | }
|
---|
[3227] | 622 |
|
---|
[4808] | 623 | _outBuffer += hlpBufferCo + hlpBufferBias;
|
---|
[3222] | 624 | }
|
---|
| 625 |
|
---|
[5662] | 626 | //
|
---|
[3222] | 627 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6442] | 628 | void bncRtnetUploadCaster::processSatellite(const t_eph* eph, int GPSweek,
|
---|
[4991] | 629 | double GPSweeks, const QString& prn,
|
---|
| 630 | const ColumnVector& rtnAPC,
|
---|
| 631 | double rtnClk,
|
---|
| 632 | const ColumnVector& rtnVel,
|
---|
| 633 | const ColumnVector& rtnCoM,
|
---|
| 634 | struct ClockOrbit::SatData* sd,
|
---|
| 635 | QString& outLine) {
|
---|
[3222] | 636 |
|
---|
[4930] | 637 | // Broadcast Position and Velocity
|
---|
| 638 | // -------------------------------
|
---|
| 639 | ColumnVector xB(4);
|
---|
| 640 | ColumnVector vB(3);
|
---|
[6109] | 641 | eph->getCrd(bncTime(GPSweek, GPSweeks), xB, vB, false);
|
---|
[5662] | 642 |
|
---|
[4991] | 643 | // Precise Position
|
---|
| 644 | // ----------------
|
---|
| 645 | ColumnVector xP = _CoM ? rtnCoM : rtnAPC;
|
---|
[3222] | 646 |
|
---|
[5662] | 647 | double dc = 0.0;
|
---|
[4930] | 648 | if (_crdTrafo != "IGS08") {
|
---|
| 649 | crdTrafo(GPSweek, xP, dc);
|
---|
| 650 | }
|
---|
[5662] | 651 |
|
---|
[4930] | 652 | // Difference in xyz
|
---|
| 653 | // -----------------
|
---|
| 654 | ColumnVector dx = xB.Rows(1,3) - xP;
|
---|
[4991] | 655 | ColumnVector dv = vB - rtnVel;
|
---|
[5662] | 656 |
|
---|
[4930] | 657 | // Difference in RSW
|
---|
| 658 | // -----------------
|
---|
[3222] | 659 | ColumnVector rsw(3);
|
---|
[4930] | 660 | XYZ_to_RSW(xB.Rows(1,3), vB, dx, rsw);
|
---|
[3222] | 661 |
|
---|
[4930] | 662 | ColumnVector dotRsw(3);
|
---|
| 663 | XYZ_to_RSW(xB.Rows(1,3), vB, dv, dotRsw);
|
---|
[3222] | 664 |
|
---|
[4930] | 665 | // Clock Correction
|
---|
| 666 | // ----------------
|
---|
[4991] | 667 | double dClk = rtnClk - (xB(4) - dc) * t_CST::c;
|
---|
[3222] | 668 |
|
---|
| 669 | if (sd) {
|
---|
[4930] | 670 | sd->ID = prn.mid(1).toInt();
|
---|
| 671 | sd->IOD = eph->IOD();
|
---|
| 672 | sd->Clock.DeltaA0 = dClk;
|
---|
[5655] | 673 | sd->Clock.DeltaA1 = 0.0; // TODO
|
---|
| 674 | sd->Clock.DeltaA2 = 0.0; // TODO
|
---|
[4930] | 675 | sd->Orbit.DeltaRadial = rsw(1);
|
---|
| 676 | sd->Orbit.DeltaAlongTrack = rsw(2);
|
---|
| 677 | sd->Orbit.DeltaCrossTrack = rsw(3);
|
---|
| 678 | sd->Orbit.DotDeltaRadial = dotRsw(1);
|
---|
| 679 | sd->Orbit.DotDeltaAlongTrack = dotRsw(2);
|
---|
| 680 | sd->Orbit.DotDeltaCrossTrack = dotRsw(3);
|
---|
[3222] | 681 | }
|
---|
| 682 |
|
---|
[5662] | 683 | outLine.sprintf("%d %.1f %s %3d %10.3f %8.3f %8.3f %8.3f\n",
|
---|
[5776] | 684 | GPSweek, GPSweeks, eph->prn().toString().c_str(),
|
---|
[3222] | 685 | eph->IOD(), dClk, rsw(1), rsw(2), rsw(3));
|
---|
| 686 |
|
---|
[4991] | 687 | double relativity = -2.0 * DotProduct(xP, rtnVel) / t_CST::c;
|
---|
| 688 | double sp3Clk = (rtnClk - relativity) / t_CST::c; // in seconds
|
---|
| 689 |
|
---|
[3222] | 690 | if (_rnx) {
|
---|
[4991] | 691 | _rnx->write(GPSweek, GPSweeks, prn, sp3Clk);
|
---|
[3222] | 692 | }
|
---|
| 693 | if (_sp3) {
|
---|
[4991] | 694 | _sp3->write(GPSweek, GPSweeks, prn, rtnCoM, sp3Clk);
|
---|
[3222] | 695 | }
|
---|
| 696 | }
|
---|
| 697 |
|
---|
| 698 | // Transform Coordinates
|
---|
| 699 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5662] | 700 | void bncRtnetUploadCaster::crdTrafo(int GPSWeek, ColumnVector& xyz,
|
---|
[4803] | 701 | double& dc) {
|
---|
[3222] | 702 |
|
---|
| 703 | // Current epoch minus 2000.0 in years
|
---|
| 704 | // ------------------------------------
|
---|
| 705 | double dt = (GPSWeek - (1042.0+6.0/7.0)) / 365.2422 * 7.0 + 2000.0 - _t0;
|
---|
| 706 |
|
---|
| 707 | ColumnVector dx(3);
|
---|
| 708 |
|
---|
| 709 | dx(1) = _dx + dt * _dxr;
|
---|
| 710 | dx(2) = _dy + dt * _dyr;
|
---|
| 711 | dx(3) = _dz + dt * _dzr;
|
---|
| 712 |
|
---|
| 713 | static const double arcSec = 180.0 * 3600.0 / M_PI;
|
---|
| 714 |
|
---|
| 715 | double ox = (_ox + dt * _oxr) / arcSec;
|
---|
| 716 | double oy = (_oy + dt * _oyr) / arcSec;
|
---|
| 717 | double oz = (_oz + dt * _ozr) / arcSec;
|
---|
| 718 |
|
---|
| 719 | double sc = 1.0 + _sc * 1e-9 + dt * _scr * 1e-9;
|
---|
| 720 |
|
---|
[4912] | 721 | // Specify approximate center of area
|
---|
| 722 | // ----------------------------------
|
---|
| 723 | ColumnVector meanSta(3);
|
---|
| 724 |
|
---|
| 725 | if (_crdTrafo == "ETRF2000") {
|
---|
[4973] | 726 | meanSta(1) = 3661090.0;
|
---|
| 727 | meanSta(2) = 845230.0;
|
---|
| 728 | meanSta(3) = 5136850.0;
|
---|
[4908] | 729 | }
|
---|
[4912] | 730 | else if (_crdTrafo == "NAD83") {
|
---|
[4973] | 731 | meanSta(1) = -1092950.0;
|
---|
| 732 | meanSta(2) = -4383600.0;
|
---|
| 733 | meanSta(3) = 4487420.0;
|
---|
[4912] | 734 | }
|
---|
| 735 | else if (_crdTrafo == "GDA94") {
|
---|
[4973] | 736 | meanSta(1) = -4052050.0;
|
---|
| 737 | meanSta(2) = 4212840.0;
|
---|
| 738 | meanSta(3) = -2545110.0;
|
---|
[4912] | 739 | }
|
---|
| 740 | else if (_crdTrafo == "SIRGAS2000") {
|
---|
[4973] | 741 | meanSta(1) = 3740860.0;
|
---|
| 742 | meanSta(2) = -4964290.0;
|
---|
| 743 | meanSta(3) = -1425420.0;
|
---|
[4912] | 744 | }
|
---|
| 745 | else if (_crdTrafo == "SIRGAS95") {
|
---|
[4973] | 746 | meanSta(1) = 3135390.0;
|
---|
| 747 | meanSta(2) = -5017670.0;
|
---|
| 748 | meanSta(3) = -2374440.0;
|
---|
[4912] | 749 | }
|
---|
[5343] | 750 | else if (_crdTrafo == "DREF91") {
|
---|
| 751 | meanSta(1) = 3959579.0;
|
---|
| 752 | meanSta(2) = 721719.0;
|
---|
| 753 | meanSta(3) = 4931539.0;
|
---|
| 754 | }
|
---|
[4912] | 755 | else if (_crdTrafo == "Custom") {
|
---|
| 756 | meanSta(1) = 0.0; // TODO
|
---|
| 757 | meanSta(2) = 0.0; // TODO
|
---|
| 758 | meanSta(3) = 0.0; // TODO
|
---|
| 759 | }
|
---|
[4908] | 760 |
|
---|
[4912] | 761 | // Clock correction proportional to topocentric distance to satellites
|
---|
| 762 | // -------------------------------------------------------------------
|
---|
| 763 | double rho = (xyz - meanSta).norm_Frobenius();
|
---|
[4913] | 764 | dc = rho * (sc - 1.0) / sc / t_CST::c;
|
---|
[4908] | 765 |
|
---|
[3222] | 766 | Matrix rMat(3,3);
|
---|
| 767 | rMat(1,1) = 1.0;
|
---|
| 768 | rMat(1,2) = -oz;
|
---|
| 769 | rMat(1,3) = oy;
|
---|
| 770 | rMat(2,1) = oz;
|
---|
| 771 | rMat(2,2) = 1.0;
|
---|
| 772 | rMat(2,3) = -ox;
|
---|
| 773 | rMat(3,1) = -oy;
|
---|
| 774 | rMat(3,2) = ox;
|
---|
| 775 | rMat(3,3) = 1.0;
|
---|
| 776 |
|
---|
| 777 | xyz = sc * rMat * xyz + dx;
|
---|
| 778 | }
|
---|
| 779 |
|
---|
[6557] | 780 | int bncRtnetUploadCaster::determineUpdateInd(double samplingRate) {
|
---|
| 781 |
|
---|
| 782 | if (samplingRate == 10.0) {
|
---|
| 783 | return 3;
|
---|
| 784 | }
|
---|
| 785 | else if (samplingRate == 15.0) {
|
---|
| 786 | return 4;
|
---|
| 787 | }
|
---|
| 788 | else if (samplingRate == 30.0) {
|
---|
| 789 | return 5;
|
---|
| 790 | }
|
---|
| 791 | else if (samplingRate == 60.0) {
|
---|
| 792 | return 6;
|
---|
| 793 | }
|
---|
| 794 | else if (samplingRate == 120.0) {
|
---|
| 795 | return 7;
|
---|
| 796 | }
|
---|
| 797 | else if (samplingRate == 240.0) {
|
---|
| 798 | return 8;
|
---|
| 799 | }
|
---|
| 800 | else if (samplingRate == 300.0) {
|
---|
| 801 | return 9;
|
---|
| 802 | }
|
---|
| 803 | else if (samplingRate == 600.0) {
|
---|
| 804 | return 10;
|
---|
| 805 | }
|
---|
| 806 | else if (samplingRate == 900.0) {
|
---|
| 807 | return 11;
|
---|
| 808 | }
|
---|
| 809 | else if (samplingRate == 1800.0) {
|
---|
| 810 | return 12;
|
---|
| 811 | }
|
---|
| 812 | else if (samplingRate == 3600.0) {
|
---|
| 813 | return 13;
|
---|
| 814 | }
|
---|
| 815 | else if (samplingRate == 7200.0) {
|
---|
| 816 | return 14;
|
---|
| 817 | }
|
---|
| 818 | else if (samplingRate == 10800.0) {
|
---|
| 819 | return 15;
|
---|
| 820 | }
|
---|
| 821 | return 2;// default
|
---|
| 822 | }
|
---|