diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-29 13:41:15 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-29 13:41:15 +1200 |
commit | f7198adaf371e08a72a837d417b29531c117c6ba (patch) | |
tree | 853fb51b64cd00aaa6e53d4e510bbf69859e7765 /src/org/traccar/protocol/GlobalSatProtocolDecoder.java | |
parent | cb0a3831c2d89a22e9f3b68d3ee17f6e2abdd424 (diff) | |
download | trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.gz trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.tar.bz2 trackermap-server-f7198adaf371e08a72a837d417b29531c117c6ba.zip |
Store other data in position
Diffstat (limited to 'src/org/traccar/protocol/GlobalSatProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 1a0132c4a..05521c476 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -26,9 +26,6 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.Context; -import org.traccar.database.DataManager; -import org.traccar.helper.Log; -import org.traccar.model.ExtendedInfoFormatter; import org.traccar.model.Position; public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { @@ -92,7 +89,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { // Parse data Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); + position.setProtocol(getProtocol()); for (int formatIndex = 0, valueIndex = 1; formatIndex < format.length() && valueIndex < values.length; formatIndex++) { String value = values[valueIndex]; @@ -170,7 +167,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { position.setCourse(Double.valueOf(value)); break; case 'N': - extendedInfo.set("battery", value); + position.set("battery", value); break; default: // Unsupported @@ -179,8 +176,6 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { valueIndex += 1; } - - position.setExtendedInfo(extendedInfo.toString()); return position; } @@ -211,7 +206,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { // Create new position Position position = new Position(); - ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); + position.setProtocol(getProtocol()); Integer index = 1; // Identification @@ -258,12 +253,10 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { position.setCourse(Double.valueOf(parser.group(index++))); // Satellites - extendedInfo.set("satellites", Integer.valueOf(parser.group(index++))); + position.set("satellites", Integer.valueOf(parser.group(index++))); // HDOP - extendedInfo.set("hdop", parser.group(index++)); - - position.setExtendedInfo(extendedInfo.toString()); + position.set("hdop", parser.group(index++)); return position; } |