Changeset 1934 in ntrip


Ignore:
Timestamp:
Nov 12, 2009, 8:15:03 AM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncfigure.cpp

    r1933 r1934  
    9696void bncFigure::slotNextAnimationFrame() {
    9797  QMutexLocker locker(&_mutex);
    98   if (++_counter == 10) {
    99     QMapIterator<QByteArray, sumAndMean*> it(_bytes);
    100     while (it.hasNext()) {
    101       it.next();
    102       it.value()->_mean = it.value()->_sum / _counter;
     98
     99  const static int MAXCOUNTER = 10;
     100
     101  ++_counter;
     102
     103  QMapIterator<QByteArray, sumAndMean*> it(_bytes);
     104  while (it.hasNext()) {
     105    it.next();
     106    it.value()->_mean = it.value()->_sum / _counter;
     107    if (_counter == MAXCOUNTER) {
    103108      it.value()->_sum  = 0.0;
    104109    }
     110  }
     111
     112  if (_counter == MAXCOUNTER) {
    105113    _counter = 0;
    106114  }
     115
    107116  update();
    108117  QTimer::singleShot(1000, this, SLOT(slotNextAnimationFrame()));
Note: See TracChangeset for help on using the changeset viewer.