aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-03-07 22:53:42 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-03-07 22:53:42 -0800
commit440b2a96c3febdd498628c9b6cfaec01649786f2 (patch)
treec1e692e0f3e5b2ccf3199d67ac97ce77326bc069 /src/main/java/org/traccar/model
parente28ae518fddc930dcb26d70a4456ee1b28fb0ecc (diff)
downloadtrackermap-server-440b2a96c3febdd498628c9b6cfaec01649786f2.tar.gz
trackermap-server-440b2a96c3febdd498628c9b6cfaec01649786f2.tar.bz2
trackermap-server-440b2a96c3febdd498628c9b6cfaec01649786f2.zip
Use device time for events
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Event.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/model/Event.java b/src/main/java/org/traccar/model/Event.java
index 47b74811a..a7a134ecf 100644
--- a/src/main/java/org/traccar/model/Event.java
+++ b/src/main/java/org/traccar/model/Event.java
@@ -19,15 +19,17 @@ import java.util.Date;
public class Event extends Message {
- public Event(String type, long deviceId, long positionId) {
- this(type, deviceId);
- setPositionId(positionId);
+ public Event(String type, Position position) {
+ setType(type);
+ setPositionId(position.getId());
+ setDeviceId(position.getDeviceId());
+ eventTime = position.getDeviceTime();
}
public Event(String type, long deviceId) {
setType(type);
setDeviceId(deviceId);
- this.eventTime = new Date();
+ eventTime = new Date();
}
public Event() {