Changeset 462 in ntrip


Ignore:
Timestamp:
May 26, 2007, 11:15:35 AM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnccaster.cpp

    r458 r462  
    9393    _waitTime = 1;
    9494  }
    95 
    96   // Start dump epoch loop
    97   // ---------------------
    98   _newObsRunning = false;
    99   _newTime = 0;
    100   dumpEpochSlot();
    10195}
    10296
     
    124118
    125119  QMutexLocker locker(&_mutex);
    126   _newObsRunning = true;
    127120
    128121  long iSec    = long(floor(obs->GPSWeeks+0.5));
    129   _newTime = obs->GPSWeek * 7*24*3600 + iSec;
     122  long newTime = obs->GPSWeek * 7*24*3600 + iSec;
    130123
    131124  // Rename the Station
     
    137130  // --------------------------------------------
    138131  if (_lastDumpSec == 0) {
    139     _lastDumpSec = _newTime - 1;
     132    _lastDumpSec = newTime - 1;
    140133  }
    141134
    142135  // An old observation - throw it away
    143136  // ----------------------------------
    144   if (_newTime <= _lastDumpSec) {
     137  if (newTime <= _lastDumpSec) {
    145138    if (firstObs) {
    146139      QSettings settings;
     
    157150  // Save the observation
    158151  // --------------------
    159   _epochs->insert(_newTime, obs);
    160 
    161   _newObsRunning = false;
    162 }
    163 
    164 // Dump Loop Event
    165 ////////////////////////////////////////////////////////////////////////////
    166 void bncCaster::dumpEpochSlot() {
    167   if (!_newObsRunning) {
    168     if (_newTime != 0 && _epochs->size() > 0) {
    169       dumpEpochs(_lastDumpSec + 1, _newTime - _waitTime);
    170    
    171       if (_lastDumpSec < _newTime - _waitTime) {
    172         _lastDumpSec = _newTime - _waitTime;
    173       }
    174     }
    175   }
    176   QTimer::singleShot(100, this, SLOT(dumpEpochSlot()));
     152  _epochs->insert(newTime, obs);
     153
     154  // Dump Epochs
     155  // -----------
     156  if (newTime - _waitTime > _lastDumpSec) {
     157    dumpEpochs(_lastDumpSec + 1, newTime - _waitTime);
     158    _lastDumpSec = newTime - _waitTime;
     159  }
    177160}
    178161
  • trunk/BNC/bnccaster.h

    r458 r462  
    5252   void slotNewConnection();
    5353   void slotGetThreadError(const QByteArray staID);
    54    void dumpEpochSlot();
    5554
    5655 private:
     
    6968   long                           _waitTime;
    7069   QMutex                         _mutex;
    71    long                           _newTime;
    72    bool                           _newObsRunning;
    7370};
    7471
Note: See TracChangeset for help on using the changeset viewer.