diff options
author | Abyss777 <abyss@fox5.ru> | 2016-05-26 09:30:43 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-05-26 09:30:43 +0500 |
commit | aa12e5c750e771016545269ffa39409b06b47eee (patch) | |
tree | d21b4414b532bfc53c9a905f3caa09f70b43b59e /src/org/traccar/protocol/NavisProtocolDecoder.java | |
parent | ac2405f0d57fac51fe95aa755f90fe82f26f73bc (diff) | |
download | trackermap-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/NavisProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/NavisProtocolDecoder.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 06af49893..fbd704355 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -22,7 +22,6 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; import org.traccar.helper.Log; -import org.traccar.model.Event; import org.traccar.model.Position; import java.net.SocketAddress; @@ -91,38 +90,38 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { position.set("format", format); long index = buf.readUnsignedInt(); - position.set(Event.KEY_INDEX, index); + position.set(Position.KEY_INDEX, index); - position.set(Event.KEY_EVENT, buf.readUnsignedShort()); + position.set(Position.KEY_EVENT, buf.readUnsignedShort()); buf.skipBytes(6); // event time - position.set(Event.KEY_ALARM, buf.readUnsignedByte()); - position.set(Event.KEY_STATUS, buf.readUnsignedByte()); - position.set(Event.KEY_GSM, buf.readUnsignedByte()); + position.set(Position.KEY_ALARM, buf.readUnsignedByte()); + position.set(Position.KEY_STATUS, buf.readUnsignedByte()); + position.set(Position.KEY_GSM, buf.readUnsignedByte()); if (isFormat(format, F10, F20, F30)) { - position.set(Event.KEY_OUTPUT, buf.readUnsignedShort()); + position.set(Position.KEY_OUTPUT, buf.readUnsignedShort()); } else if (isFormat(format, F40, F50, F51, F52)) { - position.set(Event.KEY_OUTPUT, buf.readUnsignedByte()); + position.set(Position.KEY_OUTPUT, buf.readUnsignedByte()); } if (isFormat(format, F10, F20, F30, F40)) { - position.set(Event.KEY_INPUT, buf.readUnsignedShort()); + position.set(Position.KEY_INPUT, buf.readUnsignedShort()); } else if (isFormat(format, F50, F51, F52)) { - position.set(Event.KEY_INPUT, buf.readUnsignedByte()); + position.set(Position.KEY_INPUT, buf.readUnsignedByte()); } - position.set(Event.KEY_POWER, buf.readUnsignedShort() * 0.001); - position.set(Event.KEY_BATTERY, buf.readUnsignedShort()); + position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.001); + position.set(Position.KEY_BATTERY, buf.readUnsignedShort()); if (isFormat(format, F10, F20, F30)) { - position.set(Event.PREFIX_TEMP + 1, buf.readShort()); + position.set(Position.PREFIX_TEMP + 1, buf.readShort()); } if (isFormat(format, F10, F20, F50, F52)) { - position.set(Event.PREFIX_ADC + 1, buf.readUnsignedShort()); - position.set(Event.PREFIX_ADC + 2, buf.readUnsignedShort()); + position.set(Position.PREFIX_ADC + 1, buf.readUnsignedShort()); + position.set(Position.PREFIX_ADC + 2, buf.readUnsignedShort()); } // Impulse counters @@ -145,7 +144,7 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(buf.readFloat()); position.setCourse(buf.readUnsignedShort()); - position.set(Event.KEY_ODOMETER, buf.readFloat()); + position.set(Position.KEY_ODOMETER, buf.readFloat()); position.set("segment", buf.readFloat()); // last segment |