- Timestamp:
- Feb 19, 2010, 3:43:42 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnc.pro
r2309 r2310 2 2 # Switch to debug configuration 3 3 # ----------------------------- 4 CONFIG -= release5 CONFIG += debug4 CONFIG -= debug 5 CONFIG += release 6 6 7 7 -
trunk/BNC/bnccaster.cpp
r2186 r2310 49 49 #include "RTCM/GPSDecoder.h" 50 50 51 static const int MAXRATE = 20; // Hz 52 51 53 // Constructor 52 54 //////////////////////////////////////////////////////////////////////////// … … 121 123 _epochs = new QMultiMap<long, p_obs>; 122 124 123 _lastDumpSec 125 _lastDumpSecXrate = 0; 124 126 125 127 _confInterval = -1; … … 159 161 obs->_status = t_obs::received; 160 162 161 long iSec = long(floor(obs->_o.GPSWeeks+0.5));162 long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec;163 long iSecXrate = long(floor(obs->_o.GPSWeeks * MAXRATE + 0.5)); 164 long newTimeXrate = obs->_o.GPSWeek * 7*24*3600 * MAXRATE + iSecXrate; 163 165 164 166 // Rename the Station … … 199 201 // First time, set the _lastDumpSec immediately 200 202 // -------------------------------------------- 201 if (_lastDumpSec == 0) {202 _lastDumpSec = newTime - 1;203 if (_lastDumpSecXrate == 0) { 204 _lastDumpSecXrate = newTimeXrate - 1; 203 205 } 204 206 205 207 // An old observation - throw it away 206 208 // ---------------------------------- 207 if (newTime <= _lastDumpSec) {209 if (newTimeXrate <= _lastDumpSecXrate) { 208 210 if (firstObs) { 209 211 bncSettings settings; … … 211 213 !settings.value("outPort").toString().isEmpty() ) { 212 214 213 QTime enomtime = QTime(0,0,0).add Secs(iSec);215 QTime enomtime = QTime(0,0,0).addMSecs(iSecXrate/MAXRATE/1000); 214 216 215 217 emit( newMessage(QString("%1: Old epoch %2 (%3) thrown away") 216 .arg(staID.data()).arg(iSec )218 .arg(staID.data()).arg(iSecXrate/MAXRATE) 217 219 .arg(enomtime.toString("HH:mm:ss")) 218 220 .toAscii(), true) ); … … 225 227 // Save the observation 226 228 // -------------------- 227 _epochs->insert(newTime , obs);229 _epochs->insert(newTimeXrate, obs); 228 230 229 231 // Dump Epochs 230 232 // ----------- 231 if (newTime - _waitTime > _lastDumpSec) {232 dumpEpochs(_lastDumpSec + 1, newTime - _waitTime);233 _lastDumpSec = newTime - _waitTime;233 if (newTimeXrate - _waitTimeXrate > _lastDumpSecXrate) { 234 dumpEpochs(_lastDumpSecXrate + 1, newTimeXrate - _waitTimeXrate); 235 _lastDumpSecXrate = newTimeXrate - _waitTimeXrate; 234 236 } 235 237 } … … 415 417 // Reread several options 416 418 // ---------------------- 417 _samplingRate = settings.value("binSampl").toInt();418 _waitTime = settings.value("waitTime").toInt();419 if (_waitTime < 1) {420 _waitTime = 1;419 _samplingRate = settings.value("binSampl").toInt(); 420 _waitTimeXrate = settings.value("waitTime").toInt() * MAXRATE; 421 if (_waitTimeXrate < 1) { 422 _waitTimeXrate = 1; 421 423 } 422 424 -
trunk/BNC/bnccaster.h
r2184 r2310 67 67 QTextStream* _out; 68 68 QMultiMap<long, p_obs>* _epochs; 69 long _lastDumpSec ;69 long _lastDumpSecXrate; 70 70 QTcpServer* _server; 71 71 QTcpServer* _uServer; … … 77 77 QList<bncGetThread*> _threads; 78 78 int _samplingRate; 79 long _waitTime ;79 long _waitTimeXrate; 80 80 QMutex _mutex; 81 81 int _confInterval;
Note:
See TracChangeset
for help on using the changeset viewer.