diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-24 22:57:38 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-24 22:57:38 +1300 |
commit | 5538a83ac7eda6ad5775e582688dd0199e6c538c (patch) | |
tree | 7b261a5e9767fd807124c868d2c4a5d72315e7df /src/org/traccar/protocol/T55ProtocolDecoder.java | |
parent | be1baf2b062587099171b485ac1e3f591034816f (diff) | |
download | trackermap-server-5538a83ac7eda6ad5775e582688dd0199e6c538c.tar.gz trackermap-server-5538a83ac7eda6ad5775e582688dd0199e6c538c.tar.bz2 trackermap-server-5538a83ac7eda6ad5775e582688dd0199e6c538c.zip |
Refactor pattern builder class
Diffstat (limited to 'src/org/traccar/protocol/T55ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/T55ProtocolDecoder.java | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index 73c5ab73c..42db4c753 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -33,52 +33,52 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN_GPRMC = new PatternBuilder() - .txt("$GPRMC,") - .num("(dd)(dd)(dd).?d*,") // time - .xpr("([AV]),") // validity - .num("(dd)(dd.d+),") // latitude - .xpr("([NS]),") - .num("(d{2,3})(dd.d+),") // longitude - .xpr("([EW]),") - .num("(d+.?d*)?,") // speed - .num("(d+.?d*)?,") // course - .num("(dd)(dd)(dd)") // date + .text("$GPRMC,") + .number("(dd)(dd)(dd).?d*,") // time + .expression("([AV]),") // validity + .number("(dd)(dd.d+),") // latitude + .expression("([NS]),") + .number("(d{2,3})(dd.d+),") // longitude + .expression("([EW]),") + .number("(d+.?d*)?,") // speed + .number("(d+.?d*)?,") // course + .number("(dd)(dd)(dd)") // date .any() .compile(); private static final Pattern PATTERN_GPGGA = new PatternBuilder() - .txt("$GPGGA,") - .num("(dd)(dd)(dd).?d*,") // time - .num("(d+)(dd.d+),") // latitude - .xpr("([NS]),") - .num("(d+)(dd.d+),") // longitude - .xpr("([EW]),") + .text("$GPGGA,") + .number("(dd)(dd)(dd).?d*,") // time + .number("(d+)(dd.d+),") // latitude + .expression("([NS]),") + .number("(d+)(dd.d+),") // longitude + .expression("([EW]),") .any() .compile(); private static final Pattern PATTERN_GPRMA = new PatternBuilder() - .txt("$GPRMA,") - .xpr("([AV]),") // validity - .num("(dd)(dd.d+),") // latitude - .xpr("([NS]),") - .num("(ddd)(dd.d+),") // longitude - .xpr("([EW]),,,") - .num("(d+.?d*)?,") // speed - .num("(d+.?d*)?,") // course + .text("$GPRMA,") + .expression("([AV]),") // validity + .number("(dd)(dd.d+),") // latitude + .expression("([NS]),") + .number("(ddd)(dd.d+),") // longitude + .expression("([EW]),,,") + .number("(d+.?d*)?,") // speed + .number("(d+.?d*)?,") // course .any() .compile(); private static final Pattern PATTERN_TRCCR = new PatternBuilder() - .txt("$TRCCR,") - .num("(dddd)(dd)(dd)") // date - .num("(dd)(dd)(dd).?d*,") // time - .xpr("([AV]),") // validity - .num("(-?d+.d+),") // latitude - .num("(-?d+.d+),") // longitude - .num("(d+.d+),") // speed - .num("(d+.d+),") // course - .num("(-?d+.d+),") // altitude - .num("(d+.?d*),") // battery + .text("$TRCCR,") + .number("(dddd)(dd)(dd)") // date + .number("(dd)(dd)(dd).?d*,") // time + .expression("([AV]),") // validity + .number("(-?d+.d+),") // latitude + .number("(-?d+.d+),") // longitude + .number("(d+.d+),") // speed + .number("(d+.d+),") // course + .number("(-?d+.d+),") // altitude + .number("(d+.?d*),") // battery .any() .compile(); |