aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Tk103ProtocolDecoder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/protocol/Tk103ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index ded23da26..3c2466543 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -24,6 +24,7 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.traccar.BaseProtocolDecoder;
+import org.traccar.Context;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -121,7 +122,11 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
position.setLongitude(longitude);
// Speed
- position.setSpeed(UnitsConverter.knotsFromKph(Double.valueOf(parser.group(index++))));
+ if (Boolean.valueOf(Context.getProps().getProperty(getProtocolName() + ".mph"))) {
+ position.setSpeed(UnitsConverter.knotsFromKph(Double.valueOf(parser.group(index++))));
+ } else {
+ position.setSpeed(UnitsConverter.knotsFromMph(Double.valueOf(parser.group(index++))));
+ }
// Time
time.set(Calendar.HOUR_OF_DAY, Integer.valueOf(parser.group(index++)));