aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/events/MaintenanceEventHandler.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-21 09:53:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-21 09:53:43 +0500
commit40b74ef0eb357c51034d38fd6ff135f28f5406a9 (patch)
treeee2508bc096c3a9eb4190a40581c07344f35795d /src/org/traccar/events/MaintenanceEventHandler.java
parent973b9e34ea077abba137d91da3000be41e35055b (diff)
downloadtrackermap-server-40b74ef0eb357c51034d38fd6ff135f28f5406a9.tar.gz
trackermap-server-40b74ef0eb357c51034d38fd6ff135f28f5406a9.tar.bz2
trackermap-server-40b74ef0eb357c51034d38fd6ff135f28f5406a9.zip
Add attributes to overspeed and maintenance events
Diffstat (limited to 'src/org/traccar/events/MaintenanceEventHandler.java')
-rw-r--r--src/org/traccar/events/MaintenanceEventHandler.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/events/MaintenanceEventHandler.java b/src/org/traccar/events/MaintenanceEventHandler.java
index 4d0d93080..86836f6af 100644
--- a/src/org/traccar/events/MaintenanceEventHandler.java
+++ b/src/org/traccar/events/MaintenanceEventHandler.java
@@ -58,7 +58,9 @@ public class MaintenanceEventHandler extends BaseEventHandler {
newTotalDistance -= maintenanceStart;
if ((long) (oldTotalDistance / maintenanceInterval) < (long) (newTotalDistance / maintenanceInterval)) {
- return Collections.singleton(new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId()));
+ Event event = new Event(Event.TYPE_MAINTENANCE, position.getDeviceId(), position.getId());
+ event.set(Position.KEY_TOTAL_DISTANCE, newTotalDistance);
+ return Collections.singleton(event);
}
return null;