aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-08 09:53:31 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-09 11:04:29 +0500
commit94a922eaf167a73a0188255398fb1c6799767e18 (patch)
treed1f23e82db216a1c859a096a2c4f7f8676d50a6b /src/org/traccar/database/DeviceManager.java
parentc76acd69275ae2d6612bb731758df8a5b91e6508 (diff)
downloadtrackermap-server-94a922eaf167a73a0188255398fb1c6799767e18.tar.gz
trackermap-server-94a922eaf167a73a0188255398fb1c6799767e18.tar.bz2
trackermap-server-94a922eaf167a73a0188255398fb1c6799767e18.zip
Implement motion detection similar to trips detection
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r--src/org/traccar/database/DeviceManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index 5d123f9b8..3b7e5c617 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -33,6 +33,7 @@ import org.traccar.helper.Log;
import org.traccar.model.Command;
import org.traccar.model.CommandType;
import org.traccar.model.Device;
+import org.traccar.model.DeviceState;
import org.traccar.model.DeviceTotalDistance;
import org.traccar.model.Group;
import org.traccar.model.Position;
@@ -52,6 +53,8 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
private final Map<Long, Position> positions = new ConcurrentHashMap<>();
+ private final Map<Long, DeviceState> deviceStates = new ConcurrentHashMap<>();
+
private boolean fallbackToText;
public DeviceManager(DataManager dataManager) {
@@ -387,4 +390,13 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
}
return result;
}
+
+ public DeviceState getDeviceState(long deviceId) {
+ return deviceStates.get(deviceId);
+ }
+
+ public void setDeviceState(long deviceId, DeviceState deviceState) {
+ deviceStates.put(deviceId, deviceState);
+ }
+
}