aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/NavigilProtocolDecoder.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-05-26 09:30:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-05-26 09:30:43 +0500
commitaa12e5c750e771016545269ffa39409b06b47eee (patch)
treed21b4414b532bfc53c9a905f3caa09f70b43b59e /src/org/traccar/protocol/NavigilProtocolDecoder.java
parentac2405f0d57fac51fe95aa755f90fe82f26f73bc (diff)
downloadtrackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.tar.gz
trackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.tar.bz2
trackermap-server-aa12e5c750e771016545269ffa39409b06b47eee.zip
- Simplification of the hierarchy of models classes
- Removed automatically founded unnecessary imports
Diffstat (limited to 'src/org/traccar/protocol/NavigilProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/NavigilProtocolDecoder.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java
index 22ae7ddee..8dd4e140b 100644
--- a/src/org/traccar/protocol/NavigilProtocolDecoder.java
+++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java
@@ -22,7 +22,6 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.helper.Checksum;
import org.traccar.helper.Log;
import org.traccar.helper.UnitsConverter;
-import org.traccar.model.Event;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -84,7 +83,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
position.setValid(true);
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedShort(); // report trigger
@@ -104,7 +103,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedInt(); // distance
buf.readUnsignedInt(); // delta distance
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
buf.readUnsignedShort(); // battery charger status
@@ -118,7 +117,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
position.setProtocol(getProtocolName());
position.setValid(true);
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedShort(); // report trigger
@@ -144,7 +143,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedShort(); // VSAUT1 voltage
buf.readUnsignedShort(); // VSAUT2 voltage
buf.readUnsignedShort(); // solar voltage
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
return position;
}
@@ -153,7 +152,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -174,7 +173,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -188,7 +187,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
short flags = buf.readUnsignedByte();
position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40);
- position.set(Event.KEY_SATELLITES, buf.readUnsignedByte());
+ position.set(Position.KEY_SATELLITES, buf.readUnsignedByte());
buf.readUnsignedInt(); // distance
return position;
}
@@ -197,7 +196,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
buf.readUnsignedByte(); // report trigger
@@ -226,7 +225,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // supply voltage 1
buf.readUnsignedByte(); // supply voltage 2
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
return position;
}
@@ -235,7 +234,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position();
position.setProtocol(getProtocolName());
- position.set(Event.KEY_INDEX, sequenceNumber);
+ position.set(Position.KEY_INDEX, sequenceNumber);
position.setDeviceId(getDeviceId());
position.setTime(convertTimestamp(timestamp));
@@ -254,7 +253,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder {
buf.readUnsignedByte(); // satellites in fix
- position.set(Event.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.001);
buf.readUnsignedInt(); // distance
return position;