diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-24 18:06:39 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-02-24 18:06:39 -0800 |
commit | 041c2b897c28dc316e8613c9ea38dee48dd64482 (patch) | |
tree | 2aeee13384c6927dfb734e84fce6dced8fa62c5f /src/org/traccar/MainModule.java | |
parent | d610b1ab5135503d1d39aa291190a860ddb952a9 (diff) | |
download | trackermap-server-041c2b897c28dc316e8613c9ea38dee48dd64482.tar.gz trackermap-server-041c2b897c28dc316e8613c9ea38dee48dd64482.tar.bz2 trackermap-server-041c2b897c28dc316e8613c9ea38dee48dd64482.zip |
Refactor motion handler
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r-- | src/org/traccar/MainModule.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/org/traccar/MainModule.java b/src/org/traccar/MainModule.java index c6ca65088..0c3c5be51 100644 --- a/src/org/traccar/MainModule.java +++ b/src/org/traccar/MainModule.java @@ -47,7 +47,9 @@ import org.traccar.handler.DistanceHandler; import org.traccar.handler.FilterHandler; import org.traccar.handler.GeolocationHandler; import org.traccar.handler.HemisphereHandler; +import org.traccar.handler.MotionHandler; import org.traccar.handler.RemoteAddressHandler; +import org.traccar.reports.model.TripsConfig; import javax.annotation.Nullable; import javax.ws.rs.client.Client; @@ -79,6 +81,11 @@ public class MainModule extends AbstractModule { return Context.getClient(); } + @Provides + public static TripsConfig provideTripsConfig() { + return Context.getTripsConfig(); + } + @Singleton @Provides public static StatisticsManager provideStatisticsManager(Config config, DataManager dataManager, Client client) { @@ -202,6 +209,12 @@ public class MainModule extends AbstractModule { return null; } + @Singleton + @Provides + public static MotionHandler provideMotionHandler(TripsConfig tripsConfig) { + return new MotionHandler(tripsConfig.getSpeedThreshold()); + } + @Override protected void configure() { binder().requireExplicitBindings(); |