Index: /trunk/BNC/src/bnchelp.html
===================================================================
--- /trunk/BNC/src/bnchelp.html (revision 7942)
+++ /trunk/BNC/src/bnchelp.html (revision 7943)
@@ -3584,5 +3584,5 @@
-Specifying 'no' for option 'Wait for clock corr.' means that BNC processes each epoch of data immediately after its arrival using satellite clock corrections available at that time. A non-zero value means that epochs of data are buffered and the processing of each epoch is postponed until satellite clock corrections older than 'Wait for clock corr.' seconds are available. Specifying a value of half the update rate of the clock corrections (e.g. 5 sec) may be appropriate. Note that this causes an additional delay of the PPP solutions in the amount of half of the update rate.
+Specifying 'no' for option 'Wait for clock corr.' means that BNC processes each epoch of data immediately after its arrival using satellite clock corrections available at that time. A non-zero value means that epochs of data are buffered and the processing of each epoch is postponed until satellite clock corrections not older than 'Wait for clock corr.' seconds are available. Specifying a value of half the update rate of the clock corrections (e.g. 5 sec) may be appropriate. Note that this causes an additional delay of the PPP solutions in the amount of half of the update rate.
Index: /trunk/BNC/src/pppMain.cpp
===================================================================
--- /trunk/BNC/src/pppMain.cpp (revision 7942)
+++ /trunk/BNC/src/pppMain.cpp (revision 7943)
@@ -178,4 +178,7 @@
opt->_sigmaL1 = settings.value("PPP/sigmaL1").toDouble(); if (opt->_sigmaL1 <= 0.0) opt->_sigmaL1 = 0.01;
opt->_corrWaitTime = settings.value("PPP/corrWaitTime").toDouble();
+ if (!_realTime || opt->_corrMount.empty()) {
+ opt->_corrWaitTime = 0;
+ }
if (settings.value("PPP/lcGPS").toString() == "P1") {
Index: /trunk/BNC/src/pppRun.cpp
===================================================================
--- /trunk/BNC/src/pppRun.cpp (revision 7942)
+++ /trunk/BNC/src/pppRun.cpp (revision 7943)
@@ -301,64 +301,87 @@
}
+ // Make sure the buffer does not grow beyond any limit
+ // ---------------------------------------------------
+ const unsigned MAX_EPODATA_SIZE = 120;
+ if (_epoData.size() > MAX_EPODATA_SIZE) {
+ delete _epoData.front();
+ _epoData.pop_front();
+ }
+
// Process the oldest epochs
// ------------------------
- while (_epoData.size() && !waitForCorr(_epoData.front()->_time)) {
+ while (_epoData.size()) {
const vector& satObs = _epoData.front()->_satObs;
- t_output output;
- _pppClient->processEpoch(satObs, &output);
-
- if (!output._error) {
- QVector xx(6);
- xx.data()[0] = output._xyzRover[0];
- xx.data()[1] = output._xyzRover[1];
- xx.data()[2] = output._xyzRover[2];
- xx.data()[3] = output._neu[0];
- xx.data()[4] = output._neu[1];
- xx.data()[5] = output._neu[2];
- emit newPosition(staID, output._epoTime, xx);
- }
-
- delete _epoData.front(); _epoData.pop_front();
-
- ostringstream log;
- if (output._error) {
- log << output._log;
+ // No corrections yet, skip the epoch
+ // ----------------------------------
+ if (_opt->_corrWaitTime && !_lastClkCorrTime.valid()) {
+ return;
+ }
+
+ // Process the front epoch
+ // -----------------------
+ if (_opt->_corrWaitTime == 0 ||
+ _epoData.front()->_time - _lastClkCorrTime < _opt->_corrWaitTime) {
+
+ t_output output;
+ _pppClient->processEpoch(satObs, &output);
+
+ if (!output._error) {
+ QVector xx(6);
+ xx.data()[0] = output._xyzRover[0];
+ xx.data()[1] = output._xyzRover[1];
+ xx.data()[2] = output._xyzRover[2];
+ xx.data()[3] = output._neu[0];
+ xx.data()[4] = output._neu[1];
+ xx.data()[5] = output._neu[2];
+ emit newPosition(staID, output._epoTime, xx);
+ }
+
+ delete _epoData.front();
+ _epoData.pop_front();
+
+ ostringstream log;
+ if (output._error) {
+ log << output._log;
+ }
+ else {
+ log.setf(ios::fixed);
+ log << string(output._epoTime) << ' ' << staID.data()
+ << " X = " << setprecision(4) << output._xyzRover[0]
+ << " Y = " << setprecision(4) << output._xyzRover[1]
+ << " Z = " << setprecision(4) << output._xyzRover[2]
+ << " NEU: " << showpos << setw(8) << setprecision(4) << output._neu[0]
+ << " " << showpos << setw(8) << setprecision(4) << output._neu[1]
+ << " " << showpos << setw(8) << setprecision(4) << output._neu[2]
+ << " TRP: " << showpos << setw(8) << setprecision(4) << output._trp0
+ << " " << showpos << setw(8) << setprecision(4) << output._trp;
+ }
+
+ if (_logFile && output._epoTime.valid()) {
+ _logFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(),
+ QString(output._log.c_str()));
+ }
+
+ if (!output._error) {
+ QString rmcStr = nmeaString('R', output);
+ QString ggaStr = nmeaString('G', output);
+ if (_nmeaFile) {
+ _nmeaFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), rmcStr);
+ _nmeaFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), ggaStr);
+ }
+ emit newNMEAstr(staID, rmcStr.toAscii());
+ emit newNMEAstr(staID, ggaStr.toAscii());
+ if (_snxtroFile && output._epoTime.valid()) {
+ _snxtroFile->write(staID, int(output._epoTime.gpsw()), output._epoTime.gpssec(),
+ output._trp0 + output._trp, output._trpStdev);
+ }
+ }
+ emit newMessage(QByteArray(log.str().c_str()), true);
}
else {
- log.setf(ios::fixed);
- log << string(output._epoTime) << ' ' << staID.data()
- << " X = " << setprecision(4) << output._xyzRover[0]
- << " Y = " << setprecision(4) << output._xyzRover[1]
- << " Z = " << setprecision(4) << output._xyzRover[2]
- << " NEU: " << showpos << setw(8) << setprecision(4) << output._neu[0]
- << " " << showpos << setw(8) << setprecision(4) << output._neu[1]
- << " " << showpos << setw(8) << setprecision(4) << output._neu[2]
- << " TRP: " << showpos << setw(8) << setprecision(4) << output._trp0
- << " " << showpos << setw(8) << setprecision(4) << output._trp;
- }
-
- if (_logFile && output._epoTime.valid()) {
- _logFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(),
- QString(output._log.c_str()));
- }
-
- if (!output._error) {
- QString rmcStr = nmeaString('R', output);
- QString ggaStr = nmeaString('G', output);
- if (_nmeaFile) {
- _nmeaFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), rmcStr);
- _nmeaFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), ggaStr);
- }
- emit newNMEAstr(staID, rmcStr.toAscii());
- emit newNMEAstr(staID, ggaStr.toAscii());
- if (_snxtroFile && output._epoTime.valid()) {
- _snxtroFile->write(staID, int(output._epoTime.gpsw()), output._epoTime.gpssec(),
- output._trp0 + output._trp, output._trpStdev);
- }
- }
-
- emit newMessage(QByteArray(log.str().c_str()), true);
+ return;
+ }
}
}
@@ -655,24 +678,2 @@
return '$' + nmStr + QString("*%1\n").arg(int(XOR), 0, 16).toUpper();
}
-
-//
-////////////////////////////////////////////////////////////////////////////
-bool t_pppRun::waitForCorr(const bncTime& epoTime) const {
-
- if (!_opt->_realTime || _opt->_corrMount.empty()) {
- return false;
- }
- else if (!_lastClkCorrTime.valid()) {
- return true;
- }
- else {
- double dt = epoTime - _lastClkCorrTime;
- if (dt > 1.0 && dt < _opt->_corrWaitTime) {
- return true;
- }
- else {
- return false;
- }
- }
- return false;
-}
Index: /trunk/BNC/src/pppRun.h
===================================================================
--- /trunk/BNC/src/pppRun.h (revision 7942)
+++ /trunk/BNC/src/pppRun.h (revision 7943)
@@ -62,6 +62,4 @@
};
- bool waitForCorr(const bncTime& epoTime) const;
-
QMutex _mutex;
const t_pppOptions* _opt;
Index: /trunk/BNC/src/pppWidgets.cpp
===================================================================
--- /trunk/BNC/src/pppWidgets.cpp (revision 7942)
+++ /trunk/BNC/src/pppWidgets.cpp (revision 7943)
@@ -163,5 +163,4 @@
_corrWaitTime->setSingleStep(1);
_corrWaitTime->setSuffix(" sec");
- _corrWaitTime->setSpecialValueText("no");
_staTable->setColumnCount(10);
@@ -194,5 +193,5 @@
// WhatsThis, PPP (3)
// ------------------
- _corrWaitTime->setWhatsThis(tr("Specifying 'no' means that BNC will not wait for satellite clock corrections and process each epoch of observation data immediately after arrival using the corrections available at that time.
Specifying a non-zero value (i.e. 5 sec) means that data will be buffered and their processing is postponed till corrections not older than '5 sec' (example) become available.
"));
+ _corrWaitTime->setWhatsThis(tr("Zero value means that BNC processes each epoch of data immediately after its arrival using satellite clock corrections available at that time.
Specifying a non-zero value (i.e. 5 sec) means that the epochs of data are buffered and the processing of each epoch is postponed till the satellite clock corrections not older than '5 sec' (example) become available.
"));
_seedingTime->setWhatsThis(tr("
Enter the length of a startup period in seconds for which you want to fix the PPP solutions to known a priori coordinates as introduced through option 'Coordinates file'. Adjust 'Sigma N/E/H' in the PPP Stations table according to the coordinate's precision. Fixing a priori coordinates is done in BNC through setting 'Sigma N/E/H' temporarily to zero.
This option allows the PPP solution to rapidly converge. It requires that the antenna remains unmoved on the a priori known position throughout the startup period.
A value of 60 is likely to be an appropriate choice.
Default is an empty option field, meaning that you don't want BNC to fix PPP solutions during startup to an a priori coordinate.
"));