aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-16 17:46:59 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-17 19:26:34 +0500
commit81eaa754481df6390175a8dc01e6378dcd9fc485 (patch)
tree9df00ae671d97bb17182ae6694f4c7d2be47a351 /src/org
parentbfacd794c443f0f54a27d5d52b33de4628a36009 (diff)
downloadtrackermap-server-81eaa754481df6390175a8dc01e6378dcd9fc485.tar.gz
trackermap-server-81eaa754481df6390175a8dc01e6378dcd9fc485.tar.bz2
trackermap-server-81eaa754481df6390175a8dc01e6378dcd9fc485.zip
- Used constants for fuel consumption
- Fixed Gps103 fuel
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/model/Position.java2
-rw-r--r--src/org/traccar/protocol/Gl200ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java5
-rw-r--r--src/org/traccar/protocol/IntellitracProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/Mta6ProtocolDecoder.java2
-rw-r--r--src/org/traccar/protocol/XirgoProtocolDecoder.java3
6 files changed, 10 insertions, 6 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 9f8a9692d..e0fda40f0 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -39,6 +39,8 @@ public class Position extends Message {
public static final String KEY_LAC = "lac";
public static final String KEY_CID = "cid";
public static final String KEY_FUEL = "fuel";
+ public static final String KEY_FUEL_CONSUMPTION = "fuelConsumption";
+ public static final String KEY_FUEL_INSTANT_CONSUMPTION = "fuelInstantConsumption";
public static final String KEY_RFID = "rfid";
public static final String KEY_VERSION = "version";
public static final String KEY_TYPE = "type";
diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
index cadc188d6..148fc6357 100644
--- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java
@@ -329,7 +329,7 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_RPM, parser.next());
position.set(Position.KEY_OBD_SPEED, parser.next());
position.set(Position.PREFIX_TEMP + 1, parser.next());
- position.set("fuelConsumption", parser.next());
+ position.set(Position.KEY_FUEL_CONSUMPTION, parser.next());
position.set("dtcsClearedDistance", parser.next());
position.set("odbConnect", parser.next());
position.set("dtcsNumber", parser.next());
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index b153984cb..db28bae51 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -87,7 +87,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
.number("(dd)(dd)(dd),") // time
.number("(d+),") // odometer
.number("(d+.d+)?,") // fuel instant
- .number("(?:d+.d+)?,") // fuel average
+ .number("(d+.d+)?,") // fuel average
.number("(d+),") // hours
.number("(d+),") // speed
.number("d+.?d*%,") // power load
@@ -189,7 +189,8 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
getLastLocation(position, dateBuilder.getDate());
position.set(Position.KEY_ODOMETER, parser.nextInt());
- position.set(Position.KEY_FUEL, parser.next());
+ position.set(Position.KEY_FUEL_INSTANT_CONSUMPTION, parser.next());
+ position.set(Position.KEY_FUEL_CONSUMPTION, parser.next());
position.set(Position.KEY_HOURS, parser.next());
position.set(Position.KEY_OBD_SPEED, parser.next());
position.set(Position.PREFIX_TEMP + 1, parser.next());
diff --git a/src/org/traccar/protocol/IntellitracProtocolDecoder.java b/src/org/traccar/protocol/IntellitracProtocolDecoder.java
index 06d6476e6..88c247253 100644
--- a/src/org/traccar/protocol/IntellitracProtocolDecoder.java
+++ b/src/org/traccar/protocol/IntellitracProtocolDecoder.java
@@ -109,7 +109,7 @@ public class IntellitracProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_RPM, parser.next());
position.set("coolant", parser.next());
position.set(Position.KEY_FUEL, parser.next());
- position.set("consumption", parser.next());
+ position.set(Position.KEY_FUEL_CONSUMPTION, parser.next());
position.set(Position.PREFIX_TEMP + 1, parser.next());
position.set(Position.KEY_CHARGE, parser.next());
position.set("tpl", parser.next());
diff --git a/src/org/traccar/protocol/Mta6ProtocolDecoder.java b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
index 609f0b63e..ea1902c89 100644
--- a/src/org/traccar/protocol/Mta6ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Mta6ProtocolDecoder.java
@@ -231,7 +231,7 @@ public class Mta6ProtocolDecoder extends BaseProtocolDecoder {
}
if (BitUtil.check(flags, 1)) {
- new FloatReader().readFloat(buf); // fuel consumtion
+ position.set(Position.KEY_FUEL_CONSUMPTION, new FloatReader().readFloat(buf));
position.set("hours", new FloatReader().readFloat(buf));
position.set("tank", buf.readUnsignedByte() * 0.4);
}
diff --git a/src/org/traccar/protocol/XirgoProtocolDecoder.java b/src/org/traccar/protocol/XirgoProtocolDecoder.java
index 5006102e6..df5665992 100644
--- a/src/org/traccar/protocol/XirgoProtocolDecoder.java
+++ b/src/org/traccar/protocol/XirgoProtocolDecoder.java
@@ -75,7 +75,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // satellites
.number("(d+.?d*),") // hdop
.number("(d+.?d*),") // odometer
- .number("d+.?d*,") // fuel consumption
+ .number("(d+.?d*),") // fuel consumption
.number("(d+.d+),") // battery
.number("(d+),") // gsm
.number("(d+),") // gps
@@ -134,6 +134,7 @@ public class XirgoProtocolDecoder extends BaseProtocolDecoder {
if (newFormat) {
position.set(Position.KEY_ODOMETER, parser.next());
+ position.set(Position.KEY_FUEL_CONSUMPTION, parser.next());
}
position.set(Position.KEY_BATTERY, parser.next());