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/GlobalSatProtocolDecoder.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/GlobalSatProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 05c4dec47..049bb2f7f 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -177,21 +177,21 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN = new PatternBuilder() - .txt("$") - .num("(d+),") // imei - .num("d+,") // mode - .num("(d),") // fix - .num("(dd)(dd)(dd),") // date (ddmmyy) - .num("(dd)(dd)(dd),") // time (hhmmss) - .xpr("([EW])") - .num("(ddd)(dd.d+),") // longitude (dddmm.mmmm) - .xpr("([NS])") - .num("(dd)(dd.d+),") // latitude (ddmm.mmmm) - .num("(d+.?d*),") // altitude - .num("(d+.?d*),") // speed - .num("(d+.?d*),") // course - .num("(d+),") // satellites - .num("(d+.?d*)") // hdop + .text("$") + .number("(d+),") // imei + .number("d+,") // mode + .number("(d),") // fix + .number("(dd)(dd)(dd),") // date (ddmmyy) + .number("(dd)(dd)(dd),") // time (hhmmss) + .expression("([EW])") + .number("(ddd)(dd.d+),") // longitude (dddmm.mmmm) + .expression("([NS])") + .number("(dd)(dd.d+),") // latitude (ddmm.mmmm) + .number("(d+.?d*),") // altitude + .number("(d+.?d*),") // speed + .number("(d+.?d*),") // course + .number("(d+),") // satellites + .number("(d+.?d*)") // hdop .compile(); private Position decodeAlternative(Channel channel, String sentence) { |