diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-12 11:19:34 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-12 11:19:34 +0500 |
commit | 8fa931a45755b14f61bcc699296337efefc46160 (patch) | |
tree | 8c7e35ccf1ec4accb2d08254c0696a418876e2bb /src/org/traccar/events/IgnitionEventHandler.java | |
parent | f934efecd57261a88efa122f7db5defc6adc43f1 (diff) | |
download | trackermap-server-8fa931a45755b14f61bcc699296337efefc46160.tar.gz trackermap-server-8fa931a45755b14f61bcc699296337efefc46160.tar.bz2 trackermap-server-8fa931a45755b14f61bcc699296337efefc46160.zip |
- Fixed casting ignition object to boolean
- Renamed motorHours to engineHours
- Changed engine hours formatter to just hours
- Added previously missed license headers to reports
- Added Andrey Kunitsyn to some license headers
Diffstat (limited to 'src/org/traccar/events/IgnitionEventHandler.java')
-rw-r--r-- | src/org/traccar/events/IgnitionEventHandler.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/events/IgnitionEventHandler.java b/src/org/traccar/events/IgnitionEventHandler.java index 297049ccd..ae813f77b 100644 --- a/src/org/traccar/events/IgnitionEventHandler.java +++ b/src/org/traccar/events/IgnitionEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com), Andrey Kunitsyn (abyss@fox5.ru) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,8 +40,8 @@ public class IgnitionEventHandler extends BaseEventHandler { boolean ignition = false; Object ignitionObject = position.getAttributes().get(Position.KEY_IGNITION); - if (ignitionObject != null && Boolean.parseBoolean(ignitionObject.toString())) { - ignition = true; + if (ignitionObject != null && ignitionObject instanceof Boolean) { + ignition = (Boolean) ignitionObject; } boolean oldIgnition = false; @@ -50,8 +50,8 @@ public class IgnitionEventHandler extends BaseEventHandler { if (lastPosition != null) { oldIgnitionObject = lastPosition.getAttributes().get(Position.KEY_IGNITION); } - if (oldIgnitionObject != null && Boolean.parseBoolean(oldIgnitionObject.toString())) { - oldIgnition = true; + if (oldIgnitionObject != null && oldIgnitionObject instanceof Boolean) { + oldIgnition = (Boolean) oldIgnitionObject; } if (ignition && !oldIgnition) { |