diff options
author | jon-stumpf <jon.stumpf@gmail.com> | 2017-03-05 00:45:41 -0500 |
---|---|---|
committer | jon-stumpf <jon.stumpf@gmail.com> | 2017-03-05 00:45:41 -0500 |
commit | 0ba3f3ba0fc3ab04cfbbc860afcb736d838a7057 (patch) | |
tree | 02f23f93fcbbebfbea187d95363956166b9945c1 /src/org/traccar/protocol | |
parent | c62fa33fb0748f44d9584970924c90c70f4f976a (diff) | |
download | traccar-server-0ba3f3ba0fc3ab04cfbbc860afcb736d838a7057.tar.gz traccar-server-0ba3f3ba0fc3ab04cfbbc860afcb736d838a7057.tar.bz2 traccar-server-0ba3f3ba0fc3ab04cfbbc860afcb736d838a7057.zip |
Performed all KEY_POWER and KEY_BATTERY conversions using multiplication versus division;
Diffstat (limited to 'src/org/traccar/protocol')
5 files changed, 6 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/FoxProtocolDecoder.java b/src/org/traccar/protocol/FoxProtocolDecoder.java index e01c3aae3..e48b13cb7 100644 --- a/src/org/traccar/protocol/FoxProtocolDecoder.java +++ b/src/org/traccar/protocol/FoxProtocolDecoder.java @@ -108,7 +108,7 @@ public class FoxProtocolDecoder extends BaseProtocolDecoder { position.setCourse(parser.nextDouble()); position.set(Position.KEY_INPUT, parser.nextInt(2)); - position.set(Position.KEY_POWER, parser.nextDouble() / 10); + position.set(Position.KEY_POWER, parser.nextDouble() * 0.1); position.set(Position.PREFIX_TEMP + 1, parser.nextInt()); position.set(Position.KEY_RPM, parser.nextInt()); position.set(Position.KEY_FUEL_LEVEL, parser.nextInt()); diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index f01efb9d8..2ad4be3d3 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -120,7 +120,7 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_STATUS, buf.readUnsignedByte()); position.set("key", buf.readUnsignedByte()); position.set("oil", buf.readUnsignedShort() / 10.0); - position.set(Position.KEY_POWER, buf.readUnsignedByte() + buf.readUnsignedByte() / 100.0); + position.set(Position.KEY_POWER, buf.readUnsignedByte() + buf.readUnsignedByte() * 0.01); position.set(Position.KEY_ODOMETER, buf.readUnsignedInt()); return position; diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index 97e980290..db26db820 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -105,7 +105,7 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_GPS, parser.next()); position.set(Position.KEY_INPUT, parser.next()); position.set(Position.KEY_OUTPUT, parser.next()); - position.set(Position.KEY_BATTERY, parser.nextDouble() / 10); + position.set(Position.KEY_BATTERY, parser.nextDouble() * 0.1); return position; } diff --git a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java index 345c1aea3..f4dded972 100644 --- a/src/org/traccar/protocol/SkypatrolProtocolDecoder.java +++ b/src/org/traccar/protocol/SkypatrolProtocolDecoder.java @@ -166,7 +166,7 @@ public class SkypatrolProtocolDecoder extends BaseProtocolDecoder { } if (BitUtil.check(mask, 24)) { - position.set(Position.KEY_POWER, buf.readUnsignedShort() / 1000.0); + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001); } if (BitUtil.check(mask, 25)) { diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index 67a1d1213..c7dc9e6c1 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -275,7 +275,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { position.setTime(dateBuilder.getDate()); position.set(Position.PREFIX_IO + 1, parser.next()); - position.set(Position.KEY_BATTERY, parser.nextDouble() / 10); + position.set(Position.KEY_BATTERY, parser.nextDouble() * 0.1); position.set(Position.KEY_POWER, parser.nextDouble()); position.set(Position.PREFIX_ADC + 1, parser.next()); position.set(Position.PREFIX_ADC + 2, parser.next()); @@ -303,7 +303,7 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); - position.set(Position.KEY_BATTERY, parser.nextDouble() / 10); + position.set(Position.KEY_BATTERY, parser.nextDouble() * 0.1); position.set(Position.KEY_POWER, parser.nextDouble()); position.set(Position.PREFIX_ADC + 1, parser.next()); |