From 1ce8c1945e36acd56b7ceb87b900a0efa14e9ecd Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Sat, 20 Aug 2016 09:26:57 +0500 Subject: - Renamed calculateFuel - Used int in BigDecimal constructor - Added extra space --- src/org/traccar/reports/ReportUtils.java | 4 ++-- src/org/traccar/reports/Trips.java | 2 +- src/org/traccar/reports/model/BaseReport.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java index 03e23498a..baa799e90 100644 --- a/src/org/traccar/reports/ReportUtils.java +++ b/src/org/traccar/reports/ReportUtils.java @@ -49,7 +49,7 @@ public final class ReportUtils { && lastPosition.getAttributes().containsKey(Position.KEY_ODOMETER)) { distance = new BigDecimal(lastPosition.getAttributes().get(Position.KEY_ODOMETER).toString()) .subtract(new BigDecimal(firstPosition.getAttributes().get(Position.KEY_ODOMETER).toString())) - .multiply(new BigDecimal("1000")); + .multiply(new BigDecimal(1000)); } else if (firstPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE) && lastPosition.getAttributes().containsKey(Position.KEY_TOTAL_DISTANCE)) { distance = new BigDecimal(lastPosition.getAttributes().get(Position.KEY_TOTAL_DISTANCE).toString()) @@ -59,7 +59,7 @@ public final class ReportUtils { return distance.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); } - public static String calculateSpentFuel(Position firstPosition, Position lastPosition) { + public static String calculateFuel(Position firstPosition, Position lastPosition) { if (firstPosition.getAttributes().get(Position.KEY_FUEL) != null && lastPosition.getAttributes().get(Position.KEY_FUEL) != null) { diff --git a/src/org/traccar/reports/Trips.java b/src/org/traccar/reports/Trips.java index 068c47b8f..b661ffffa 100644 --- a/src/org/traccar/reports/Trips.java +++ b/src/org/traccar/reports/Trips.java @@ -65,7 +65,7 @@ public final class Trips { trip.setDuration(tripDuration); trip.setAverageSpeed(speedSum / (endIndex - startIndex)); trip.setMaxSpeed(speedMax); - trip.setSpentFuel(ReportUtils.calculateSpentFuel(startTrip, endTrip)); + trip.setSpentFuel(ReportUtils.calculateFuel(startTrip, endTrip)); return trip; } diff --git a/src/org/traccar/reports/model/BaseReport.java b/src/org/traccar/reports/model/BaseReport.java index bcbed29fe..8c5807c9b 100644 --- a/src/org/traccar/reports/model/BaseReport.java +++ b/src/org/traccar/reports/model/BaseReport.java @@ -57,7 +57,7 @@ public class BaseReport { this.averageSpeed = new BigDecimal(averageSpeed.toString()).setScale(3, RoundingMode.HALF_EVEN).doubleValue(); } - private double maxSpeed; //knots + private double maxSpeed; // knots public double getMaxSpeed() { return maxSpeed; } -- cgit v1.2.3