aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events/MotionEventHandler.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-16 11:04:41 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-16 11:06:21 +0500
commit668d0c65609cc510ad9da3be4fc7aafaa3ca427d (patch)
treee3c3359bab09fdd42bb441ec5ffbedf0e0964329 /src/org/traccar/events/MotionEventHandler.java
parent4d7805f783f00914a289b2447521a2f467de87bc (diff)
downloadtrackermap-server-668d0c65609cc510ad9da3be4fc7aafaa3ca427d.tar.gz
trackermap-server-668d0c65609cc510ad9da3be4fc7aafaa3ca427d.tar.bz2
trackermap-server-668d0c65609cc510ad9da3be4fc7aafaa3ca427d.zip
Combine trips and stops detectors and some optimization
Diffstat (limited to 'src/org/traccar/events/MotionEventHandler.java')
-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);