diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:12:41 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-04-27 12:12:41 +1200 |
commit | 42406b4d6a32db0d438447a5fce114669810d746 (patch) | |
tree | b9a95ec3ce512ea195318c472f1f2320c73275e8 /src/org/traccar/protocol | |
parent | c727f09de176f569e67550964c65a63d4dcdea6b (diff) | |
download | trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.tar.gz trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.tar.bz2 trackermap-server-42406b4d6a32db0d438447a5fce114669810d746.zip |
Remove unnecessary default values
Diffstat (limited to 'src/org/traccar/protocol')
61 files changed, 10 insertions, 263 deletions
diff --git a/src/org/traccar/protocol/AplicomProtocolDecoder.java b/src/org/traccar/protocol/AplicomProtocolDecoder.java index 0d90ec771..2092fee3d 100644 --- a/src/org/traccar/protocol/AplicomProtocolDecoder.java +++ b/src/org/traccar/protocol/AplicomProtocolDecoder.java @@ -162,9 +162,6 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { position.setSpeed(buf.readUnsignedByte() * 0.539957); buf.readUnsignedByte(); // maximum speed position.setCourse(buf.readUnsignedByte() * 2.0); - } else { - position.setSpeed(0.0); - position.setCourse(0.0); } // Input @@ -226,8 +223,6 @@ public class AplicomProtocolDecoder extends BaseProtocolDecoder { // Altitude if ((selector & 0x0800) != 0) { position.setAltitude((double) buf.readShort()); - } else { - position.setAltitude(0.0); } position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/AtrackProtocolDecoder.java b/src/org/traccar/protocol/AtrackProtocolDecoder.java index e2f3e924f..0c6aa566d 100644 --- a/src/org/traccar/protocol/AtrackProtocolDecoder.java +++ b/src/org/traccar/protocol/AtrackProtocolDecoder.java @@ -117,7 +117,6 @@ public class AtrackProtocolDecoder extends BaseProtocolDecoder { position.setValid(true); position.setLongitude(buf.readInt() * 0.000001); position.setLatitude(buf.readInt() * 0.000001); - position.setAltitude(0.0); // Course position.setCourse((double) buf.readUnsignedShort()); diff --git a/src/org/traccar/protocol/AutoFon45ProtocolDecoder.java b/src/org/traccar/protocol/AutoFon45ProtocolDecoder.java index c72139c50..c2b675194 100644 --- a/src/org/traccar/protocol/AutoFon45ProtocolDecoder.java +++ b/src/org/traccar/protocol/AutoFon45ProtocolDecoder.java @@ -110,7 +110,6 @@ public class AutoFon45ProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(convertCoordinate(buf.readUnsignedByte(), buf.readUnsignedByte() << 16 | buf.readUnsignedByte() << 8 | buf.readUnsignedByte())); position.setSpeed((double) buf.readUnsignedByte()); position.setCourse((double) (buf.readUnsignedByte() << 8 | buf.readUnsignedByte())); - position.setAltitude(0.0); buf.readUnsignedByte(); // checksum diff --git a/src/org/traccar/protocol/Avl301ProtocolDecoder.java b/src/org/traccar/protocol/Avl301ProtocolDecoder.java index 4bc7686e7..2281bfed0 100644 --- a/src/org/traccar/protocol/Avl301ProtocolDecoder.java +++ b/src/org/traccar/protocol/Avl301ProtocolDecoder.java @@ -120,7 +120,6 @@ public class Avl301ProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); if ((union & 0x4000) != 0) { extendedInfo.set("acc", (union & 0x8000) != 0); diff --git a/src/org/traccar/protocol/BoxProtocolDecoder.java b/src/org/traccar/protocol/BoxProtocolDecoder.java index d2de48489..804ce059c 100644 --- a/src/org/traccar/protocol/BoxProtocolDecoder.java +++ b/src/org/traccar/protocol/BoxProtocolDecoder.java @@ -95,7 +95,6 @@ public class BoxProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(Double.valueOf(parser.group(index++))); position.setSpeed(Double.valueOf(parser.group(index++))); position.setCourse(Double.valueOf(parser.group(index++))); - position.setAltitude(0.0); // Distance extendedInfo.set("milage", parser.group(index++)); diff --git a/src/org/traccar/protocol/CalAmpProtocolDecoder.java b/src/org/traccar/protocol/CalAmpProtocolDecoder.java index 04ac8f165..f24ae01c0 100644 --- a/src/org/traccar/protocol/CalAmpProtocolDecoder.java +++ b/src/org/traccar/protocol/CalAmpProtocolDecoder.java @@ -176,7 +176,6 @@ public class CalAmpProtocolDecoder extends BaseProtocolDecoder { } position.setCourse((double) buf.readShort()); if (type == MSG_MINI_EVENT_REPORT) { - position.setAltitude(0.0); position.setSpeed(buf.readUnsignedByte() * 0.539957); // km/h } diff --git a/src/org/traccar/protocol/CarTrackProtocolDecoder.java b/src/org/traccar/protocol/CarTrackProtocolDecoder.java index 425115fe9..b4e5bf134 100644 --- a/src/org/traccar/protocol/CarTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/CarTrackProtocolDecoder.java @@ -112,16 +112,12 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -129,9 +125,6 @@ public class CarTrackProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - - // Altitude - position.setAltitude(0.0); // State extendedInfo.set("io", parser.group(index++)); diff --git a/src/org/traccar/protocol/CarscopProtocolDecoder.java b/src/org/traccar/protocol/CarscopProtocolDecoder.java index e7c4d6192..2b6d70519 100644 --- a/src/org/traccar/protocol/CarscopProtocolDecoder.java +++ b/src/org/traccar/protocol/CarscopProtocolDecoder.java @@ -101,9 +101,6 @@ public class CarscopProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java index c32ac2228..2402cbdb7 100644 --- a/src/org/traccar/protocol/EasyTrackProtocolDecoder.java +++ b/src/org/traccar/protocol/EasyTrackProtocolDecoder.java @@ -134,8 +134,6 @@ public class EasyTrackProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java index 929153033..b18dd3970 100644 --- a/src/org/traccar/protocol/EelinkProtocolDecoder.java +++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java @@ -111,7 +111,6 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(buf.readInt() / 1800000.0); position.setSpeed(buf.readUnsignedByte() * 0.539957); position.setCourse((double) buf.readUnsignedShort()); - position.setAltitude(0.0); // Cell extendedInfo.set("cell", ChannelBufferTools.readHexString(buf, 18)); @@ -186,7 +185,6 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); position.setExtendedInfo(extendedInfo.toString()); return position; diff --git a/src/org/traccar/protocol/EnforaProtocolDecoder.java b/src/org/traccar/protocol/EnforaProtocolDecoder.java index 430693189..9fd20300f 100644 --- a/src/org/traccar/protocol/EnforaProtocolDecoder.java +++ b/src/org/traccar/protocol/EnforaProtocolDecoder.java @@ -129,9 +129,6 @@ public class EnforaProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); @@ -139,8 +136,6 @@ public class EnforaProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date diff --git a/src/org/traccar/protocol/Ev603ProtocolDecoder.java b/src/org/traccar/protocol/Ev603ProtocolDecoder.java index acf359daf..ffec5926b 100644 --- a/src/org/traccar/protocol/Ev603ProtocolDecoder.java +++ b/src/org/traccar/protocol/Ev603ProtocolDecoder.java @@ -92,16 +92,13 @@ public class Ev603ProtocolDecoder extends BaseProtocolDecoder{ position.setLatitude(Double.valueOf(parser.group(index++)));
position.setLongitude(Double.valueOf(parser.group(index++)));
- // Altitude
- position.setAltitude(0.0);
-
// Speed
position.setSpeed(Double.valueOf(parser.group(index++)));
// Course
position.setCourse(Double.valueOf(parser.group(index++)));
if (position.getCourse() > 360) {
- position.setCourse(0.0);
+ position.setCourse(0);
}
position.setExtendedInfo(extendedInfo.toString());
diff --git a/src/org/traccar/protocol/FreedomProtocolDecoder.java b/src/org/traccar/protocol/FreedomProtocolDecoder.java index f8ab610b1..9323340a9 100644 --- a/src/org/traccar/protocol/FreedomProtocolDecoder.java +++ b/src/org/traccar/protocol/FreedomProtocolDecoder.java @@ -95,16 +95,10 @@ public class FreedomProtocolDecoder extends BaseProtocolDecoder { longitude += Double.valueOf(parser.group(index++)) / 60; if (hemisphere.compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - - // Altitude - position.setAltitude(0.0); // Speed position.setSpeed(Double.valueOf(parser.group(index++))); - // Course - position.setCourse(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/GatorProtocolDecoder.java b/src/org/traccar/protocol/GatorProtocolDecoder.java index 33b8c501c..42dbb8cc9 100644 --- a/src/org/traccar/protocol/GatorProtocolDecoder.java +++ b/src/org/traccar/protocol/GatorProtocolDecoder.java @@ -96,7 +96,6 @@ public class GatorProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(ChannelBufferTools.readCoordinate(buf)); position.setSpeed(ChannelBufferTools.readHexInteger(buf, 4) * 0.539957); position.setCourse((double) ChannelBufferTools.readHexInteger(buf, 4)); - position.setAltitude(0.0); // Flags int flags = buf.readUnsignedByte(); diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 969be7611..7137ff975 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -90,24 +90,18 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (speed != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Altitude String altitude = parser.group(index++); if (speed != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Coordinates diff --git a/src/org/traccar/protocol/GotopProtocolDecoder.java b/src/org/traccar/protocol/GotopProtocolDecoder.java index 80196c04a..587b9180a 100644 --- a/src/org/traccar/protocol/GotopProtocolDecoder.java +++ b/src/org/traccar/protocol/GotopProtocolDecoder.java @@ -95,9 +95,6 @@ public class GotopProtocolDecoder extends BaseProtocolDecoder { Double longitude = Double.valueOf(parser.group(index++)); if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - - // Altitude - position.setAltitude(0.0); // Speed position.setSpeed(Double.valueOf(parser.group(index++)) * 0.539957); @@ -109,8 +106,6 @@ public class GotopProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java index b99507ffb..f14f80239 100644 --- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java @@ -178,24 +178,18 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Altitude String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Additional data diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java index cb26d3a61..6b19fbe0a 100644 --- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java +++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java @@ -134,16 +134,12 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -152,9 +148,6 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/Gt02ProtocolDecoder.java b/src/org/traccar/protocol/Gt02ProtocolDecoder.java index bab03d13f..857330e23 100644 --- a/src/org/traccar/protocol/Gt02ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt02ProtocolDecoder.java @@ -122,7 +122,6 @@ public class Gt02ProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); position.setExtendedInfo(extendedInfo.toString()); return position; diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java index 5196634e8..f3795a8dd 100644 --- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java @@ -181,7 +181,6 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); if ((union & 0x4000) != 0) { extendedInfo.set("acc", (union & 0x8000) != 0); diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index 51d1ed8d0..2cf5c0f16 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -93,7 +93,6 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { if ((flags & 0x08) == 0) longitude = -longitude; position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); // Speed and course position.setSpeed((double) ChannelBufferTools.readHexInteger(buf, 3)); @@ -164,9 +163,6 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { longitude += Double.valueOf(parser.group(index++)) / 60; if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - - // Altitude - position.setAltitude(0.0); // Speed position.setSpeed(Double.valueOf(parser.group(index++))); @@ -175,8 +171,6 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date diff --git a/src/org/traccar/protocol/HaicomProtocolDecoder.java b/src/org/traccar/protocol/HaicomProtocolDecoder.java index ae070fd84..fe33d44df 100644 --- a/src/org/traccar/protocol/HaicomProtocolDecoder.java +++ b/src/org/traccar/protocol/HaicomProtocolDecoder.java @@ -115,9 +115,6 @@ public class HaicomProtocolDecoder extends BaseProtocolDecoder { // Course position.setCourse(Double.valueOf(parser.group(index++)) / 10); - - // Altitude - position.setAltitude(0.0); // Additional data extendedInfo.set("status", parser.group(index++)); diff --git a/src/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/org/traccar/protocol/Jt600ProtocolDecoder.java index 80c584d21..a1eb67993 100644 --- a/src/org/traccar/protocol/Jt600ProtocolDecoder.java +++ b/src/org/traccar/protocol/Jt600ProtocolDecoder.java @@ -112,8 +112,6 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { } else if (version == 2) { - position.setAltitude(0.0); - int fuel = buf.readUnsignedByte() << 8; extendedInfo.set("status", buf.readUnsignedInt()); @@ -200,9 +198,6 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder { // Course position.setCourse(Double.valueOf(parser.group(index++))); - - // Altitude - position.setAltitude(0.0); // Power extendedInfo.set("power", Double.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index ed974d8ca..74a68e34f 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -100,7 +100,6 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(ChannelBufferTools.readCoordinate(buf)); position.setSpeed(ChannelBufferTools.readHexInteger(buf, 4) * 0.539957); position.setCourse((double) ChannelBufferTools.readHexInteger(buf, 4)); - position.setAltitude(0.0); // Flags int flags = buf.readUnsignedByte(); diff --git a/src/org/traccar/protocol/LaipacProtocolDecoder.java b/src/org/traccar/protocol/LaipacProtocolDecoder.java index b868887ec..95c38ae97 100644 --- a/src/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/org/traccar/protocol/LaipacProtocolDecoder.java @@ -118,9 +118,6 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - // Response String type = parser.group(index++); String checksum = parser.group(index++); diff --git a/src/org/traccar/protocol/M2mProtocolDecoder.java b/src/org/traccar/protocol/M2mProtocolDecoder.java index 0daa07422..d67e78003 100644 --- a/src/org/traccar/protocol/M2mProtocolDecoder.java +++ b/src/org/traccar/protocol/M2mProtocolDecoder.java @@ -114,8 +114,6 @@ public class M2mProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(latitude); position.setLongitude(longitude); position.setSpeed((double) buf.readUnsignedByte()); - position.setCourse(0.0); - position.setAltitude(0.0); // Satellites int satellites = buf.readUnsignedByte(); diff --git a/src/org/traccar/protocol/ManPowerProtocolDecoder.java b/src/org/traccar/protocol/ManPowerProtocolDecoder.java index dea190715..5e62c1cc9 100644 --- a/src/org/traccar/protocol/ManPowerProtocolDecoder.java +++ b/src/org/traccar/protocol/ManPowerProtocolDecoder.java @@ -106,15 +106,9 @@ public class ManPowerProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); - // Course - position.setCourse(0.0); - // Extended info position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/MaxonProtocolDecoder.java b/src/org/traccar/protocol/MaxonProtocolDecoder.java index cd86e5e65..39a841a1f 100644 --- a/src/org/traccar/protocol/MaxonProtocolDecoder.java +++ b/src/org/traccar/protocol/MaxonProtocolDecoder.java @@ -107,16 +107,12 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -125,9 +121,6 @@ public class MaxonProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - } else if (sentence.contains("$GPFID") && position != null) { Matcher parser = gpfidPattern.matcher(sentence); diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java index 4a621245a..f67a89726 100644 --- a/src/org/traccar/protocol/MegastekProtocolDecoder.java +++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java @@ -113,16 +113,12 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -213,8 +209,6 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Battery @@ -240,9 +234,6 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder { int index = 1; - // Altitude - position.setAltitude(0.0); - if (!identify(id)) { return null; } diff --git a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java index 547821c69..648901678 100644 --- a/src/org/traccar/protocol/MeiligaoProtocolDecoder.java +++ b/src/org/traccar/protocol/MeiligaoProtocolDecoder.java @@ -225,16 +225,12 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -250,8 +246,6 @@ public class MeiligaoProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // State diff --git a/src/org/traccar/protocol/MtxProtocolDecoder.java b/src/org/traccar/protocol/MtxProtocolDecoder.java index 150e95e3b..713193c49 100644 --- a/src/org/traccar/protocol/MtxProtocolDecoder.java +++ b/src/org/traccar/protocol/MtxProtocolDecoder.java @@ -101,7 +101,6 @@ public class MtxProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(Double.valueOf(parser.group(index++))); position.setSpeed(Double.valueOf(parser.group(index++))); position.setCourse(Double.valueOf(parser.group(index++))); - position.setAltitude(0.0); // Other extendedInfo.set("milage", Double.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index f12e15fb6..9722e98a2 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -167,7 +167,6 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readMedium() * 0.00002); position.setLongitude(buf.readMedium() * 0.00002); - position.setAltitude(0.0); position.setSpeed(buf.readUnsignedByte() * 0.539957); position.setCourse(buf.readUnsignedByte() * 2.0); @@ -191,12 +190,10 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readInt() * 0.0000001); position.setLongitude(buf.readInt() * 0.0000001); - position.setAltitude(0.0); buf.readUnsignedByte(); // report trigger position.setSpeed(buf.readUnsignedByte() * 0.539957); - position.setCourse(0.0); short flags = buf.readUnsignedByte(); position.setValid((flags & 0x80) == 0x80 && (flags & 0x40) == 0x40); @@ -266,7 +263,6 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readInt() * 0.0000001); position.setLongitude(buf.readInt() * 0.0000001); - position.setAltitude(0.0); position.setSpeed(buf.readUnsignedByte() * 0.539957); position.setCourse(buf.readUnsignedByte() * 2.0); diff --git a/src/org/traccar/protocol/NavisProtocolDecoder.java b/src/org/traccar/protocol/NavisProtocolDecoder.java index 7ac0dccdf..7e3dc9728 100644 --- a/src/org/traccar/protocol/NavisProtocolDecoder.java +++ b/src/org/traccar/protocol/NavisProtocolDecoder.java @@ -83,7 +83,6 @@ public class NavisProtocolDecoder extends BaseProtocolDecoder { ExtendedInfoFormatter extendedInfo = new ExtendedInfoFormatter(getProtocol()); position.setDeviceId(getDeviceId()); - position.setAltitude(0.0); // Format type int format; diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index bc807711d..b212eace9 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -95,7 +95,6 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { position.setCourse((double) buf.readUnsignedShort()); position.setLongitude((double) buf.readFloat()); position.setLatitude((double) buf.readFloat()); - position.setAltitude(0.0); // Time long timeValue = buf.readUnsignedInt(); diff --git a/src/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/org/traccar/protocol/OsmAndProtocolDecoder.java index 85cf1219c..11966e0bd 100644 --- a/src/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -88,33 +88,34 @@ public class OsmAndProtocolDecoder extends BaseProtocolDecoder { // Optional parameters if (params.containsKey("speed")) { position.setSpeed(Double.valueOf(params.get("speed").get(0))); - } else { - position.setSpeed(0.0); } + if (params.containsKey("bearing")) { position.setCourse(Double.valueOf(params.get("bearing").get(0))); } else if (params.containsKey("heading")) { position.setCourse(Double.valueOf(params.get("heading").get(0))); - } else { - position.setCourse(0.0); } + if (params.containsKey("altitude")) { position.setAltitude(Double.valueOf(params.get("altitude").get(0))); - } else { - position.setAltitude(0.0); } + if (params.containsKey("hdop")) { extendedInfo.set("hdop", params.get("hdop").get(0)); } + if (params.containsKey("vacc")) { extendedInfo.set("vacc", params.get("vacc").get(0)); } + if (params.containsKey("hacc")) { extendedInfo.set("hacc", params.get("hacc").get(0)); } + if (params.containsKey("batt")) { extendedInfo.set("battery", params.get("batt").get(0)); } + if (params.containsKey("desc")) { extendedInfo.set("description", params.get("desc").get(0)); } diff --git a/src/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/org/traccar/protocol/PiligrimProtocolDecoder.java index 1c0faef37..0190ec076 100644 --- a/src/org/traccar/protocol/PiligrimProtocolDecoder.java +++ b/src/org/traccar/protocol/PiligrimProtocolDecoder.java @@ -134,7 +134,6 @@ public class PiligrimProtocolDecoder extends BaseProtocolDecoder { if ((flags & 0x02) != 0) longitude = -longitude; position.setLatitude(latitude); position.setLongitude(longitude); - position.setAltitude(0.0); // Satellites int satellites = buf.readUnsignedByte(); diff --git a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java index 513fdbb4b..125afc287 100644 --- a/src/org/traccar/protocol/Pt3000ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt3000ProtocolDecoder.java @@ -101,16 +101,12 @@ public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -119,9 +115,6 @@ public class Pt3000ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/Pt502ProtocolDecoder.java b/src/org/traccar/protocol/Pt502ProtocolDecoder.java index 2cf5ad3d6..702fdfd27 100644 --- a/src/org/traccar/protocol/Pt502ProtocolDecoder.java +++ b/src/org/traccar/protocol/Pt502ProtocolDecoder.java @@ -103,23 +103,16 @@ public class Pt502ProtocolDecoder extends BaseProtocolDecoder { }
position.setLongitude(longitude);
- // Altitude
- position.setAltitude(0.0);
-
// Speed
String speed = parser.group(index++);
if (speed != null) {
position.setSpeed(Double.valueOf(speed));
- } else {
- position.setSpeed(0.0);
}
// Course
String course = parser.group(index++);
if (course != null) {
position.setCourse(Double.valueOf(course));
- } else {
- position.setCourse(0.0);
}
// Date
diff --git a/src/org/traccar/protocol/RitiProtocolDecoder.java b/src/org/traccar/protocol/RitiProtocolDecoder.java index 58e744f1a..fa98398a9 100644 --- a/src/org/traccar/protocol/RitiProtocolDecoder.java +++ b/src/org/traccar/protocol/RitiProtocolDecoder.java @@ -119,16 +119,12 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -137,9 +133,6 @@ public class RitiProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/SanavProtocolDecoder.java b/src/org/traccar/protocol/SanavProtocolDecoder.java index abdb25d2c..c29762075 100644 --- a/src/org/traccar/protocol/SanavProtocolDecoder.java +++ b/src/org/traccar/protocol/SanavProtocolDecoder.java @@ -97,9 +97,6 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); @@ -107,8 +104,6 @@ public class SanavProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index 44cf20118..15bb3ddd4 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -104,9 +104,6 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder { longitude += Double.valueOf(parser.group(index++) + parser.group(index++)) / 600000; if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - - // Altitude - position.setAltitude(0.0); // Speed position.setSpeed(Double.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java index b2bbcf573..4b12c556f 100644 --- a/src/org/traccar/protocol/SuntechProtocolDecoder.java +++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java @@ -103,9 +103,6 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder { // Course position.setCourse(Double.valueOf(parser.group(index++))); - // Altitude - position.setAltitude(0.0); - // Extended info position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/SyrusProtocolDecoder.java b/src/org/traccar/protocol/SyrusProtocolDecoder.java index 5b7440bf9..af2c60a26 100644 --- a/src/org/traccar/protocol/SyrusProtocolDecoder.java +++ b/src/org/traccar/protocol/SyrusProtocolDecoder.java @@ -155,9 +155,6 @@ public class SyrusProtocolDecoder extends BaseProtocolDecoder { String longitude = parser.group(index) + '.' + parser.group(index + 1); index += 2; position.setLongitude(Double.valueOf(longitude)); - - // Altitude - position.setAltitude(0.0); // Speed and Course position.setSpeed(Double.valueOf(parser.group(index++)) * 0.868976); diff --git a/src/org/traccar/protocol/T55ProtocolDecoder.java b/src/org/traccar/protocol/T55ProtocolDecoder.java index ccf56ea41..be9fc80ac 100644 --- a/src/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/org/traccar/protocol/T55ProtocolDecoder.java @@ -171,16 +171,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -189,9 +185,6 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } @@ -234,15 +227,6 @@ 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); position.setExtendedInfo(extendedInfo.toString()); return position; @@ -286,21 +270,14 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/TelikProtocolDecoder.java b/src/org/traccar/protocol/TelikProtocolDecoder.java index 15ad77e6b..de6b1929f 100644 --- a/src/org/traccar/protocol/TelikProtocolDecoder.java +++ b/src/org/traccar/protocol/TelikProtocolDecoder.java @@ -92,7 +92,6 @@ public class TelikProtocolDecoder extends BaseProtocolDecoder { // Location position.setLongitude(Double.valueOf(parser.group(index++)) / 10000); position.setLatitude(Double.valueOf(parser.group(index++)) / 10000); - position.setAltitude(0.0); // Validity position.setValid(parser.group(index++).compareTo("1") != 0); diff --git a/src/org/traccar/protocol/Tk102ProtocolDecoder.java b/src/org/traccar/protocol/Tk102ProtocolDecoder.java index b32b020d1..b6f7e2212 100644 --- a/src/org/traccar/protocol/Tk102ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk102ProtocolDecoder.java @@ -112,18 +112,12 @@ public class Tk102ProtocolDecoder extends BaseProtocolDecoder { // Speed position.setSpeed(Double.valueOf(parser.group(index++))); - // Course - position.setCourse(0.0); - // Date time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index fa589956a..b0186a52b 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -122,9 +122,6 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++)) * 0.539957); diff --git a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java index 01c1ac2aa..f42e92c8f 100644 --- a/src/org/traccar/protocol/Tlt2hProtocolDecoder.java +++ b/src/org/traccar/protocol/Tlt2hProtocolDecoder.java @@ -124,16 +124,12 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -141,9 +137,6 @@ public class Tlt2hProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.MONTH, Integer.valueOf(parser.group(index++)) - 1); time.set(Calendar.YEAR, 2000 + Integer.valueOf(parser.group(index++))); position.setTime(time.getTime()); - - // Altitude - position.setAltitude(0.0); // Status extendedInfo.set("status", status); diff --git a/src/org/traccar/protocol/TopflytechProtocolDecoder.java b/src/org/traccar/protocol/TopflytechProtocolDecoder.java index 20c4e54ad..b00551763 100644 --- a/src/org/traccar/protocol/TopflytechProtocolDecoder.java +++ b/src/org/traccar/protocol/TopflytechProtocolDecoder.java @@ -108,9 +108,6 @@ public class TopflytechProtocolDecoder extends BaseProtocolDecoder { // Course position.setCourse(Double.valueOf(parser.group(index++))); - // Altitude - position.setAltitude(0.0); - position.setExtendedInfo(extendedInfo.toString()); return position; } diff --git a/src/org/traccar/protocol/TotemProtocolDecoder.java b/src/org/traccar/protocol/TotemProtocolDecoder.java index ae8335b78..716e2b49c 100644 --- a/src/org/traccar/protocol/TotemProtocolDecoder.java +++ b/src/org/traccar/protocol/TotemProtocolDecoder.java @@ -210,16 +210,12 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed)); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -234,9 +230,6 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { } position.setTime(time.getTime()); - // Altitude - position.setAltitude(0.0); - // Accuracy extendedInfo.set("hdop", parser.group(index++)); @@ -302,9 +295,6 @@ public class TotemProtocolDecoder extends BaseProtocolDecoder { // Speed position.setSpeed(Double.valueOf(parser.group(index++))); - // Altitude - position.setAltitude(0.0); - // PDOP extendedInfo.set("pdop", parser.group(index++)); diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java index 9bd1ccaaf..085a87771 100644 --- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java @@ -124,9 +124,6 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder { // Course position.setCourse(Double.valueOf(parser.group(index++))); - // Altitude - position.setAltitude(0.0); - // Extended info position.setExtendedInfo(extendedInfo.toString()); diff --git a/src/org/traccar/protocol/Tr900ProtocolDecoder.java b/src/org/traccar/protocol/Tr900ProtocolDecoder.java index f8890f954..e24063218 100644 --- a/src/org/traccar/protocol/Tr900ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tr900ProtocolDecoder.java @@ -109,9 +109,6 @@ public class Tr900ProtocolDecoder extends BaseProtocolDecoder { if (hemisphere.compareTo("S") == 0) latitude = -latitude; position.setLatitude(latitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/TramigoProtocolDecoder.java b/src/org/traccar/protocol/TramigoProtocolDecoder.java index e0bab0483..e6318a3ee 100644 --- a/src/org/traccar/protocol/TramigoProtocolDecoder.java +++ b/src/org/traccar/protocol/TramigoProtocolDecoder.java @@ -82,7 +82,6 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(buf.readUnsignedInt() * 0.0000001); position.setLongitude(buf.readUnsignedInt() * 0.0000001); - position.setAltitude(0.0); buf.readUnsignedShort(); // GSM signal quality buf.readUnsignedShort(); // satellites in fix @@ -121,17 +120,13 @@ public class TramigoProtocolDecoder extends BaseProtocolDecoder { } position.setLatitude(Double.valueOf(matcher.group(1))); position.setLongitude(Double.valueOf(matcher.group(2))); - position.setAltitude(0.0); // Speed and Course pattern = Pattern.compile("([NSWE]{1,2}) with speed (\\d+) km/h"); matcher = pattern.matcher(sentence); if (matcher.find()) { position.setSpeed(Double.valueOf(matcher.group(2)) * 0.539957); - position.setCourse(0.0); // matcher.group(1) for course - } else { - position.setSpeed(0.0); - position.setCourse(0.0); + position.setCourse(0); // matcher.group(1) for course } // Time diff --git a/src/org/traccar/protocol/TytanProtocolDecoder.java b/src/org/traccar/protocol/TytanProtocolDecoder.java index 8df8f6a25..b52e83852 100644 --- a/src/org/traccar/protocol/TytanProtocolDecoder.java +++ b/src/org/traccar/protocol/TytanProtocolDecoder.java @@ -84,9 +84,6 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { lon = lon * 360 / 16777216 - 180; position.setLongitude(lon); - // Altitude - position.setAltitude(0.0); - // Course int course = (buf.readUnsignedByte() >> 5) * 45; course = (course + 180) % 360; @@ -94,9 +91,7 @@ public class TytanProtocolDecoder extends BaseProtocolDecoder { // Speed int speed = buf.readUnsignedByte(); - if (speed >= 250) { - position.setSpeed(0.0); - } else { + if (speed < 250) { position.setSpeed(speed * 0.539957); } diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index 6e85640c0..d507a48e0 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -122,16 +122,11 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { if (parser.group(index++).compareTo("S") == 0) latitude = -latitude; position.setLatitude(latitude); - // Altitude - position.setAltitude(0.0); - // Speed and Course position.setSpeed(Double.valueOf(parser.group(index++))); String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date diff --git a/src/org/traccar/protocol/VisiontekProtocolDecoder.java b/src/org/traccar/protocol/VisiontekProtocolDecoder.java index b61500bd9..47ad5a59b 100644 --- a/src/org/traccar/protocol/VisiontekProtocolDecoder.java +++ b/src/org/traccar/protocol/VisiontekProtocolDecoder.java @@ -119,8 +119,6 @@ public class VisiontekProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Additional data diff --git a/src/org/traccar/protocol/WialonProtocolDecoder.java b/src/org/traccar/protocol/WialonProtocolDecoder.java index 76cf9b924..b01dc24f7 100644 --- a/src/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/org/traccar/protocol/WialonProtocolDecoder.java @@ -111,24 +111,18 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { String speed = parser.group(index++); if (speed != null) { position.setSpeed(Double.valueOf(speed) * 0.539957); - } else { - position.setSpeed(0.0); } // Course String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Altitude String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Satellites diff --git a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java index bfd20c64b..eff4fcdbd 100644 --- a/src/org/traccar/protocol/Xexun2ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xexun2ProtocolDecoder.java @@ -115,8 +115,6 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date @@ -144,8 +142,6 @@ public class Xexun2ProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Power diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java index bf119808d..737a15096 100644 --- a/src/org/traccar/protocol/XexunProtocolDecoder.java +++ b/src/org/traccar/protocol/XexunProtocolDecoder.java @@ -95,9 +95,6 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { } position.setLongitude(longitude); - // Altitude - position.setAltitude(0.0); - // Speed position.setSpeed(Double.valueOf(parser.group(index++))); @@ -105,8 +102,6 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } // Date diff --git a/src/org/traccar/protocol/Xt7ProtocolDecoder.java b/src/org/traccar/protocol/Xt7ProtocolDecoder.java index 1e5396f22..bcc17cfb2 100644 --- a/src/org/traccar/protocol/Xt7ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt7ProtocolDecoder.java @@ -121,12 +121,7 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { String course = parser.group(index++); if (course != null) { position.setCourse(Double.valueOf(course)); - } else { - position.setCourse(0.0); } - - // Altitude - position.setAltitude(0.0); // Date time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index fa17d6f43..babf23d77 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -121,8 +121,6 @@ public class YwtProtocolDecoder extends BaseProtocolDecoder { String altitude = parser.group(index++); if (altitude != null) { position.setAltitude(Double.valueOf(altitude)); - } else { - position.setAltitude(0.0); } // Speed |