aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tk103ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-30 00:08:52 +1200
committerGitHub <noreply@github.com>2017-08-30 00:08:52 +1200
commite3dfcf55262b60142a10458641f720aff3a0f6ad (patch)
tree22550a31fad86f044633af278c731173d63398eb /src/org/traccar/protocol/Tk103ProtocolDecoder.java
parent561915e44fdf630ac10fdc8e4a207e384ea59d9a (diff)
parent72d35d6c63ff80353eae1559d5c5d71c94d137bb (diff)
downloadtrackermap-server-e3dfcf55262b60142a10458641f720aff3a0f6ad.tar.gz
trackermap-server-e3dfcf55262b60142a10458641f720aff3a0f6ad.tar.bz2
trackermap-server-e3dfcf55262b60142a10458641f720aff3a0f6ad.zip
Merge pull request #3491 from Abyss777/osmand_speedunits
Make OsmAnd speed units configurable
Diffstat (limited to 'src/org/traccar/protocol/Tk103ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java13
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());