From 40b74ef0eb357c51034d38fd6ff135f28f5406a9 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 21 Dec 2016 09:53:43 +0500 Subject: Add attributes to overspeed and maintenance events --- src/org/traccar/events/MaintenanceEventHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/events/MaintenanceEventHandler.java') 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; -- cgit v1.2.3