Changeset View
Changeset View
Standalone View
Standalone View
src/qt/trafficgraphwidget.cpp
Show First 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | void TrafficGraphWidget::updateRates() { | ||||
while (vSamplesIn.size() > DESIRED_SAMPLES) { | while (vSamplesIn.size() > DESIRED_SAMPLES) { | ||||
vSamplesIn.pop_back(); | vSamplesIn.pop_back(); | ||||
} | } | ||||
while (vSamplesOut.size() > DESIRED_SAMPLES) { | while (vSamplesOut.size() > DESIRED_SAMPLES) { | ||||
vSamplesOut.pop_back(); | vSamplesOut.pop_back(); | ||||
} | } | ||||
float tmax = 0.0f; | float tmax = 0.0f; | ||||
for (float f : vSamplesIn) { | for (const float f : vSamplesIn) { | ||||
if (f > tmax) tmax = f; | if (f > tmax) tmax = f; | ||||
} | } | ||||
for (float f : vSamplesOut) { | for (const float f : vSamplesOut) { | ||||
if (f > tmax) tmax = f; | if (f > tmax) tmax = f; | ||||
} | } | ||||
fMax = tmax; | fMax = tmax; | ||||
update(); | update(); | ||||
} | } | ||||
void TrafficGraphWidget::setGraphRangeMins(int mins) { | void TrafficGraphWidget::setGraphRangeMins(int mins) { | ||||
nMins = mins; | nMins = mins; | ||||
Show All 20 Lines |