aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2017-02-25 21:04:33 -0500
committerjon-stumpf <jon.stumpf@gmail.com>2017-03-04 16:04:01 -0500
commit9d6871fecda9458a8fbf4b9f2a8b2859ae0f2ecf (patch)
treee8c059e5cb07749ee7693a9d303139c2069adbe7 /src/org/traccar/reports
parente849902d7a5aa564bd930465f04f6d4b8498ddf2 (diff)
downloadtrackermap-server-9d6871fecda9458a8fbf4b9f2a8b2859ae0f2ecf.tar.gz
trackermap-server-9d6871fecda9458a8fbf4b9f2a8b2859ae0f2ecf.tar.bz2
trackermap-server-9d6871fecda9458a8fbf4b9f2a8b2859ae0f2ecf.zip
Renamed Position.KEY_FUEL to Position.KEY_FUEL_LEVEL;
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/ReportUtils.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index 032925a4a..9541e1027 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -78,15 +78,17 @@ public final class ReportUtils {
public static String calculateFuel(Position firstPosition, Position lastPosition) {
- if (firstPosition.getAttributes().get(Position.KEY_FUEL) != null
- && lastPosition.getAttributes().get(Position.KEY_FUEL) != null) {
+ if (firstPosition.getAttributes().get(Position.KEY_FUEL_LEVEL) != null
+ && lastPosition.getAttributes().get(Position.KEY_FUEL_LEVEL) != null) {
try {
switch (firstPosition.getProtocol()) {
case "meitrack":
case "galileo":
case "noran":
- BigDecimal v = new BigDecimal(firstPosition.getAttributes().get(Position.KEY_FUEL).toString());
- v = v.subtract(new BigDecimal(lastPosition.getAttributes().get(Position.KEY_FUEL).toString()));
+ BigDecimal v = new BigDecimal(firstPosition.getAttributes()
+ .get(Position.KEY_FUEL_LEVEL).toString());
+ v = v.subtract(new BigDecimal(lastPosition.getAttributes()
+ .get(Position.KEY_FUEL_LEVEL).toString()));
return v.setScale(2, RoundingMode.HALF_EVEN).toString() + " %";
default:
break;