From c7d721cfc55b614ab4bf3d656381b7b590ae99e9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 16 Nov 2015 11:33:26 +1300 Subject: Add outdated position boolean flag --- src/org/traccar/BaseProtocolDecoder.java | 2 ++ src/org/traccar/model/Position.java | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'src/org') diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java index f8abdcc85..bd91f5e09 100644 --- a/src/org/traccar/BaseProtocolDecoder.java +++ b/src/org/traccar/BaseProtocolDecoder.java @@ -75,6 +75,8 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder { } public void getLastLocation(Position position, Date deviceTime) { + position.setOutdated(true); + Position last = Context.getConnectionManager().getLastPosition(getDeviceId()); if (last != null) { position.setFixTime(last.getFixTime()); diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java index 1ed559ecd..9494da042 100644 --- a/src/org/traccar/model/Position.java +++ b/src/org/traccar/model/Position.java @@ -47,6 +47,16 @@ public class Position extends Event implements Factory { setFixTime(time); } + private boolean outdated; + + public boolean getOutdated() { + return outdated; + } + + public void setOutdated(boolean outdated) { + this.outdated = outdated; + } + private boolean valid; public boolean getValid() { -- cgit v1.2.3