aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-23 21:01:38 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-23 21:01:38 -0700
commit9aeedc90da24848ff97227d6f281eb4d1e1506ef (patch)
treef46e77071587a7c22ffcdfc2337f892128046a18 /src/main/java/org/traccar/handler
parent50e730c0cbbe253b68a2db0e57920ddc3a1b3814 (diff)
downloadtrackermap-server-9aeedc90da24848ff97227d6f281eb4d1e1506ef.tar.gz
trackermap-server-9aeedc90da24848ff97227d6f281eb4d1e1506ef.tar.bz2
trackermap-server-9aeedc90da24848ff97227d6f281eb4d1e1506ef.zip
Add speed limit multiplier (fix #5161)
Diffstat (limited to 'src/main/java/org/traccar/handler')
-rw-r--r--src/main/java/org/traccar/handler/events/OverspeedEventHandler.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
index 94fdc4699..3bb5f713c 100644
--- a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2023 Anton Tananaev (anton@traccar.org)
* Copyright 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -52,6 +52,7 @@ public class OverspeedEventHandler extends BaseEventHandler {
private final long minimalDuration;
private final boolean preferLowest;
+ private final double multiplier;
@Inject
public OverspeedEventHandler(
@@ -60,6 +61,7 @@ public class OverspeedEventHandler extends BaseEventHandler {
this.storage = storage;
minimalDuration = config.getLong(Keys.EVENT_OVERSPEED_MINIMAL_DURATION) * 1000;
preferLowest = config.getBoolean(Keys.EVENT_OVERSPEED_PREFER_LOWEST);
+ multiplier = config.getDouble(Keys.EVENT_OVERSPEED_THRESHOLD_MULTIPLIER);
}
@Override
@@ -107,7 +109,7 @@ public class OverspeedEventHandler extends BaseEventHandler {
}
OverspeedState state = OverspeedState.fromDevice(device);
- OverspeedProcessor.updateState(state, position, speedLimit, minimalDuration, overspeedGeofenceId);
+ OverspeedProcessor.updateState(state, position, speedLimit, multiplier, minimalDuration, overspeedGeofenceId);
if (state.isChanged()) {
state.toDevice(device);
try {