From 934026709636ac97f60b07d6de09193f3e14710f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 28 Mar 2017 05:10:09 +1300 Subject: Remove GL200 time workaround --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 32 ++++------------------ 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index d7ee57782..45737e277 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -461,10 +461,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } return position; @@ -531,12 +528,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_RPM, parser.next()); position.set(Position.KEY_FUEL_LEVEL, parser.next()); - // workaround for wrong location time if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } return positions; @@ -563,10 +556,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } return position; @@ -594,10 +584,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } return position; @@ -700,12 +687,8 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); - // workaround for wrong location time if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } if (Context.getConfig().getBoolean(getProtocolName() + ".ack") && channel != null) { @@ -755,10 +738,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { } if (parser.hasNext(6)) { - Date date = parser.nextDateTime(); - if (!position.getOutdated() && position.getFixTime().after(date)) { - position.setTime(date); - } + position.setDeviceTime(parser.nextDateTime()); } switch (type) { -- cgit v1.2.3