diff options
author | Abyss777 <abyss@fox5.ru> | 2018-05-29 17:03:15 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-05-29 17:03:15 +0500 |
commit | c71701136245a63ea82a8a595dd51cc011ab2c35 (patch) | |
tree | 50f7daaa7addb539121f0309f779a14299b03438 /src/org/traccar/protocol/Mta6ProtocolDecoder.java | |
parent | b41af1b39cdaa511dbf53769342ebca5b0348931 (diff) | |
download | trackermap-server-c71701136245a63ea82a8a595dd51cc011ab2c35.tar.gz trackermap-server-c71701136245a63ea82a8a595dd51cc011ab2c35.tar.bz2 trackermap-server-c71701136245a63ea82a8a595dd51cc011ab2c35.zip |
Add units converter helper
Diffstat (limited to 'src/org/traccar/protocol/Mta6ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Mta6ProtocolDecoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java index 8cbe9eee8..6ec5faea8 100644 --- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java +++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java @@ -29,6 +29,7 @@ import org.traccar.Protocol; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Log; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -231,7 +232,8 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder { if (BitUtil.check(flags, 1)) { position.set(Position.KEY_FUEL_CONSUMPTION, new FloatReader().readFloat(buf)); - position.set(Position.KEY_HOURS, (long) (new FloatReader().readFloat(buf) * 3600000)); + position.set( + Position.KEY_HOURS, UnitsConverter.millisecondsFromHours(new FloatReader().readFloat(buf))); position.set("tank", buf.readUnsignedByte() * 0.4); } |