diff options
author | Anton Tananaev <anton@traccar.org> | 2023-08-23 21:01:38 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-08-23 21:01:38 -0700 |
commit | 9aeedc90da24848ff97227d6f281eb4d1e1506ef (patch) | |
tree | f46e77071587a7c22ffcdfc2337f892128046a18 /src/main/java/org/traccar/session/state | |
parent | 50e730c0cbbe253b68a2db0e57920ddc3a1b3814 (diff) | |
download | trackermap-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/session/state')
-rw-r--r-- | src/main/java/org/traccar/session/state/OverspeedProcessor.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/session/state/OverspeedProcessor.java b/src/main/java/org/traccar/session/state/OverspeedProcessor.java index b23649570..221b51ff5 100644 --- a/src/main/java/org/traccar/session/state/OverspeedProcessor.java +++ b/src/main/java/org/traccar/session/state/OverspeedProcessor.java @@ -26,13 +26,14 @@ public final class OverspeedProcessor { } public static void updateState( - OverspeedState state, Position position, double speedLimit, long minimalDuration, long geofenceId) { + OverspeedState state, Position position, + double speedLimit, double multiplier, long minimalDuration, long geofenceId) { state.setEvent(null); boolean oldState = state.getOverspeedState(); if (oldState) { - boolean newState = position.getSpeed() > speedLimit; + boolean newState = position.getSpeed() > speedLimit * multiplier; if (newState) { checkEvent(state, position, speedLimit, minimalDuration); } else { @@ -40,7 +41,7 @@ public final class OverspeedProcessor { state.setOverspeedTime(null); state.setOverspeedGeofenceId(0); } - } else if (position != null && position.getSpeed() > speedLimit) { + } else if (position != null && position.getSpeed() > speedLimit * multiplier) { state.setOverspeedState(true); state.setOverspeedTime(position.getFixTime()); state.setOverspeedGeofenceId(geofenceId); |