Changeset View
Changeset View
Standalone View
Standalone View
src/qt/trafficgraphwidget.cpp
Show All 13 Lines | |||||
#include <cmath> | #include <cmath> | ||||
#define DESIRED_SAMPLES 800 | #define DESIRED_SAMPLES 800 | ||||
#define XMARGIN 10 | #define XMARGIN 10 | ||||
#define YMARGIN 10 | #define YMARGIN 10 | ||||
TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) | TrafficGraphWidget::TrafficGraphWidget(QWidget *parent) | ||||
: QWidget(parent), timer(0), fMax(0.0f), nMins(0), vSamplesIn(), | : QWidget(parent), timer(nullptr), fMax(0.0f), nMins(0), vSamplesIn(), | ||||
vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(0) { | vSamplesOut(), nLastBytesIn(0), nLastBytesOut(0), clientModel(nullptr) { | ||||
timer = new QTimer(this); | timer = new QTimer(this); | ||||
connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates); | connect(timer, &QTimer::timeout, this, &TrafficGraphWidget::updateRates); | ||||
} | } | ||||
void TrafficGraphWidget::setClientModel(ClientModel *model) { | void TrafficGraphWidget::setClientModel(ClientModel *model) { | ||||
clientModel = model; | clientModel = model; | ||||
if (model) { | if (model) { | ||||
nLastBytesIn = model->node().getTotalBytesRecv(); | nLastBytesIn = model->node().getTotalBytesRecv(); | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |