Added avg speed over time

This commit is contained in:
CommanderRedYT
2022-01-11 11:16:15 +01:00
parent 40918ec32a
commit d8c97d7f20
3 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,11 @@ float getAvgWhPerKm()
return drivingStatistics.wh_used / (drivingStatistics.meters_driven / 1000.f);
}
float getAvgKmh()
{
return (drivingStatistics.meters_driven / 1000.) / (drivingStatistics.currentDrivingTime.count() / 1000 / 60 / 60); // (meter / 1000) / (ms / 1000 / 60 / 60)
}
std::string getEfficiencyClassString()
{
const float avgWhPerKm = getAvgWhPerKm();