aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BasePipelineFactory.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-05-31 18:48:39 +1200
committerGitHub <noreply@github.com>2018-05-31 18:48:39 +1200
commit2a34f67542221e27e64ee48928fe8fd7d59f7714 (patch)
tree89c06091207e99ae73ff62ecff377847b7960ade /src/org/traccar/BasePipelineFactory.java
parent607123610018cdc1f0e391fec43e54e769d40a06 (diff)
parent786f101fab6a81007f67e868d381302f4a502d77 (diff)
downloadtrackermap-server-2a34f67542221e27e64ee48928fe8fd7d59f7714.tar.gz
trackermap-server-2a34f67542221e27e64ee48928fe8fd7d59f7714.tar.bz2
trackermap-server-2a34f67542221e27e64ee48928fe8fd7d59f7714.zip
Merge pull request #3901 from Abyss777/engineHours_handler
Implement engine hours accumulation
Diffstat (limited to 'src/org/traccar/BasePipelineFactory.java')
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java
index 5a077da7c..b0de67a15 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 DistanceHandler distanceHandler;
+ private EngineHoursHandler engineHoursHandler;
private RemoteAddressHandler remoteAddressHandler;
private MotionHandler motionHandler;
private GeocoderHandler geocoderHandler;
@@ -155,6 +156,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
motionHandler = new MotionHandler(Context.getTripsConfig().getSpeedThreshold());
+ if (Context.getConfig().getBoolean("processing.engineHours.enable")) {
+ engineHoursHandler = new EngineHoursHandler();
+ }
+
if (Context.getConfig().hasKey("location.latitudeHemisphere")
|| Context.getConfig().hasKey("location.longitudeHemisphere")) {
hemisphereHandler = new HemisphereHandler();
@@ -225,6 +230,10 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory {
pipeline.addLast("motion", motionHandler);
}
+ if (engineHoursHandler != null) {
+ pipeline.addLast("engineHours", engineHoursHandler);
+ }
+
if (copyAttributesHandler != null) {
pipeline.addLast("copyAttributes", copyAttributesHandler);
}