From aa12e5c750e771016545269ffa39409b06b47eee Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 26 May 2016 09:30:43 +0500 Subject: - Simplification of the hierarchy of models classes - Removed automatically founded unnecessary imports --- src/org/traccar/protocol/CalAmpProtocolDecoder.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/org/traccar/protocol/CalAmpProtocolDecoder.java') diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 292666c31..69fca3914 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -21,7 +21,6 @@ import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.BitUtil; import org.traccar.helper.UnitsConverter; -import org.traccar.model.Event; import org.traccar.model.Position; import java.net.SocketAddress; @@ -86,35 +85,35 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder { } if (type == MSG_MINI_EVENT_REPORT) { - position.set(Event.KEY_SATELLITES, buf.getUnsignedByte(buf.readerIndex()) & 0xf); + position.set(Position.KEY_SATELLITES, buf.getUnsignedByte(buf.readerIndex()) & 0xf); position.setValid((buf.readUnsignedByte() & 0x20) == 0); } else { - position.set(Event.KEY_SATELLITES, buf.readUnsignedByte()); + position.set(Position.KEY_SATELLITES, buf.readUnsignedByte()); position.setValid((buf.readUnsignedByte() & 0x08) == 0); } if (type != MSG_MINI_EVENT_REPORT) { position.set("carrier", buf.readUnsignedShort()); - position.set(Event.KEY_GSM, buf.readShort()); + position.set(Position.KEY_GSM, buf.readShort()); } position.set("modem", buf.readUnsignedByte()); if (type != MSG_MINI_EVENT_REPORT) { - position.set(Event.KEY_HDOP, buf.readUnsignedByte()); + position.set(Position.KEY_HDOP, buf.readUnsignedByte()); } - position.set(Event.KEY_INPUT, buf.readUnsignedByte()); + position.set(Position.KEY_INPUT, buf.readUnsignedByte()); if (type != MSG_MINI_EVENT_REPORT) { - position.set(Event.KEY_STATUS, buf.readUnsignedByte()); + position.set(Position.KEY_STATUS, buf.readUnsignedByte()); } if (type == MSG_EVENT_REPORT || type == MSG_MINI_EVENT_REPORT) { if (type != MSG_MINI_EVENT_REPORT) { buf.readUnsignedByte(); // event index } - position.set(Event.KEY_EVENT, buf.readUnsignedByte()); + position.set(Position.KEY_EVENT, buf.readUnsignedByte()); } int accType = BitUtil.from(buf.getUnsignedByte(buf.readerIndex()), 6); -- cgit v1.2.3