Changeset 382 in ntrip


Ignore:
Timestamp:
Jan 26, 2007, 4:25:57 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r369 r382  
    9393    _waitTime = 1;
    9494  }
     95
     96  // Start dump epoch loop
     97  // ---------------------
     98  _newTime = 0;
     99  dumpEpochSlot();
    95100}
    96101
     
    133138
    134139  long iSec    = long(floor(obs->GPSWeeks+0.5));
    135   long newTime = obs->GPSWeek * 7*24*3600 + iSec;
     140  _newTime = obs->GPSWeek * 7*24*3600 + iSec;
    136141
    137142  // Rename the Station
     
    150155    rnx->deepCopy(obs);
    151156  }
    152   rnx->dumpEpoch(newTime);
     157  rnx->dumpEpoch(_newTime);
    153158
    154159  // First time, set the _lastDumpSec immediately
    155160  // --------------------------------------------
    156161  if (_lastDumpSec == 0) {
    157     _lastDumpSec = newTime - 1;
     162    _lastDumpSec = _newTime - 1;
    158163  }
    159164
    160165  // An old observation - throw it away
    161166  // ----------------------------------
    162   if (newTime <= _lastDumpSec) {
     167  if (_newTime <= _lastDumpSec) {
    163168    if (firstObs) {
    164169      QSettings settings;
     
    175180  // Save the observation
    176181  // --------------------
    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////////////////////////////////////////////////////////////////////////////
     187void 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()));
    186196}
    187197
     
    282292              sock->write(&begEpoch, 1);
    283293            }
    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////            }
    289299          }
    290300        }
  • trunk/BNC/bnccaster.h

    r369 r382  
    5757   void slotNewConnection();
    5858   void slotGetThreadError(const QByteArray& staID);
     59   void dumpEpochSlot();
    5960
    6061 private:
     
    7475   long                           _waitTime;
    7576   QMutex                         _mutex;
     77   long                           _newTime;
    7678};
    7779
  • trunk/BNC/test_bnc_qt.cpp

    r380 r382  
    3131    if ( socket.bytesAvailable() ) {
    3232      int bytesRecv = socket.read(&flag, 1);
     33      cout << flag << endl;
    3334      if (flag == begObs) {
    3435        if ( socket.bytesAvailable() >= sizeof(obs) ) {
Note: See TracChangeset for help on using the changeset viewer.