diff options
author | Abyss777 <abyss@fox5.ru> | 2017-06-16 09:30:32 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-06-16 09:30:32 +0500 |
commit | b5e180da135c48afc3d89665000b6de0e6a330e3 (patch) | |
tree | 1f9c604ac9898eb0c88a79c34b25f604037db55a /src/org/traccar/reports | |
parent | bf57beec25228d58df8604e23d8709f6d196f3c5 (diff) | |
download | traccar-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.java | 7 |
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, |