From 9e044f48f06b1201eaf642b2e53e5ba40c46c0ff Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 14 Sep 2020 22:18:40 -0700 Subject: Use position speed limit for events --- .../java/org/traccar/handler/events/OverspeedEventHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java b/src/main/java/org/traccar/handler/events/OverspeedEventHandler.java index e534df9de..c396b28e9 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 - 2019 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2020 Anton Tananaev (anton@traccar.org) * Copyright 2018 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -122,6 +122,11 @@ public class OverspeedEventHandler extends BaseEventHandler { double speedLimit = deviceManager.lookupAttributeDouble(deviceId, ATTRIBUTE_SPEED_LIMIT, 0, true, false); + double positionSpeedLimit = position.getDouble(Position.KEY_SPEED_LIMIT); + if (positionSpeedLimit > 0) { + speedLimit = positionSpeedLimit; + } + double geofenceSpeedLimit = 0; long overspeedGeofenceId = 0; -- cgit v1.2.3