diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-10-24 14:52:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 14:52:48 +0300 |
commit | db02157dbb29539dda4b51a5e8b317293cfc536c (patch) | |
tree | b974f082172406e16a92cb9da8136ef856f571a5 /src/org/traccar/protocol/XexunProtocolDecoder.java | |
parent | 09d3cf2b5416327700ad22b652cf4a0dca09aaf2 (diff) | |
parent | 96e15853b9c28bd31295ca2c014e226e4a50aaa1 (diff) | |
download | trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.tar.gz trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.tar.bz2 trackermap-server-db02157dbb29539dda4b51a5e8b317293cfc536c.zip |
Merge branch 'master' into master
Diffstat (limited to 'src/org/traccar/protocol/XexunProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/XexunProtocolDecoder.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index 20804bbb4..bb4b4f48c 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; @@ -70,9 +68,11 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { if (value != null) { switch (value.toLowerCase()) { case "acc on": + case "accstart": position.set(Position.KEY_IGNITION, true); break; case "acc off": + case "accstop": position.set(Position.KEY_IGNITION, false); break; case "help me!": @@ -121,14 +121,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)); |