From f9065826c7855d1344ba75a4eb46da325eb91cab Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 23 Aug 2016 11:23:31 +0500 Subject: - Fixed GL200 odometer units - Fixed ReportUtilsTest --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 148fc6357..385039399 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -308,7 +308,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { parser.skip(4); // alternative networks - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); } private Object decodeObd(Channel channel, SocketAddress remoteAddress, String sentence) { @@ -392,7 +392,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_POWER, power); } - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); position.set(Position.KEY_BATTERY, parser.next()); position.set(Position.KEY_ODOMETER, parser.next()); @@ -446,7 +446,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { decodeLocation(position, parser); position.set(Position.KEY_HOURS, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { DateBuilder dateBuilder = new DateBuilder() @@ -479,7 +479,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { decodeLocation(position, parser); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); if (parser.hasNext(6)) { DateBuilder dateBuilder = new DateBuilder() @@ -518,7 +518,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.next()); position.set(Position.KEY_BATTERY, parser.next()); - position.set(Position.KEY_ODOMETER, parser.next()); + position.set(Position.KEY_ODOMETER, parser.nextDouble() * 1000); // workaround for wrong location time if (parser.hasNext(6)) { -- cgit v1.2.3