diff options
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r-- | src/org/traccar/BasePipelineFactory.java | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 45213c1a1..0997e6f11 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -49,7 +49,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { private int timeout; private FilterHandler filterHandler; - private CoordinatesHandler coordinatesHandler; private DistanceHandler distanceHandler; private MotionHandler motionHandler; private GeocoderHandler geocoderHandler; @@ -126,14 +125,14 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { } } + distanceHandler = new DistanceHandler(Context.getConfig().getBoolean("coordinates.filter"), + Context.getConfig().getInteger("coordinates.minError"), + Context.getConfig().getInteger("coordinates.maxError")); + if (Context.getConfig().getBoolean("filter.enable")) { filterHandler = new FilterHandler(); } - if (Context.getConfig().getBoolean("coordinates.filter")) { - coordinatesHandler = new CoordinatesHandler(); - } - if (Context.getGeocoder() != null) { geocoderHandler = new GeocoderHandler( Context.getGeocoder(), @@ -146,8 +145,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { Context.getConfig().getBoolean("geolocation.processInvalidPositions")); } - distanceHandler = new DistanceHandler(); - motionHandler = new MotionHandler(Context.getConfig().getDouble("event.motion.speedThreshold", 0.01)); if (Context.getConfig().hasKey("location.latitudeHemisphere") @@ -196,6 +193,11 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { if (hemisphereHandler != null) { pipeline.addLast("hemisphere", hemisphereHandler); } + + if (distanceHandler != null) { + pipeline.addLast("distance", distanceHandler); + } + if (geocoderHandler != null) { pipeline.addLast("geocoder", geocoderHandler); } @@ -207,14 +209,6 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { pipeline.addLast("filter", filterHandler); } - if (coordinatesHandler != null) { - pipeline.addLast("coordinatesHandler", coordinatesHandler); - } - - if (distanceHandler != null) { - pipeline.addLast("distance", distanceHandler); - } - if (motionHandler != null) { pipeline.addLast("motion", motionHandler); } |