Implemented remaining estimate km left

This commit is contained in:
CommanderRedYT
2022-01-17 10:10:08 +01:00
parent d8c97d7f20
commit bc340a3319
3 changed files with 19 additions and 0 deletions

View File

@@ -24,6 +24,11 @@ float getAvgKmh()
return (drivingStatistics.meters_driven / 1000.) / (drivingStatistics.currentDrivingTime.count() / 1000 / 60 / 60); // (meter / 1000) / (ms / 1000 / 60 / 60)
}
float getEstimatedKmLeft()
{
return (getRemainingWattHours() / getAvgWhPerKm());
}
std::string getEfficiencyClassString()
{
const float avgWhPerKm = getAvgWhPerKm();
@@ -54,6 +59,12 @@ uint16_t getEfficiencyClassColor()
else return 0xF800;
}
std::string getRemainingEstimateRangeString()
{
return fmt::format("{:.1f} km", getEstimatedKmLeft());
}
void initStatistics()
{