aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-16 18:44:32 +1200
committerGitHub <noreply@github.com>2017-06-16 18:44:32 +1200
commitfe4ea97dabc55c4585d8b32bd4dae32cd255add3 (patch)
tree682c24e519446f419de1f01ac5e3879f49934a93 /src/org/traccar/BasePipelineFactory.java
parent65bec416c56715cd4a24ef69f136e4f67be56851 (diff)
parentb1d5a5cfd165d2b52cf4dcdc57a6825e0ff1db8f (diff)
downloadtrackermap-server-fe4ea97dabc55c4585d8b32bd4dae32cd255add3.tar.gz
trackermap-server-fe4ea97dabc55c4585d8b32bd4dae32cd255add3.tar.bz2
trackermap-server-fe4ea97dabc55c4585d8b32bd4dae32cd255add3.zip
Merge pull request #3256 from Abyss777/motion_detection
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);
}