diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-30 14:04:24 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-30 14:04:24 -0700 |
commit | 014cf82a9e63a36e944e293932f9edf27e452919 (patch) | |
tree | 7ac5899f535fbf47e66dc1321738c951473a009b /src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java | |
parent | ce661ec77a957b70c15509c6801e6f34b32ad11d (diff) | |
download | trackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.tar.gz trackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.tar.bz2 trackermap-server-014cf82a9e63a36e944e293932f9edf27e452919.zip |
No context dependency for decoder
Diffstat (limited to 'src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java index 247a1b696..9a5d537ef 100644 --- a/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/AtrackProtocolDecoder.java @@ -20,7 +20,6 @@ import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; -import org.traccar.Context; import org.traccar.DeviceSession; import org.traccar.NetworkMessage; import org.traccar.Protocol; @@ -54,7 +53,7 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { private static final int MIN_DATA_LENGTH = 40; private boolean longDate; - private final boolean decimalFuel; + private boolean decimalFuel; private boolean custom; private String form; @@ -64,17 +63,20 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { public AtrackProtocolDecoder(Protocol protocol) { super(protocol); + } - longDate = Context.getConfig().getBoolean(Keys.PROTOCOL_LONG_DATE.withPrefix(getProtocolName())); - decimalFuel = Context.getConfig().getBoolean(Keys.PROTOCOL_DECIMAL_FUEL.withPrefix(getProtocolName())); + @Override + protected void init() { + longDate = getConfig().getBoolean(Keys.PROTOCOL_LONG_DATE.withPrefix(getProtocolName())); + decimalFuel = getConfig().getBoolean(Keys.PROTOCOL_DECIMAL_FUEL.withPrefix(getProtocolName())); - custom = Context.getConfig().getBoolean(Keys.PROTOCOL_CUSTOM.withPrefix(getProtocolName())); - form = Context.getConfig().getString(Keys.PROTOCOL_FORM.withPrefix(getProtocolName())); + custom = getConfig().getBoolean(Keys.PROTOCOL_CUSTOM.withPrefix(getProtocolName())); + form = getConfig().getString(Keys.PROTOCOL_FORM.withPrefix(getProtocolName())); if (form != null) { custom = true; } - String alarmMapString = Context.getConfig().getString(Keys.PROTOCOL_ALARM_MAP.withPrefix(getProtocolName())); + String alarmMapString = getConfig().getString(Keys.PROTOCOL_ALARM_MAP.withPrefix(getProtocolName())); if (alarmMapString != null) { for (String pair : alarmMapString.split(",")) { if (!pair.isEmpty()) { |