aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/TramigoProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-06 19:39:49 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-06 19:39:49 +1300
commit315c359711b37b1afd90117564332f0770033057 (patch)
tree1a0f0ba2902cacf96b90a42c1fcf34a64b0d995f /src/org/traccar/protocol/TramigoProtocolDecoder.java
parent87a8c80f324ede8f8faa54800f286e18b969ffd1 (diff)
downloadtrackermap-server-315c359711b37b1afd90117564332f0770033057.tar.gz
trackermap-server-315c359711b37b1afd90117564332f0770033057.tar.bz2
trackermap-server-315c359711b37b1afd90117564332f0770033057.zip
Replace Calendar with DateBuilder
Diffstat (limited to 'src/org/traccar/protocol/TramigoProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/TramigoProtocolDecoder.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java
index be97f24fd..456086fe2 100644
--- a/src/org/traccar/protocol/TramigoProtocolDecoder.java
+++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java
@@ -105,7 +105,6 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
String sentence = buf.toString(Charset.defaultCharset());
- // Coordinates
Pattern pattern = Pattern.compile("(-?\\d+\\.\\d+), (-?\\d+\\.\\d+)");
Matcher matcher = pattern.matcher(sentence);
if (!matcher.find()) {
@@ -114,7 +113,6 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
position.setLatitude(Double.parseDouble(matcher.group(1)));
position.setLongitude(Double.parseDouble(matcher.group(2)));
- // Speed and Course
pattern = Pattern.compile("([NSWE]{1,2}) with speed (\\d+) km/h");
matcher = pattern.matcher(sentence);
if (matcher.find()) {
@@ -122,7 +120,6 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
position.setCourse(0); // matcher.group(1) for course
}
- // Time
pattern = Pattern.compile("(\\d{1,2}:\\d{2} \\w{3} \\d{1,2})");
matcher = pattern.matcher(sentence);
if (!matcher.find()) {
@@ -130,6 +127,7 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder {
}
DateFormat dateFormat = new SimpleDateFormat("HH:mm MMM d yyyy", Locale.ENGLISH);
position.setTime(dateFormat.parse(matcher.group(1) + " " + Calendar.getInstance().get(Calendar.YEAR)));
+
return position;
}