diff options
author | Abyss777 <abyss@fox5.ru> | 2017-08-29 17:06:14 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-08-29 17:06:14 +0500 |
commit | 72d35d6c63ff80353eae1559d5c5d71c94d137bb (patch) | |
tree | 22550a31fad86f044633af278c731173d63398eb /src/org/traccar/protocol/XexunProtocolDecoder.java | |
parent | eef6dcea77898d5a917b225cfc8260ed88309a34 (diff) | |
download | trackermap-server-72d35d6c63ff80353eae1559d5c5d71c94d137bb.tar.gz trackermap-server-72d35d6c63ff80353eae1559d5c5d71c94d137bb.tar.bz2 trackermap-server-72d35d6c63ff80353eae1559d5c5d71c94d137bb.zip |
Move common speed converting code to BaseProtocolDecoder
Diffstat (limited to 'src/org/traccar/protocol/XexunProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/XexunProtocolDecoder.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 20804bbb4..a5a38c370 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -17,13 +17,11 @@ package org.traccar.protocol; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; -import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; import org.traccar.model.Position; -import org.traccar.helper.UnitsConverter; import java.net.SocketAddress; import java.util.regex.Pattern; @@ -121,14 +119,7 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); - switch (Context.getConfig().getString(getProtocolName() + ".speed", "kn")) { - case "kmh": - position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0))); - break; - default: - position.setSpeed(parser.nextDouble(0)); - break; - } + position.setSpeed(convertSpeed(parser.nextDouble(0), "kn")); position.setCourse(parser.nextDouble(0)); |