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/MtxProtocolDecoder.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/MtxProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MtxProtocolDecoder.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/org/traccar/protocol/MtxProtocolDecoder.java b/src/org/traccar/protocol/MtxProtocolDecoder.java index bcf77ff4a..802875345 100644 --- a/src/org/traccar/protocol/MtxProtocolDecoder.java +++ b/src/org/traccar/protocol/MtxProtocolDecoder.java @@ -32,26 +32,26 @@ public class MtxProtocolDecoder extends BaseProtocolDecoder { } private static final Pattern PATTERN = new PatternBuilder() - .txt("#MTX,") - .num("(d+),") // IMEI - .num("(dddd)(dd)(dd),") // Date - .num("(dd)(dd)(dd),") // Time - .num("(-?d+.d+),") // Latitude - .num("(-?d+.d+),") // Longitude - .num("(d+.?d*),") // Speed - .num("(d+),") // Course - .num("(d+.?d*),") // Odometer + .text("#MTX,") + .number("(d+),") // imei + .number("(dddd)(dd)(dd),") // date + .number("(dd)(dd)(dd),") // time + .number("(-?d+.d+),") // latitude + .number("(-?d+.d+),") // longitude + .number("(d+.?d*),") // speed + .number("(d+),") // course + .number("(d+.?d*),") // odometer .groupBegin() - .num("d+") + .number("d+") .or() - .txt("X") - .groupEnd(false) - .txt(",") - .xpr("(?:[01]|X),") - .xpr("([01]+),") // Input - .xpr("([01]+),") // Output - .num("(d+),") // ADC1 - .num("(d+)") // ADC2 + .text("X") + .groupEnd() + .text(",") + .expression("(?:[01]|X),") + .expression("([01]+),") // input + .expression("([01]+),") // output + .number("(d+),") // adc1 + .number("(d+)") // adc2 .any() .compile(); |