aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-06-16 09:30:32 +0500
committerAbyss777 <abyss@fox5.ru>2017-06-16 09:30:32 +0500
commitb5e180da135c48afc3d89665000b6de0e6a330e3 (patch)
tree1f9c604ac9898eb0c88a79c34b25f604037db55a /src/org/traccar/BasePipelineFactory.java
parentbf57beec25228d58df8604e23d8709f6d196f3c5 (diff)
downloadtrackermap-server-b5e180da135c48afc3d89665000b6de0e6a330e3.tar.gz
trackermap-server-b5e180da135c48afc3d89665000b6de0e6a330e3.tar.bz2
trackermap-server-b5e180da135c48afc3d89665000b6de0e6a330e3.zip
Centralized motion detection
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 11457905d..45213c1a1 100644
--- a/src/org/traccar/BasePipelineFactory.java
+++ b/src/org/traccar/BasePipelineFactory.java
@@ -51,6 +51,7 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
private FilterHandler filterHandler;
private CoordinatesHandler coordinatesHandler;
private DistanceHandler distanceHandler;
+ private MotionHandler motionHandler;
private GeocoderHandler geocoderHandler;
private GeolocationHandler geolocationHandler;
private HemisphereHandler hemisphereHandler;
@@ -147,6 +148,8 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
distanceHandler = new DistanceHandler();
+ motionHandler = new MotionHandler(Context.getConfig().getDouble("event.motion.speedThreshold", 0.01));
+
if (Context.getConfig().hasKey("location.latitudeHemisphere")
|| Context.getConfig().hasKey("location.longitudeHemisphere")) {
hemisphereHandler = new HemisphereHandler();
@@ -212,6 +215,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("distance", distanceHandler);
}
+ if (motionHandler != null) {
+ pipeline.addLast("motion", motionHandler);
+ }
+
if (copyAttributesHandler != null) {
pipeline.addLast("copyAttributes", copyAttributesHandler);
}