14 #define DESIRED_SAMPLES 800 30 timer =
new QTimer(
this);
50 int sampleCount = samples.size();
55 for(
int i = 0; i < sampleCount; ++i) {
57 int y =
YMARGIN + h - (int)(h * samples.at(i) /
fMax);
66 QPainter painter(
this);
67 painter.fillRect(rect(), Qt::black);
69 if(
fMax <= 0.0
f)
return;
71 QColor axisCol(Qt::gray);
73 painter.setPen(axisCol);
77 int base = floor(log10(
fMax));
78 float val = pow(10.0
f, base);
80 const QString
units = tr(
"KB/s");
81 const float yMarginText = 2.0;
84 painter.setPen(axisCol);
85 painter.drawText(
XMARGIN,
YMARGIN + h - h * val /
fMax-yMarginText, QString(
"%1 %2").arg(val).arg(units));
86 for(
float y = val; y <
fMax; y += val) {
91 if(fMax / val <= 3.0
f) {
92 axisCol = axisCol.darker();
93 val = pow(10.0
f, base - 1);
94 painter.setPen(axisCol);
95 painter.drawText(
XMARGIN,
YMARGIN + h - h * val / fMax-yMarginText, QString(
"%1 %2").arg(val).arg(units));
97 for(
float y = val; y <
fMax; y += val, count++) {
109 painter.fillPath(p, QColor(0, 255, 0, 128));
110 painter.setPen(Qt::green);
116 painter.fillPath(p, QColor(255, 0, 0, 128));
117 painter.setPen(Qt::red);
144 if(
f > tmax) tmax =
f;
147 if(
f > tmax) tmax =
f;
158 timer->setInterval(msecsPerSample);
quint64 getTotalBytesRecv() const
Model for Fabcoin network client.
quint64 getTotalBytesSent() const
vector< pair< u256, string > > const & units()
Get information concerning the currency denominations.