diff options
author | Abyss777 <abyss@fox5.ru> | 2016-07-25 08:59:36 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-07-25 08:59:36 +0500 |
commit | f6333c73fe8bdd0027bb16a715193e1587b934a2 (patch) | |
tree | 340e9f66b9c3891665a0284e4a3ca8c813d87827 /src/org/traccar/events/OverspeedEventHandler.java | |
parent | 866c3073ef48a24d86834a391a4d3d91209a6eed (diff) | |
download | trackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.tar.gz trackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.tar.bz2 trackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.zip |
- Move lastPosition update to the end of pipeline
- Optimize MotionEventHandler to do not use Device.motion
- Remove Device.motion from model and database
- some optimizations
Diffstat (limited to 'src/org/traccar/events/OverspeedEventHandler.java')
-rw-r--r-- | src/org/traccar/events/OverspeedEventHandler.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/org/traccar/events/OverspeedEventHandler.java b/src/org/traccar/events/OverspeedEventHandler.java index fd005e170..6c9b523f4 100644 --- a/src/org/traccar/events/OverspeedEventHandler.java +++ b/src/org/traccar/events/OverspeedEventHandler.java @@ -44,15 +44,14 @@ public class OverspeedEventHandler extends BaseEventHandler { if (device == null) { return null; } - if (position.getId() != device.getPositionId() || !position.getValid()) { + if (!Context.getDeviceManager().isLatestPosition(position) || !position.getValid()) { return null; } Collection<Event> events = new ArrayList<>(); double speed = position.getSpeed(); - boolean valid = position.getValid(); - if (valid && globalSpeedLimit != 0 && speed > globalSpeedLimit) { + if (globalSpeedLimit != 0 && speed > globalSpeedLimit) { try { if (Context.getDataManager().getLastEvents( position.getDeviceId(), Event.TYPE_DEVICE_OVERSPEED, suppressRepeated).isEmpty()) { |