mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Honour units in Realtime Plots
This commit is contained in:
committed by
Mark Liversedge
parent
de71547607
commit
bfcedf6cae
@@ -204,12 +204,12 @@ DialWindow::telemetryUpdate(const RealtimeData &rtData)
|
||||
|
||||
case RealtimeData::Speed:
|
||||
case RealtimeData::VirtualSpeed:
|
||||
if (!mainWindow->useMetricUnits) displayValue *= MILES_PER_KM;
|
||||
if (!mainWindow->useMetricUnits) value *= MILES_PER_KM;
|
||||
valueLabel->setText(QString("%1").arg(value, 0, 'f', 1));
|
||||
break;
|
||||
|
||||
case RealtimeData::Distance:
|
||||
if (!mainWindow->useMetricUnits) displayValue *= MILES_PER_KM;
|
||||
if (!mainWindow->useMetricUnits) value *= MILES_PER_KM;
|
||||
valueLabel->setText(QString("%1").arg(value, 0, 'f', 3));
|
||||
break;
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ RealtimePlotWindow::telemetryUpdate(RealtimeData rtData)
|
||||
spdtot += spd; spdtot -= spdHist[spdindex]; spdHist[spdindex] = spd;
|
||||
spdindex++; if (spdindex >= rtPlot->smooth) spdindex = 0;
|
||||
spd = spdtot / rtPlot->smooth;
|
||||
if (!mainWindow->useMetricUnits) spd *= MILES_PER_KM;
|
||||
rtPlot->spdData->addData(spd);
|
||||
|
||||
// Power
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "RealtimeData.h" // for realtimedata structure
|
||||
|
||||
#include "Settings.h"
|
||||
#include "Units.h"
|
||||
#include "Colors.h"
|
||||
|
||||
class RealtimePlotWindow : public GcWindow
|
||||
|
||||
Reference in New Issue
Block a user