aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-16 16:13:26 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-16 16:13:26 +0500
commit5d3eb5136b96c8667021ef4d9452b4008ff40e42 (patch)
treed9c89af6d48c9913738569648dd3c9ae65875f4b
parent3224a87a5a533737cfe5edf3b67c2f3e84fe8496 (diff)
downloadtrackermap-server-5d3eb5136b96c8667021ef4d9452b4008ff40e42.tar.gz
trackermap-server-5d3eb5136b96c8667021ef4d9452b4008ff40e42.tar.bz2
trackermap-server-5d3eb5136b96c8667021ef4d9452b4008ff40e42.zip
Revert check for gap
-rw-r--r--src/org/traccar/reports/ReportUtils.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index db2d59a5d..6a5370d15 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -250,18 +250,13 @@ public final class ReportUtils {
private static boolean isMoving(ArrayList<Position> positions, int index,
TripsConfig tripsConfig, double speedThreshold) {
if (tripsConfig.getMinimalNoDataDuration() > 0) {
- long positionsDfference = 0;
- if (index < positions.size() - 1) {
- positionsDfference = positions.get(index + 1).getFixTime().getTime()
- - positions.get(index).getFixTime().getTime();
- }
- if (positionsDfference >= tripsConfig.getMinimalNoDataDuration()) {
- return false;
- } else if (index > 0) {
- positionsDfference = positions.get(index).getFixTime().getTime()
- - positions.get(index - 1).getFixTime().getTime();
- }
- if (positionsDfference >= tripsConfig.getMinimalNoDataDuration()) {
+ boolean beforeGap = index < positions.size() - 1
+ && positions.get(index + 1).getFixTime().getTime() - positions.get(index).getFixTime().getTime()
+ >= tripsConfig.getMinimalNoDataDuration();
+ boolean afterGap = index > 0
+ && positions.get(index).getFixTime().getTime() - positions.get(index - 1).getFixTime().getTime()
+ >= tripsConfig.getMinimalNoDataDuration();
+ if (beforeGap || afterGap) {
return false;
}
}