Changeset 1951 in ntrip for trunk


Ignore:
Timestamp:
Nov 13, 2009, 11:48:31 AM (15 years ago)
Author:
weber
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncfigure.cpp

    r1950 r1951  
    130130  int xMax = 640;
    131131  int yMin =   0;
    132   int yMax = 180;
     132  int yMax = 120;
     133  float xLine = .60;
     134
    133135
    134136  QPainter painter(this);
     
    136138  // y-axis
    137139  // ------
    138   int yLength = (yMax-40) - (yMin+10);
    139   painter.drawLine(xMin+50, yMax-40, xMin+50, yMin+10);
    140   painter.drawText(xMin+30, yMax-40, tr("0"));
     140  int yLength = int((yMax-yMin)*xLine) - (yMin+10);
     141  painter.drawLine(xMin+50, int((yMax-yMin)*xLine), xMin+50, yMin+10);
    141142
    142143  QString maxRateStr;
    143144  if      (8.0 * _maxRate < 1e3) {
    144     maxRateStr = QString("%1  bps").arg(int(8.0 * _maxRate));
     145    maxRateStr = QString("%1 bps").arg(int(8.0 * _maxRate));
     146    painter.drawText(xMin+0, int((yMax-yMin)*xLine), tr("0 bps"));
    145147  }
    146148  else if (8.0 * _maxRate < 1e6) {
    147149    maxRateStr = QString("%1 kbps").arg(int(8.0 * _maxRate / 1.e3));
     150    painter.drawText(xMin+0, int((yMax-yMin)*xLine), tr("0 kbps"));
    148151  }
    149152  else {
    150153    maxRateStr = QString("%1 Mbps").arg(int(8.0 * _maxRate / 1.e6));
     154    painter.drawText(xMin+0, int((yMax-yMin)*xLine), tr("0 Mbps"));
    151155  }
    152156
    153   painter.drawText(xMin+0, yMin+25, maxRateStr);
     157  if(_maxRate > 0.0) {
     158    painter.drawText(xMin+0, yMin+25, maxRateStr);
     159  }
    154160
    155161  // x-axis
    156162  // ------
    157   painter.drawLine(xMin+50, yMax-40, xMax-10, yMax-40);
    158 
    159   painter.drawText(xMin+10,yMax-10,
    160                    tr(QTime::currentTime().toString().toAscii()));
     163  painter.drawLine(xMin+50, int((yMax-yMin)*xLine), xMax*3, int((yMax-yMin)*xLine));
    161164
    162165  int anchor = 0;
    163 
    164166  QMapIterator<QByteArray, sumAndMean*> it(_bytes);
    165167  while (it.hasNext()) {
     
    167169    QByteArray staID = it.key();
    168170
    169     int xx = xMin+100+anchor*40;
     171    int xx = xMin+70+anchor*15;
     172    int yy = int(yLength * (it.value()->_mean / _maxRate));
    170173
    171     painter.drawText(xx, yMax-10, staID.left(5));
     174    painter.save();
     175    painter.translate(xx, yMax);
     176    painter.rotate(-90);
     177    painter.drawText(0, 0, staID.left(5));
     178    painter.restore();
    172179
    173180    if(_maxRate > 0.0) {
    174       int yy = int(yLength * (it.value()->_mean / _maxRate));
    175       painter.fillRect(xx, yMax-40-yy, 30, yy,
    176                        QBrush(Qt::blue,Qt::SolidPattern));
     181      painter.fillRect(xx-10, int((yMax-yMin)*xLine)-yy, 10, yy,
     182                       QBrush(Qt::gray,Qt::SolidPattern));
    177183    }
    178184
Note: See TracChangeset for help on using the changeset viewer.