aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/T55ProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-11-09 19:01:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-11-09 19:01:19 +1300
commitcf0565caceee6856328e481dd23600ed2590c88a (patch)
tree9d2cc8cf8d3eb27b36412eb492ad702581891f1c /src/org/traccar/protocol/T55ProtocolDecoder.java
parentf9ecee5b732b0c82c8a95bebdb5e275ea479cccc (diff)
downloadtrackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.tar.gz
trackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.tar.bz2
trackermap-server-cf0565caceee6856328e481dd23600ed2590c88a.zip
Improve unit test verification
Diffstat (limited to 'src/org/traccar/protocol/T55ProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/T55ProtocolDecoder.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java
index 05a6ad4ae..246036313 100644
--- a/src/org/traccar/protocol/T55ProtocolDecoder.java
+++ b/src/org/traccar/protocol/T55ProtocolDecoder.java
@@ -35,7 +35,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
super(serverManager);
}
- static private Pattern patternGPRMC = Pattern.compile(
+ private static final Pattern patternGPRMC = Pattern.compile(
"\\$GPRMC," +
"(\\d{2})(\\d{2})(\\d{2})\\.?\\d*," + // Time (HHMMSS.SSS)
"([AV])," + // Validity
@@ -48,7 +48,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
"(\\d{2})(\\d{2})(\\d{2})" + // Date (DDMMYY)
".+");
- static private Pattern patternGPGGA = Pattern.compile(
+ private static final Pattern patternGPGGA = Pattern.compile(
"\\$GPGGA," +
"(\\d{2})(\\d{2})(\\d{2})\\.?\\d*," + // Time
"(\\d{2})(\\d{2}\\.\\d+)," + // Latitude
@@ -57,7 +57,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
"([EW])," +
".+");
- static private Pattern patternGPRMA = Pattern.compile(
+ private static final Pattern patternGPRMA = Pattern.compile(
"\\$GPRMA," +
"([AV])," + // Validity
"(\\d{2})(\\d{2}\\.\\d+)," + // Latitude
@@ -124,7 +124,7 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++)));
// Validity
- position.setValid(parser.group(index++).compareTo("A") == 0 ? true : false);
+ position.setValid(parser.group(index++).compareTo("A") == 0);
// Latitude
Double latitude = Double.valueOf(parser.group(index++));
@@ -205,6 +205,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder {
longitude += Double.valueOf(parser.group(index++)) / 60;
if (parser.group(index++).compareTo("W") == 0) longitude = -longitude;
position.setLongitude(longitude);
+
+ // Speed
+ position.setSpeed(0.0);
+
+ // Course
+ position.setCourse(0.0);
// Altitude
position.setAltitude(0.0);