Changeset 2007 in ntrip


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

* empty log message *

Location:
trunk/BNC
Files:
2 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,
  • trunk/BNC/bncfigurelate.cpp

    r2006 r2007  
    127127  }
    128128
     129  double maxLateRounded;
    129130  QString maxLateStr;
    130131  if(maxLate < 1e3) {
    131     maxLateStr = QString("%1 ms  ").arg(int(maxLate/200)*200);
     132    maxLateRounded = int(maxLate/200)*200 + 300;
     133    maxLateStr = QString("%1 ms  ").arg(int(maxLateRounded/200)*200);
    132134    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 ms  "));
    133135  }
    134136  else if (maxLate < 6e4) {
    135     maxLateStr = QString("%1 sec  ").arg(int(maxLate / 1.e3));
     137    maxLateRounded = int(maxLate/1.e3)*1.e3 + 1500;
     138    maxLateStr = QString("%1 sec  ").arg(int(maxLateRounded/1.e3));
    136139    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 sec  "));
    137140  }
    138141  else {
    139     maxLateStr = QString("%1 min  ").arg(int(maxLate / 6.e4));
     142    maxLateRounded = int(maxLate / 6.e4)*6.e4 + 90000;
     143    maxLateStr = QString("%1 min  ").arg(int(maxLateRounded/6.e4));
    140144    painter.drawText(0, int((yMax-yMin)*xLine)-5, xMin+60,15,Qt::AlignRight,tr("0 min  "));
    141145  }
    142146
    143147  if(maxLate > 0.0) {
    144     painter.drawText(0, yMin+25-5, xMin+60,15,Qt::AlignRight,maxLateStr);
     148    painter.drawText(0, yMin+20-5, xMin+60,15,Qt::AlignRight,maxLateStr);
    145149  }
    146150
     
    158162
    159163    if(maxLate > 0.0) {
    160       int yy = int(yLength * (it.value() / maxLate));
     164      int yy = int(yLength * (it.value() / maxLateRounded));
    161165      QColor color = QColor::fromHsv(180,200,120+_ran[2][anchor]);
    162166      painter.fillRect(xx-13, int((yMax-yMin)*xLine)-yy, 9, yy,
Note: See TracChangeset for help on using the changeset viewer.