aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-08-23 08:48:20 +0500
committerAbyss777 <abyss@fox5.ru>2018-08-23 08:48:20 +0500
commit12bb168b88fc3dbcdf59c2fec1a919e20ab57838 (patch)
treee66c633881d6befb4b1415f2a190c7941343a905 /src/org/traccar/database/DeviceManager.java
parent2a386eab0a4baed5c606113dd9a875a088f9f4e5 (diff)
downloadtrackermap-server-12bb168b88fc3dbcdf59c2fec1a919e20ab57838.tar.gz
trackermap-server-12bb168b88fc3dbcdf59c2fec1a919e20ab57838.tar.bz2
trackermap-server-12bb168b88fc3dbcdf59c2fec1a919e20ab57838.zip
Implement Device Engine Hours reset
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r--src/org/traccar/database/DeviceManager.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index c59061b7f..c32aca6f9 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -30,7 +30,7 @@ import org.traccar.Context;
import org.traccar.helper.Log;
import org.traccar.model.Device;
import org.traccar.model.DeviceState;
-import org.traccar.model.DeviceTotalDistance;
+import org.traccar.model.DeviceAccumulators;
import org.traccar.model.Group;
import org.traccar.model.Position;
import org.traccar.model.Server;
@@ -351,10 +351,11 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity
return result;
}
- public void resetTotalDistance(DeviceTotalDistance deviceTotalDistance) throws SQLException {
- Position last = positions.get(deviceTotalDistance.getDeviceId());
+ public void resetDeviceAccumulators(DeviceAccumulators deviceAccumulators) throws SQLException {
+ Position last = positions.get(deviceAccumulators.getDeviceId());
if (last != null) {
- last.getAttributes().put(Position.KEY_TOTAL_DISTANCE, deviceTotalDistance.getTotalDistance());
+ last.getAttributes().put(Position.KEY_TOTAL_DISTANCE, deviceAccumulators.getTotalDistance());
+ last.getAttributes().put(Position.KEY_HOURS, deviceAccumulators.getHours());
getDataManager().addObject(last);
updateLatestPosition(last);
} else {