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/Tk103ProtocolDecoder.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/Tk103ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolDecoder.java | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index aa75f5675..be3def453 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -23,7 +23,6 @@ import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; -import org.traccar.helper.UnitsConverter; import org.traccar.model.CellTower; import org.traccar.model.Network; import org.traccar.model.Position; @@ -253,17 +252,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); - switch (Context.getConfig().getString(getProtocolName() + ".speed", "kmh")) { - case "kn": - position.setSpeed(parser.nextDouble(0)); - break; - case "mph": - position.setSpeed(UnitsConverter.knotsFromMph(parser.nextDouble(0))); - break; - default: - position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0))); - break; - } + position.setSpeed(convertSpeed(parser.nextDouble(0), "kmh")); dateBuilder.setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); position.setTime(dateBuilder.getDate()); |