[5860] | 1 |
|
---|
| 2 | // Part of BNC, a utility for retrieving decoding and
|
---|
| 3 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
| 4 | //
|
---|
| 5 | // Copyright (C) 2007
|
---|
| 6 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 7 | // http://www.bkg.bund.de
|
---|
| 8 | // Czech Technical University Prague, Department of Geodesy
|
---|
| 9 | // http://www.fsv.cvut.cz
|
---|
| 10 | //
|
---|
| 11 | // Email: euref-ip@bkg.bund.de
|
---|
| 12 | //
|
---|
| 13 | // This program is free software; you can redistribute it and/or
|
---|
| 14 | // modify it under the terms of the GNU General Public License
|
---|
| 15 | // as published by the Free Software Foundation, version 2.
|
---|
| 16 | //
|
---|
| 17 | // This program is distributed in the hope that it will be useful,
|
---|
| 18 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 20 | // GNU General Public License for more details.
|
---|
| 21 | //
|
---|
| 22 | // You should have received a copy of the GNU General Public License
|
---|
| 23 | // along with this program; if not, write to the Free Software
|
---|
| 24 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
| 25 |
|
---|
| 26 | /* -------------------------------------------------------------------------
|
---|
| 27 | * BKG NTRIP Client
|
---|
| 28 | * -------------------------------------------------------------------------
|
---|
| 29 | *
|
---|
[5883] | 30 | * Class: t_pppRun
|
---|
[5860] | 31 | *
|
---|
| 32 | * Purpose: Single Real-Time PPP Client
|
---|
| 33 | *
|
---|
| 34 | * Author: L. Mervart
|
---|
| 35 | *
|
---|
| 36 | * Created: 29-Jul-2014
|
---|
| 37 | *
|
---|
| 38 | * Changes:
|
---|
| 39 | *
|
---|
| 40 | * -----------------------------------------------------------------------*/
|
---|
| 41 |
|
---|
| 42 |
|
---|
| 43 | #include <iostream>
|
---|
| 44 | #include <iomanip>
|
---|
[5980] | 45 | #include <sstream>
|
---|
[5860] | 46 | #include <string.h>
|
---|
| 47 | #include <map>
|
---|
| 48 |
|
---|
[5883] | 49 | #include "pppRun.h"
|
---|
[5891] | 50 | #include "pppThread.h"
|
---|
[5860] | 51 | #include "bnccore.h"
|
---|
| 52 | #include "bncephuser.h"
|
---|
[5953] | 53 | #include "bncsettings.h"
|
---|
[5984] | 54 | #include "bncoutf.h"
|
---|
[5883] | 55 | #include "rinex/rnxobsfile.h"
|
---|
| 56 | #include "rinex/rnxnavfile.h"
|
---|
| 57 | #include "rinex/corrfile.h"
|
---|
[5860] | 58 |
|
---|
| 59 | using namespace BNC_PPP;
|
---|
| 60 | using namespace std;
|
---|
| 61 |
|
---|
| 62 | // Constructor
|
---|
| 63 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 64 | t_pppRun::t_pppRun(const t_pppOptions* opt) {
|
---|
| 65 |
|
---|
[5860] | 66 | _opt = opt;
|
---|
[5883] | 67 |
|
---|
[5860] | 68 | connect(this, SIGNAL(newMessage(QByteArray,bool)),
|
---|
| 69 | BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
|
---|
[5883] | 70 |
|
---|
[5954] | 71 | connect(this, SIGNAL(newPosition(QByteArray, bncTime, QVector<double>)),
|
---|
| 72 | BNC_CORE, SIGNAL(newPosition(QByteArray, bncTime, QVector<double>)));
|
---|
[5949] | 73 |
|
---|
[5883] | 74 | for (unsigned iPrn = 0; iPrn <= t_prn::MAXPRN; iPrn++) {
|
---|
| 75 | _lastOrbCorrIOD[iPrn] = -1;
|
---|
| 76 | _lastClkCorrValue[iPrn] = 0.0;
|
---|
| 77 | }
|
---|
| 78 |
|
---|
| 79 | _pppClient = new t_pppClient(_opt);
|
---|
| 80 |
|
---|
[5984] | 81 | bncSettings settings;
|
---|
| 82 |
|
---|
[5860] | 83 | if (_opt->_realTime) {
|
---|
[5945] | 84 | Qt::ConnectionType conType = Qt::AutoConnection;
|
---|
| 85 | if (BNC_CORE->mode() == t_bncCore::batchPostProcessing) {
|
---|
| 86 | conType = Qt::BlockingQueuedConnection;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
[5860] | 89 | connect(BNC_CORE->caster(), SIGNAL(newObs(QByteArray, QList<t_obs>)),
|
---|
[5945] | 90 | this, SLOT(slotNewObs(QByteArray, QList<t_obs>)),conType);
|
---|
[5860] | 91 |
|
---|
| 92 | connect(BNC_CORE, SIGNAL(newEphGPS(gpsephemeris)),
|
---|
[5945] | 93 | this, SLOT(slotNewEphGPS(gpsephemeris)),conType);
|
---|
[5860] | 94 |
|
---|
| 95 | connect(BNC_CORE, SIGNAL(newEphGlonass(glonassephemeris)),
|
---|
[5945] | 96 | this, SLOT(slotNewEphGlonass(glonassephemeris)),conType);
|
---|
[5860] | 97 |
|
---|
| 98 | connect(BNC_CORE, SIGNAL(newEphGalileo(galileoephemeris)),
|
---|
[5945] | 99 | this, SLOT(slotNewEphGalileo(galileoephemeris)),conType);
|
---|
[5860] | 100 |
|
---|
| 101 | connect(BNC_CORE, SIGNAL(newCorrections(QStringList)),
|
---|
[5945] | 102 | this, SLOT(slotNewCorrections(QStringList)),conType);
|
---|
[5860] | 103 | }
|
---|
| 104 | else {
|
---|
[5889] | 105 | _rnxObsFile = 0;
|
---|
| 106 | _rnxNavFile = 0;
|
---|
| 107 | _corrFile = 0;
|
---|
[5953] | 108 | _speed = settings.value("PPP/mapSpeedSlider").toInt();
|
---|
[5941] | 109 | connect(this, SIGNAL(progressRnxPPP(int)), BNC_CORE, SIGNAL(progressRnxPPP(int)));
|
---|
| 110 | connect(this, SIGNAL(finishedRnxPPP()), BNC_CORE, SIGNAL(finishedRnxPPP()));
|
---|
[5950] | 111 | connect(BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)),
|
---|
| 112 | this, SLOT(slotSetSpeed(int)));
|
---|
[5973] | 113 | connect(BNC_CORE, SIGNAL(stopRinexPPP()), this, SLOT(slotSetStopFlag()));
|
---|
[5860] | 114 | }
|
---|
[5973] | 115 |
|
---|
| 116 | _stopFlag = false;
|
---|
[5984] | 117 |
|
---|
| 118 | QString logFileSkl = settings.value("PPP/logFile").toString();
|
---|
| 119 | _logFile = new bncoutf(logFileSkl, "1 day", 0);
|
---|
[5860] | 120 | }
|
---|
| 121 |
|
---|
| 122 | // Destructor
|
---|
| 123 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 124 | t_pppRun::~t_pppRun() {
|
---|
[5984] | 125 | delete _logFile;
|
---|
[5860] | 126 | }
|
---|
| 127 |
|
---|
| 128 | //
|
---|
| 129 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 130 | void t_pppRun::slotNewEphGPS(gpsephemeris gpseph) {
|
---|
[5860] | 131 | QMutexLocker locker(&_mutex);
|
---|
| 132 | t_ephGPS eph;
|
---|
| 133 | eph.set(&gpseph);
|
---|
| 134 | _pppClient->putEphemeris(&eph);
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | //
|
---|
| 138 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 139 | void t_pppRun::slotNewEphGlonass(glonassephemeris gloeph) {
|
---|
[5860] | 140 | QMutexLocker locker(&_mutex);
|
---|
| 141 | t_ephGlo eph;
|
---|
| 142 | eph.set(&gloeph);
|
---|
| 143 | _pppClient->putEphemeris(&eph);
|
---|
| 144 | }
|
---|
| 145 |
|
---|
| 146 | //
|
---|
| 147 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 148 | void t_pppRun::slotNewEphGalileo(galileoephemeris galeph) {
|
---|
[5860] | 149 | QMutexLocker locker(&_mutex);
|
---|
| 150 | t_ephGal eph;
|
---|
| 151 | eph.set(&galeph);
|
---|
| 152 | _pppClient->putEphemeris(&eph);
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | //
|
---|
| 156 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 157 | void t_pppRun::slotNewObs(QByteArray staID, QList<t_obs> obsList) {
|
---|
[5860] | 158 | QMutexLocker locker(&_mutex);
|
---|
| 159 |
|
---|
| 160 | if (string(staID.data()) != _opt->_roverName) {
|
---|
| 161 | return;
|
---|
| 162 | }
|
---|
| 163 |
|
---|
| 164 | // Loop over all obsevations (possible different epochs)
|
---|
| 165 | // -----------------------------------------------------
|
---|
| 166 | QListIterator<t_obs> it(obsList);
|
---|
| 167 | while (it.hasNext()) {
|
---|
| 168 | const t_obs& oldObs = it.next();
|
---|
| 169 | t_satObs* newObs = new t_satObs;
|
---|
| 170 |
|
---|
| 171 | newObs->_prn.set(oldObs.satSys, oldObs.satNum);
|
---|
| 172 | newObs->_time.set(oldObs.GPSWeek, oldObs.GPSWeeks);
|
---|
| 173 |
|
---|
| 174 | // Find the corresponding data epoch or create a new one
|
---|
| 175 | // -----------------------------------------------------
|
---|
| 176 | t_epoData* epoch = 0;
|
---|
| 177 | deque<t_epoData*>::const_iterator it;
|
---|
| 178 | for (it = _epoData.begin(); it != _epoData.end(); it++) {
|
---|
| 179 | if (newObs->_time == (*it)->_time) {
|
---|
| 180 | epoch = *it;
|
---|
| 181 | break;
|
---|
| 182 | }
|
---|
| 183 | }
|
---|
| 184 | if (epoch == 0) {
|
---|
| 185 | if (_epoData.empty() || newObs->_time > _epoData.back()->_time) {
|
---|
| 186 | epoch = new t_epoData;
|
---|
| 187 | epoch->_time = newObs->_time;
|
---|
| 188 | _epoData.push_back(epoch);
|
---|
| 189 | }
|
---|
| 190 | }
|
---|
| 191 |
|
---|
| 192 | // Fill the new observation and add it to the corresponding epoch
|
---|
| 193 | // --------------------------------------------------------------
|
---|
| 194 | if (epoch != 0) {
|
---|
| 195 | epoch->_satObs.push_back(newObs);
|
---|
| 196 | map<string, t_frqObs*> frqObsMap;
|
---|
| 197 | for (unsigned iEntry = 0; iEntry < GNSSENTRY_NUMBER; iEntry++) {
|
---|
[5936] | 198 | string hlp = oldObs.rnxStr(iEntry).toAscii().data();
|
---|
[5933] | 199 | if (hlp.length() >= 2 && oldObs._measdata[iEntry] != 0.0) {
|
---|
[5860] | 200 | char obsType = hlp[0];
|
---|
| 201 | string rnxType2ch = hlp.substr(1);
|
---|
| 202 | if (obsType == 'C' || obsType == 'L') {
|
---|
| 203 | t_frqObs* frqObs = 0;
|
---|
| 204 | if (frqObsMap.find(rnxType2ch) == frqObsMap.end()) {
|
---|
| 205 | frqObs = new t_frqObs();
|
---|
| 206 | frqObsMap[rnxType2ch] = frqObs;
|
---|
| 207 | frqObs->_rnxType2ch = rnxType2ch;
|
---|
| 208 | newObs->_obs.push_back(frqObs);
|
---|
| 209 | }
|
---|
| 210 | else {
|
---|
| 211 | frqObs = frqObsMap[rnxType2ch];
|
---|
| 212 | }
|
---|
| 213 | if (obsType == 'C') {
|
---|
| 214 | frqObs->_code = oldObs._measdata[iEntry];
|
---|
| 215 | frqObs->_codeValid = true;
|
---|
| 216 | }
|
---|
| 217 | else if (obsType == 'L') {
|
---|
| 218 | frqObs->_phase = oldObs._measdata[iEntry];
|
---|
| 219 | frqObs->_phaseValid = true;
|
---|
| 220 | }
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 | }
|
---|
| 224 | }
|
---|
| 225 | }
|
---|
| 226 |
|
---|
| 227 | // Process the oldest epochs
|
---|
| 228 | // ------------------------
|
---|
[5923] | 229 | while (_epoData.size() &&
|
---|
| 230 | (!_opt->_realTime || _epoData.front()->_time < _lastClkCorrTime + 10.0)) {
|
---|
[5860] | 231 |
|
---|
| 232 | const vector<t_satObs*>& satObs = _epoData.front()->_satObs;
|
---|
| 233 |
|
---|
| 234 | t_output output;
|
---|
| 235 | _pppClient->processEpoch(satObs, &output);
|
---|
| 236 |
|
---|
[5953] | 237 | if (!output._error) {
|
---|
[5879] | 238 | QVector<double> xx(6);
|
---|
| 239 | xx.data()[0] = output._xyzRover[0];
|
---|
| 240 | xx.data()[1] = output._xyzRover[1];
|
---|
| 241 | xx.data()[2] = output._xyzRover[2];
|
---|
| 242 | xx.data()[3] = output._neu[0];
|
---|
| 243 | xx.data()[4] = output._neu[1];
|
---|
| 244 | xx.data()[5] = output._neu[2];
|
---|
[5954] | 245 | emit newPosition(staID, output._epoTime, xx);
|
---|
[5873] | 246 | }
|
---|
| 247 |
|
---|
[5860] | 248 | delete _epoData.front(); _epoData.pop_front();
|
---|
| 249 |
|
---|
[5980] | 250 | ostringstream log;
|
---|
| 251 | if (output._error) {
|
---|
| 252 | log << output._log;
|
---|
| 253 | }
|
---|
| 254 | else {
|
---|
| 255 | log.setf(ios::fixed);
|
---|
[5982] | 256 | log << string(output._epoTime) << ' ' << staID.data()
|
---|
| 257 | << " X = " << setprecision(4) << output._xyzRover[0]
|
---|
| 258 | << " Y = " << setprecision(4) << output._xyzRover[1]
|
---|
| 259 | << " Z = " << setprecision(4) << output._xyzRover[2]
|
---|
| 260 | << " NEU: " << setprecision(4) << output._neu[0]
|
---|
| 261 | << " " << setprecision(4) << output._neu[1]
|
---|
| 262 | << " " << setprecision(4) << output._neu[2];
|
---|
[5980] | 263 | }
|
---|
| 264 |
|
---|
[5984] | 265 | _logFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), QString(output._log.c_str()));
|
---|
| 266 |
|
---|
[5980] | 267 | emit newMessage(QByteArray(log.str().c_str()), true);
|
---|
[5860] | 268 | }
|
---|
| 269 | }
|
---|
| 270 |
|
---|
| 271 | //
|
---|
| 272 | ////////////////////////////////////////////////////////////////////////////
|
---|
[5883] | 273 | void t_pppRun::slotNewCorrections(QStringList corrList) {
|
---|
[5860] | 274 | QMutexLocker locker(&_mutex);
|
---|
| 275 |
|
---|
| 276 | // Check the Mountpoint (source of corrections)
|
---|
| 277 | // --------------------------------------------
|
---|
[5937] | 278 | if (_opt->_realTime) {
|
---|
| 279 | if (_opt->_corrMount.empty()) {
|
---|
| 280 | return;
|
---|
| 281 | }
|
---|
| 282 | QMutableListIterator<QString> itm(corrList);
|
---|
| 283 | while (itm.hasNext()) {
|
---|
| 284 | QStringList hlp = itm.next().split(" ");
|
---|
| 285 | if (hlp.size() > 0) {
|
---|
| 286 | QString mountpoint = hlp[hlp.size()-1];
|
---|
| 287 | if (mountpoint != QString(_opt->_corrMount.c_str())) {
|
---|
| 288 | itm.remove();
|
---|
| 289 | }
|
---|
[5860] | 290 | }
|
---|
| 291 | }
|
---|
| 292 | }
|
---|
| 293 |
|
---|
| 294 | if (corrList.size() == 0) {
|
---|
| 295 | return;
|
---|
| 296 | }
|
---|
| 297 |
|
---|
| 298 | vector<t_orbCorr*> orbCorr;
|
---|
| 299 | vector<t_clkCorr*> clkCorr;
|
---|
| 300 | vector<t_satBias*> satBias;
|
---|
| 301 |
|
---|
| 302 | QListIterator<QString> it(corrList);
|
---|
| 303 | while (it.hasNext()) {
|
---|
| 304 | QString line = it.next();
|
---|
| 305 |
|
---|
| 306 | QTextStream in(&line);
|
---|
| 307 | int messageType;
|
---|
| 308 | int updateInterval;
|
---|
| 309 | int GPSweek;
|
---|
| 310 | double GPSweeks;
|
---|
| 311 | QString prn;
|
---|
| 312 | in >> messageType >> updateInterval >> GPSweek >> GPSweeks >> prn;
|
---|
| 313 |
|
---|
| 314 | if ( t_corr::relevantMessageType(messageType) ) {
|
---|
| 315 | t_corr corr;
|
---|
| 316 | corr.readLine(line);
|
---|
| 317 | if (messageType == COTYPE_GPSCOMBINED || messageType == COTYPE_GLONASSCOMBINED ||
|
---|
| 318 | messageType == COTYPE_GPSORBIT || messageType == COTYPE_GLONASSORBIT ) {
|
---|
| 319 | t_orbCorr* cc = new t_orbCorr();
|
---|
| 320 | cc->_prn.set(corr.prn.toAscii().data());
|
---|
| 321 | cc->_iod = corr.iod;
|
---|
| 322 | cc->_time = corr.tRao;
|
---|
| 323 | cc->_system = 'R';
|
---|
| 324 | cc->_xr[0] = corr.rao[0];
|
---|
| 325 | cc->_xr[1] = corr.rao[1];
|
---|
| 326 | cc->_xr[2] = corr.rao[2];
|
---|
| 327 | cc->_dotXr[0] = corr.dotRao[0];
|
---|
| 328 | cc->_dotXr[0] = corr.dotRao[1];
|
---|
| 329 | cc->_dotXr[0] = corr.dotRao[2];
|
---|
| 330 | orbCorr.push_back(cc);
|
---|
| 331 |
|
---|
| 332 | _lastOrbCorrIOD[cc->_prn.toInt()] = cc->_iod;
|
---|
| 333 | }
|
---|
| 334 | else if (messageType == COTYPE_GPSCOMBINED || messageType == COTYPE_GLONASSCOMBINED ||
|
---|
| 335 | messageType == COTYPE_GPSCLOCK || messageType == COTYPE_GLONASSCLOCK ) {
|
---|
| 336 | t_clkCorr* cc = new t_clkCorr();
|
---|
| 337 | cc->_prn.set(corr.prn.toAscii().data());
|
---|
| 338 | cc->_iod = corr.iod;
|
---|
| 339 | cc->_time = corr.tClk;
|
---|
| 340 | cc->_dClk = corr.dClk;
|
---|
| 341 | cc->_dotDClk = corr.dotDClk;
|
---|
| 342 | cc->_dotDotDClk = corr.dotDotDClk;
|
---|
| 343 | cc->_clkPartial = 0.0;
|
---|
| 344 | if (messageType == COTYPE_GPSCLOCK || messageType == COTYPE_GLONASSCLOCK) {
|
---|
| 345 | int lastIOD = _lastOrbCorrIOD[cc->_prn.toInt()];
|
---|
| 346 | if (lastIOD != -1) {
|
---|
| 347 | cc->_iod = lastIOD;
|
---|
| 348 | }
|
---|
| 349 | else {
|
---|
| 350 | delete cc;
|
---|
| 351 | cc = 0;
|
---|
| 352 | }
|
---|
| 353 | }
|
---|
| 354 | if (cc) {
|
---|
| 355 | clkCorr.push_back(cc);
|
---|
| 356 | if (_lastClkCorrTime.undef() || cc->_time > _lastClkCorrTime) {
|
---|
| 357 | _lastClkCorrTime = cc->_time;
|
---|
| 358 | }
|
---|
| 359 | }
|
---|
| 360 | }
|
---|
| 361 | }
|
---|
| 362 | else if ( messageType == BTYPE_GPS || messageType == BTYPE_GLONASS ) {
|
---|
| 363 | t_bias bias;
|
---|
| 364 | bias.readLine(line);
|
---|
| 365 | }
|
---|
| 366 | }
|
---|
| 367 |
|
---|
| 368 | _pppClient->putOrbCorrections(orbCorr);
|
---|
| 369 | _pppClient->putClkCorrections(clkCorr);
|
---|
| 370 | _pppClient->putBiases(satBias);
|
---|
| 371 |
|
---|
| 372 | for (unsigned ii = 0; ii < orbCorr.size(); ii++) {
|
---|
| 373 | delete orbCorr[ii];
|
---|
| 374 | }
|
---|
| 375 | for (unsigned ii = 0; ii < clkCorr.size(); ii++) {
|
---|
| 376 | delete clkCorr[ii];
|
---|
| 377 | }
|
---|
| 378 | for (unsigned ii = 0; ii < satBias.size(); ii++) {
|
---|
| 379 | delete satBias[ii];
|
---|
| 380 | }
|
---|
| 381 | }
|
---|
[5883] | 382 |
|
---|
| 383 |
|
---|
| 384 | //
|
---|
| 385 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 386 | void t_pppRun::processFiles() {
|
---|
| 387 |
|
---|
| 388 | try {
|
---|
[5889] | 389 | _rnxObsFile = new t_rnxObsFile(QString(_opt->_rinexObs.c_str()), t_rnxObsFile::input);
|
---|
[5883] | 390 | }
|
---|
| 391 | catch (...) {
|
---|
| 392 | delete _rnxObsFile; _rnxObsFile = 0;
|
---|
[5940] | 393 | emit finishedRnxPPP();
|
---|
[5883] | 394 | return;
|
---|
| 395 | }
|
---|
| 396 |
|
---|
[5889] | 397 | _rnxNavFile = new t_rnxNavFile(QString(_opt->_rinexNav.c_str()), t_rnxNavFile::input);
|
---|
[5883] | 398 |
|
---|
[5889] | 399 | if (!_opt->_corrFile.empty()) {
|
---|
| 400 | _corrFile = new t_corrFile(QString(_opt->_corrFile.c_str()));
|
---|
[5883] | 401 | connect(_corrFile, SIGNAL(newCorrections(QStringList)),
|
---|
[5889] | 402 | this, SLOT(slotNewCorrections(QStringList)));
|
---|
[5883] | 403 | }
|
---|
| 404 |
|
---|
| 405 | // Read/Process Observations
|
---|
| 406 | // -------------------------
|
---|
| 407 | int nEpo = 0;
|
---|
| 408 | const t_rnxObsFile::t_rnxEpo* epo = 0;
|
---|
[5973] | 409 | while ( !_stopFlag && (epo = _rnxObsFile->nextEpoch()) != 0 ) {
|
---|
[5883] | 410 | ++nEpo;
|
---|
| 411 |
|
---|
[5951] | 412 | if (_speed < 100) {
|
---|
| 413 | double sleepTime = 2.0 / _speed;
|
---|
| 414 | t_pppThread::msleep(sleepTime*1.e3);
|
---|
[5883] | 415 | }
|
---|
| 416 |
|
---|
| 417 | // Get Corrections
|
---|
| 418 | // ---------------
|
---|
| 419 | if (_corrFile) {
|
---|
| 420 | _corrFile->syncRead(epo->tt);
|
---|
| 421 | }
|
---|
| 422 |
|
---|
| 423 | // Get Ephemerides
|
---|
| 424 | // ----------------
|
---|
| 425 | t_eph* eph = 0;
|
---|
| 426 | const QMap<QString, int>* corrIODs = _corrFile ? &_corrFile->corrIODs() : 0;
|
---|
| 427 | while ( (eph = _rnxNavFile->getNextEph(epo->tt, corrIODs)) != 0 ) {
|
---|
[5889] | 428 | _pppClient->putEphemeris(eph);
|
---|
| 429 | delete eph; eph = 0;
|
---|
[5883] | 430 | }
|
---|
| 431 |
|
---|
[5890] | 432 | // Create list of observations and start epoch processing
|
---|
| 433 | // ------------------------------------------------------
|
---|
| 434 | QList<t_obs> obsList;
|
---|
[5883] | 435 | for (unsigned iObs = 0; iObs < epo->rnxSat.size(); iObs++) {
|
---|
| 436 | const t_rnxObsFile::t_rnxSat& rnxSat = epo->rnxSat[iObs];
|
---|
| 437 |
|
---|
| 438 | t_obs obs;
|
---|
| 439 | t_rnxObsFile::setObsFromRnx(_rnxObsFile, epo, rnxSat, obs);
|
---|
[5890] | 440 | obsList << obs;
|
---|
| 441 | }
|
---|
| 442 | slotNewObs(QByteArray(_opt->_roverName.c_str()), obsList);
|
---|
[5883] | 443 |
|
---|
[5890] | 444 |
|
---|
[5883] | 445 | if (nEpo % 10 == 0) {
|
---|
[5940] | 446 | emit progressRnxPPP(nEpo);
|
---|
[5883] | 447 | }
|
---|
[5950] | 448 |
|
---|
| 449 | QCoreApplication::processEvents();
|
---|
[5883] | 450 | }
|
---|
| 451 |
|
---|
[5940] | 452 | emit finishedRnxPPP();
|
---|
[5927] | 453 |
|
---|
[5883] | 454 | if (BNC_CORE->mode() != t_bncCore::interactive) {
|
---|
| 455 | qApp->exit(0);
|
---|
| 456 | }
|
---|
[5944] | 457 | else {
|
---|
| 458 | BNC_CORE->stopPPP();
|
---|
| 459 | }
|
---|
[5883] | 460 | }
|
---|
| 461 |
|
---|
| 462 | //
|
---|
| 463 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 464 | void t_pppRun::slotSetSpeed(int speed) {
|
---|
| 465 | QMutexLocker locker(&_mutex);
|
---|
| 466 | _speed = speed;
|
---|
| 467 | }
|
---|
[5973] | 468 |
|
---|
| 469 | //
|
---|
| 470 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 471 | void t_pppRun::slotSetStopFlag() {
|
---|
| 472 | QMutexLocker locker(&_mutex);
|
---|
| 473 | _stopFlag = true;
|
---|
| 474 | }
|
---|