aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/MainModule.java')
-rw-r--r--src/org/traccar/MainModule.java13
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();