aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-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;