aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-06-16 09:30:32 +0500
committerAbyss777 <abyss@fox5.ru>2017-06-16 09:30:32 +0500
commitb5e180da135c48afc3d89665000b6de0e6a330e3 (patch)
tree1f9c604ac9898eb0c88a79c34b25f604037db55a /src/org/traccar/reports
parentbf57beec25228d58df8604e23d8709f6d196f3c5 (diff)
downloadtraccar-server-b5e180da135c48afc3d89665000b6de0e6a330e3.tar.gz
traccar-server-b5e180da135c48afc3d89665000b6de0e6a330e3.tar.bz2
traccar-server-b5e180da135c48afc3d89665000b6de0e6a330e3.zip
Centralized motion detection
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/ReportUtils.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/reports/ReportUtils.java b/src/org/traccar/reports/ReportUtils.java
index 1e004beae..cd30a61c4 100644
--- a/src/org/traccar/reports/ReportUtils.java
+++ b/src/org/traccar/reports/ReportUtils.java
@@ -220,7 +220,12 @@ public final class ReportUtils {
>= tripsConfig.getMinimalNoDataDuration()) {
return false;
}
- return positions.get(index).getSpeed() > speedThreshold;
+ if (positions.get(index).getAttributes().containsKey(Position.KEY_MOTION)
+ && positions.get(index).getAttributes().get(Position.KEY_MOTION) instanceof Boolean) {
+ return positions.get(index).getBoolean(Position.KEY_MOTION);
+ } else {
+ return positions.get(index).getSpeed() > speedThreshold;
+ }
}
public static Collection<BaseReport> detectTripsAndStops(TripsConfig tripsConfig, boolean ignoreOdometer,