From 078ddb342c7af83d22767224a7d5b7c7e8ab4fe7 Mon Sep 17 00:00:00 2001 From: jcardus Date: Fri, 29 Mar 2024 21:57:07 +0000 Subject: Statics should be above instance variables. remove comments --- .../traccar/protocol/Gl200TextProtocolDecoder.java | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index 9b7737b36..e30fafcaf 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -47,30 +47,26 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { - - private boolean ignoreFixTime; - - private final DateFormat dateFormat; - + private static final HashMap DEVICE_MODELS = new HashMap() {{ put("02", "GL200"); put("04", "GV200"); put("06", "GV300"); put("08", "GMT100"); - put("09", "GV50P"); // GV50 Plus + put("09", "GV50P"); put("0F", "GV55"); put("10", "GV55 LITE"); put("11", "GL500"); put("1A", "GL300"); put("1F", "GV500"); - put("25", "GV300"); // New Version + put("25", "GV300"); put("27", "GV300W"); - put("2C", "GL300W"); // New version - put("2F", "GV55"); // New Version - put("30", "GL300"); // New Version - put("35", "GV200"); // New Version - put("36", "GV500"); // New Version - put("3F", "GMT100"); // New version + put("2C", "GL300W"); + put("2F", "GV55"); + put("30", "GL300"); + put("35", "GV200"); + put("36", "GV500"); + put("3F", "GMT100"); put("41", "GV75W"); put("50", "GV55W"); put("52", "GL50"); @@ -85,6 +81,10 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { put("802005", "GV355CEU"); }}; + private boolean ignoreFixTime; + + private final DateFormat dateFormat; + public Gl200TextProtocolDecoder(Protocol protocol) { super(protocol); dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); @@ -108,13 +108,13 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { } private Position initPosition(Parser parser, Channel channel, SocketAddress remoteAddress) { - if (parser.matches()) { - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); - if (deviceSession != null) { - Position position = new Position(getProtocolName()); - position.setDeviceId(deviceSession.getDeviceId()); - return position; - } +if (parser.matches()) { + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); + if (deviceSession != null) { + Position position = new Position(getProtocolName()); + position.setDeviceId(deviceSession.getDeviceId()); + return position; +} } return null; } @@ -294,7 +294,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { private Object decodeVer(Channel channel, SocketAddress remoteAddress, String sentence) { Parser parser = new Parser(PATTERN_VER, sentence); - Position position = initPosition(parser, channel, remoteAddress); + Position position = initPosition(parser, channel, remoteAddress); if (position == null) { return null; } -- cgit v1.2.3