Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
use total seconds instead of seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyan99 committed Mar 21, 2016
1 parent 3b9d622 commit a0fcfa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ async void Geolocator_PositionChanged(object sender, PositionEventArgs e)

//calculate gas usage
var timeDif1 = point.RecordedTimeStamp - previous.RecordedTimeStamp;
CurrentTrip.FuelUsed += fuelConsumptionRate*0.00002236413*timeDif1.Seconds;
CurrentTrip.FuelUsed += fuelConsumptionRate*0.00002236413*timeDif1.TotalSeconds;
if(CurrentTrip.FuelUsed == 0)
FuelConsumption = "N/A";
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void UpdateTripInformationForPoint()
for (int i = 1; i < previousPoints.Length; i++)
{
var timeDif1 = previousPoints[i].RecordedTimeStamp - previousPoints[i - 1].RecordedTimeStamp;
fuelUsedLiters += previousPoints[i].MassFlowRate*0.00002236413*timeDif1.Seconds;
fuelUsedLiters += previousPoints[i].MassFlowRate*0.00002236413*timeDif1.TotalSeconds;
}
if (fuelUsedLiters == 0)
FuelConsumption = "N/A";
Expand Down

0 comments on commit a0fcfa5

Please sign in to comment.