aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/Mta6ProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-05-29 17:03:15 +0500
committerAbyss777 <abyss@fox5.ru>2018-05-29 17:03:15 +0500
commitc71701136245a63ea82a8a595dd51cc011ab2c35 (patch)
tree50f7daaa7addb539121f0309f779a14299b03438 /src/org/traccar/protocol/Mta6ProtocolDecoder.java
parentb41af1b39cdaa511dbf53769342ebca5b0348931 (diff)
downloadtrackermap-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.java4
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);
}