aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-22 21:09:37 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2020-12-22 21:09:37 -0800
commit2fc6343fc770bd09ba76e4511f0f94ac786d2c6a (patch)
treec85397d00c932853166e2b4b751806f58ec008c2 /src/main/java
parent5e0a1d14b9e626f9b4fc4ef619effbc764ad03e7 (diff)
downloadtraccar-server-2fc6343fc770bd09ba76e4511f0f94ac786d2c6a.tar.gz
traccar-server-2fc6343fc770bd09ba76e4511f0f94ac786d2c6a.tar.bz2
traccar-server-2fc6343fc770bd09ba76e4511f0f94ac786d2c6a.zip
Fix max speed
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/traccar/reports/Summary.java4
-rw-r--r--src/main/java/org/traccar/reports/model/BaseReport.java6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/reports/Summary.java b/src/main/java/org/traccar/reports/Summary.java
index 612761844..83fe9caf7 100644
--- a/src/main/java/org/traccar/reports/Summary.java
+++ b/src/main/java/org/traccar/reports/Summary.java
@@ -50,7 +50,9 @@ public final class Summary {
}
previousPosition = position;
speedSum += position.getSpeed();
- result.setMaxSpeed(position.getSpeed());
+ if (position.getSpeed() > result.getMaxSpeed()) {
+ result.setMaxSpeed(position.getSpeed());
+ }
}
boolean ignoreOdometer = Context.getDeviceManager()
.lookupAttributeBoolean(deviceId, "report.ignoreOdometer", false, false, true);
diff --git a/src/main/java/org/traccar/reports/model/BaseReport.java b/src/main/java/org/traccar/reports/model/BaseReport.java
index deb42bb8a..d0719576e 100644
--- a/src/main/java/org/traccar/reports/model/BaseReport.java
+++ b/src/main/java/org/traccar/reports/model/BaseReport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org)
* Copyright 2016 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -71,9 +71,7 @@ public class BaseReport {
}
public void setMaxSpeed(double maxSpeed) {
- if (maxSpeed > this.maxSpeed) {
- this.maxSpeed = maxSpeed;
- }
+ this.maxSpeed = maxSpeed;
}
private double spentFuel;