aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-16 23:14:36 +1200
committerGitHub <noreply@github.com>2017-08-16 23:14:36 +1200
commite8739edc4e2b3a945c2b0eeec6286f7ef59037cf (patch)
tree4f804a49c612c38f73fab724e1ce982261238e78 /src/org/traccar/events
parent7820541530ea9891c001cbd8c53cc6340380a077 (diff)
parent5d3eb5136b96c8667021ef4d9452b4008ff40e42 (diff)
downloadtrackermap-server-e8739edc4e2b3a945c2b0eeec6286f7ef59037cf.tar.gz
trackermap-server-e8739edc4e2b3a945c2b0eeec6286f7ef59037cf.tar.bz2
trackermap-server-e8739edc4e2b3a945c2b0eeec6286f7ef59037cf.zip
Merge pull request #3447 from Abyss777/new_trips_detector
Reimplement trips detector using MotionEventHandler
Diffstat (limited to 'src/org/traccar/events')
-rw-r--r--src/org/traccar/events/MotionEventHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java
index 8c2d4c56c..b96898fc1 100644
--- a/src/org/traccar/events/MotionEventHandler.java
+++ b/src/org/traccar/events/MotionEventHandler.java
@@ -61,11 +61,14 @@ public class MotionEventHandler extends BaseEventHandler {
}
public Event updateMotionState(DeviceState deviceState, Position position) {
+ return updateMotionState(deviceState, position, position.getBoolean(Position.KEY_MOTION));
+ }
+
+ public Event updateMotionState(DeviceState deviceState, Position position, boolean newMotion) {
Event result = null;
Boolean oldMotion = deviceState.getMotionState();
long currentTime = position.getFixTime().getTime();
- boolean newMotion = position.getBoolean(Position.KEY_MOTION);
if (newMotion != oldMotion) {
if (deviceState.getMotionPosition() == null) {
deviceState.setMotionPosition(position);