aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-15 16:04:41 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-15 16:04:41 +0500
commit4d7805f783f00914a289b2447521a2f467de87bc (patch)
tree819d1a56dbbdd9c3badb379337da16d9dd487a54 /src/org/traccar/events
parent9b9c715cf0d9604be71a35e5e6e5428a3a891ba9 (diff)
parent5606c72b19568ddf50e2fa35f35e05358bb671e4 (diff)
downloadtrackermap-server-4d7805f783f00914a289b2447521a2f467de87bc.tar.gz
trackermap-server-4d7805f783f00914a289b2447521a2f467de87bc.tar.bz2
trackermap-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.java8
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);
}
}