aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-10 07:56:49 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-10 07:56:49 -0700
commitbbe84d6a751fdc840e4201ef9027a96527006049 (patch)
tree4165d09a134eb1c1c61438b17fe44f5a1fcd0654 /src/main/java/org/traccar/handler
parentc03b4a2ace925e6a0d7c43ce59e14ddb9cbf18a9 (diff)
downloadtrackermap-server-bbe84d6a751fdc840e4201ef9027a96527006049.tar.gz
trackermap-server-bbe84d6a751fdc840e4201ef9027a96527006049.tar.bz2
trackermap-server-bbe84d6a751fdc840e4201ef9027a96527006049.zip
Inject report utils
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r--src/main/java/org/traccar/handler/events/MotionEventHandler.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/handler/events/MotionEventHandler.java b/src/main/java/org/traccar/handler/events/MotionEventHandler.java
index 57d2bc1c5..2c381e530 100644
--- a/src/main/java/org/traccar/handler/events/MotionEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/MotionEventHandler.java
@@ -16,20 +16,19 @@
*/
package org.traccar.handler.events;
-import java.util.Collections;
-import java.util.Map;
-
import io.netty.channel.ChannelHandler;
import org.traccar.database.DeviceManager;
import org.traccar.database.IdentityManager;
+import org.traccar.helper.model.PositionUtil;
import org.traccar.model.Device;
-import org.traccar.session.DeviceState;
import org.traccar.model.Event;
import org.traccar.model.Position;
-import org.traccar.reports.common.ReportUtils;
import org.traccar.reports.common.TripsConfig;
+import org.traccar.session.DeviceState;
import javax.inject.Inject;
+import java.util.Collections;
+import java.util.Map;
@ChannelHandler.Sharable
public class MotionEventHandler extends BaseEventHandler {
@@ -89,7 +88,7 @@ public class MotionEventHandler extends BaseEventHandler {
Position motionPosition = deviceState.getMotionPosition();
if (motionPosition != null) {
long motionTime = motionPosition.getFixTime().getTime();
- double distance = ReportUtils.calculateDistance(motionPosition, position, false);
+ double distance = PositionUtil.calculateDistance(motionPosition, position, false);
Boolean ignition = null;
if (tripsConfig.getUseIgnition()
&& position.getAttributes().containsKey(Position.KEY_IGNITION)) {