Changeset 2007 in ntrip for trunk/BNC/bncfigure.cpp


Ignore:
Timestamp:
Nov 22, 2009, 8:36:54 PM (14 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncfigure.cpp

    r1994 r2007  
    9494  QMap<QByteArray, sumAndMean*>::const_iterator it = _bytes.find(staID);
    9595  if (it != _bytes.end()) {
    96     it.value()->_sum += nbyte;
     96    it.value()->_sum += nbyte*8.;
    9797  }
    9898}
     
    149149  painter.drawLine(xMin+60, int((yMax-yMin)*xLine), xMin+60, yMin+10);
    150150
     151  double maxRateRounded;
    151152  QString maxRateStr;
    152   if      (8.0 * _maxRate < 1e3) {
    153     maxRateStr = QString("%1 bps  ").arg(int(8.0 * _maxRate));
     153  if (_maxRate < 1e3) {
     154    maxRateRounded = int(_maxRate/200)*200 + 300;
     155    maxRateStr = QString("%1 bps  ").arg(int(maxRateRounded/200)*200);
    154156    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 bps  "));
    155157  }
    156   else if (8.0 * _maxRate < 1e6) {
    157     maxRateStr = QString("%1 kbps  ").arg(int(8.0 * _maxRate / 1.e3));
     158  else if (_maxRate < 1e6) {
     159    maxRateRounded = int(_maxRate/1.e3)*1.e3 + 1500;
     160    maxRateStr = QString("%1 kbps  ").arg(int(maxRateRounded/1.e3));
    158161    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 kbps  "));
    159162  }
    160163  else {
    161     maxRateStr = QString("%1 Mbps  ").arg(int(8.0 * _maxRate / 1.e6));
     164    maxRateRounded = int(_maxRate/1.e6)*1.e6 + 1500000;
     165    maxRateStr = QString("%1 Mbps  ").arg(int(maxRateRounded/1.e6));
    162166    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 Mbps  "));
    163167  }
    164168
    165169  if(_maxRate > 0.0) {
    166     painter.drawText(0, yMin+25-5, xMin+60,15,Qt::AlignRight,maxRateStr);
     170    painter.drawText(0, yMin+20-5, xMin+60,15,Qt::AlignRight,maxRateStr);
    167171  }
    168172
     
    180184
    181185    if(_maxRate > 0.0) {
    182       int yy = int(yLength * (it.value()->_mean / _maxRate));
     186      int yy = int(yLength * (it.value()->_mean / maxRateRounded));
    183187      QColor color = QColor::fromRgb(_ran[0][anchor],_ran[1][anchor],_ran[2][anchor],150);
    184188      painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
Note: See TracChangeset for help on using the changeset viewer.