diff options
author | Abyss777 <abyss@fox5.ru> | 2017-08-15 16:04:41 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-08-15 16:04:41 +0500 |
commit | 4d7805f783f00914a289b2447521a2f467de87bc (patch) | |
tree | 819d1a56dbbdd9c3badb379337da16d9dd487a54 /src/org/traccar/events | |
parent | 9b9c715cf0d9604be71a35e5e6e5428a3a891ba9 (diff) | |
parent | 5606c72b19568ddf50e2fa35f35e05358bb671e4 (diff) | |
download | traccar-server-4d7805f783f00914a289b2447521a2f467de87bc.tar.gz traccar-server-4d7805f783f00914a289b2447521a2f467de87bc.tar.bz2 traccar-server-4d7805f783f00914a289b2447521a2f467de87bc.zip |
Merge remote-tracking branch 'upstream/master' into new_trips_detector
Diffstat (limited to 'src/org/traccar/events')
-rw-r--r-- | src/org/traccar/events/MotionEventHandler.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/org/traccar/events/MotionEventHandler.java b/src/org/traccar/events/MotionEventHandler.java index b20a11999..8c2d4c56c 100644 --- a/src/org/traccar/events/MotionEventHandler.java +++ b/src/org/traccar/events/MotionEventHandler.java @@ -78,13 +78,19 @@ public class MotionEventHandler extends BaseEventHandler { if (motionPosition != null) { long motionTime = motionPosition.getFixTime().getTime(); double distance = ReportUtils.calculateDistance(motionPosition, position, false); + Boolean ignition = null; + if (tripsConfig.getUseIgnition() + && position.getAttributes().containsKey(Position.KEY_IGNITION)) { + ignition = position.getBoolean(Position.KEY_IGNITION); + } if (newMotion) { if (motionTime + tripsConfig.getMinimalTripDuration() <= currentTime || distance >= tripsConfig.getMinimalTripDistance()) { result = newEvent(deviceState, newMotion); } } else { - if (motionTime + tripsConfig.getMinimalParkingDuration() <= currentTime) { + if (motionTime + tripsConfig.getMinimalParkingDuration() <= currentTime + || ignition != null && !ignition) { result = newEvent(deviceState, newMotion); } } |