Changeset 382 in ntrip
- Timestamp:
- Jan 26, 2007, 4:25:57 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/BNC/bnccaster.cpp ¶
r369 r382 93 93 _waitTime = 1; 94 94 } 95 96 // Start dump epoch loop 97 // --------------------- 98 _newTime = 0; 99 dumpEpochSlot(); 95 100 } 96 101 … … 133 138 134 139 long iSec = long(floor(obs->GPSWeeks+0.5)); 135 longnewTime = obs->GPSWeek * 7*24*3600 + iSec;140 _newTime = obs->GPSWeek * 7*24*3600 + iSec; 136 141 137 142 // Rename the Station … … 150 155 rnx->deepCopy(obs); 151 156 } 152 rnx->dumpEpoch(newTime); 157 rnx->dumpEpoch(_newTime); 153 158 154 159 // First time, set the _lastDumpSec immediately 155 160 // -------------------------------------------- 156 161 if (_lastDumpSec == 0) { 157 _lastDumpSec = newTime - 1; 162 _lastDumpSec = _newTime - 1; 158 163 } 159 164 160 165 // An old observation - throw it away 161 166 // ---------------------------------- 162 if (newTime <= _lastDumpSec) { 167 if (_newTime <= _lastDumpSec) { 163 168 if (firstObs) { 164 169 QSettings settings; … … 175 180 // Save the observation 176 181 // -------------------- 177 _epochs->insert(newTime, obs); 178 179 // Dump older epochs 180 // ----------------- 181 dumpEpochs(_lastDumpSec + 1, newTime - _waitTime); 182 183 if (_lastDumpSec < newTime - _waitTime) { 184 _lastDumpSec = newTime - _waitTime; 185 } 182 _epochs->insert(_newTime, obs); 183 } 184 185 // Dump Loop Event 186 //////////////////////////////////////////////////////////////////////////// 187 void bncCaster::dumpEpochSlot() { 188 if (_newTime != 0 && _epochs->size() > 0) { 189 dumpEpochs(_lastDumpSec + 1, _newTime - _waitTime); 190 191 if (_lastDumpSec < _newTime - _waitTime) { 192 _lastDumpSec = _newTime - _waitTime; 193 } 194 } 195 QTimer::singleShot(100, this, SLOT(dumpEpochSlot())); 186 196 } 187 197 … … 282 292 sock->write(&begEpoch, 1); 283 293 } 284 sock->write(&begObs, 1); 285 sock->write((char*) obs, numBytes); 286 if (!it.hasNext()) { 287 sock->write(&endEpoch, 1); 288 } 294 //// sock->write(&begObs, 1); 295 //// sock->write((char*) obs, numBytes); 296 //// if (!it.hasNext()) { 297 //// sock->write(&endEpoch, 1); 298 //// } 289 299 } 290 300 } -
TabularUnified trunk/BNC/bnccaster.h ¶
r369 r382 57 57 void slotNewConnection(); 58 58 void slotGetThreadError(const QByteArray& staID); 59 void dumpEpochSlot(); 59 60 60 61 private: … … 74 75 long _waitTime; 75 76 QMutex _mutex; 77 long _newTime; 76 78 }; 77 79 -
TabularUnified trunk/BNC/test_bnc_qt.cpp ¶
r380 r382 31 31 if ( socket.bytesAvailable() ) { 32 32 int bytesRecv = socket.read(&flag, 1); 33 cout << flag << endl; 33 34 if (flag == begObs) { 34 35 if ( socket.bytesAvailable() >= sizeof(obs) ) {
Note:
See TracChangeset
for help on using the changeset viewer.