aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/WialonProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-04-17 16:38:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-04-17 16:38:02 +1200
commitd643e9a75f1c6580d098b68cffc2c709db611d8e (patch)
treeb0d146aaa67352c46d4c5cfbd19aaa2cf6d2973e /src/org/traccar/protocol/WialonProtocolDecoder.java
parent1c756c57653b72a656407da9c53ac292c5551cdb (diff)
downloadtrackermap-server-d643e9a75f1c6580d098b68cffc2c709db611d8e.tar.gz
trackermap-server-d643e9a75f1c6580d098b68cffc2c709db611d8e.tar.bz2
trackermap-server-d643e9a75f1c6580d098b68cffc2c709db611d8e.zip
Normalize fuel level value
Diffstat (limited to 'src/org/traccar/protocol/WialonProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/WialonProtocolDecoder.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java
index c1a125601..a07dfc7c9 100644
--- a/src/org/traccar/protocol/WialonProtocolDecoder.java
+++ b/src/org/traccar/protocol/WialonProtocolDecoder.java
@@ -116,7 +116,11 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder {
for (String param : values) {
Matcher paramParser = Pattern.compile("(.*):[1-3]:(.*)").matcher(param);
if (paramParser.matches()) {
- position.set(paramParser.group(1).toLowerCase(), paramParser.group(2));
+ try {
+ position.set(paramParser.group(1).toLowerCase(), Double.parseDouble(paramParser.group(2)));
+ } catch (NumberFormatException e) {
+ position.set(paramParser.group(1).toLowerCase(), paramParser.group(2));
+ }
}
}
}