|
@@ -178,48 +178,48 @@ public class UdpDataUtils {
|
|
|
platformAircraft.setAltitude(h);
|
|
|
|
|
|
byte[] azimuthAngleByte = BitUtils.copyFrom(data, 10, 2);
|
|
|
- short azimuthAngle = BitUtils.toShort(azimuthAngleByte);
|
|
|
+ double azimuthAngle = BitUtils.toShort(azimuthAngleByte) * 0.01 ;
|
|
|
platformAircraft.setAzimuthAngle(azimuthAngle);
|
|
|
|
|
|
byte[] pitchAngleByte = BitUtils.copyFrom(data, 12, 2);
|
|
|
- short pitchAngle = BitUtils.toShort(pitchAngleByte);
|
|
|
+ double pitchAngle = BitUtils.toShort(pitchAngleByte) * 0.01;
|
|
|
platformAircraft.setPitchAngle(pitchAngle);
|
|
|
|
|
|
byte[] rollAngleByte = BitUtils.copyFrom(data, 14, 2);
|
|
|
- short rollAngle = BitUtils.toShort(rollAngleByte);
|
|
|
+ double rollAngle = BitUtils.toShort(rollAngleByte) * 0.01;
|
|
|
platformAircraft.setRollAngle(rollAngle);
|
|
|
|
|
|
byte[] eastSpeedByte = BitUtils.copyFrom(data, 16, 2);
|
|
|
- short eastSpeed = BitUtils.toShort(eastSpeedByte);
|
|
|
+ double eastSpeed = BitUtils.toShort(eastSpeedByte) * 0.1;
|
|
|
platformAircraft.setEastSpeed(eastSpeed);
|
|
|
|
|
|
byte[] northSpeedByte = BitUtils.copyFrom(data, 18, 2);
|
|
|
- short northSpeed = BitUtils.toShort(northSpeedByte);
|
|
|
+ double northSpeed = BitUtils.toShort(northSpeedByte) * 0.1;
|
|
|
platformAircraft.setNorthSpeed(northSpeed);
|
|
|
|
|
|
byte[] skySpeedByte = BitUtils.copyFrom(data, 20, 2);
|
|
|
- short skySpeed = BitUtils.toShort(skySpeedByte);
|
|
|
+ double skySpeed = BitUtils.toShort(skySpeedByte) * 0.1;
|
|
|
platformAircraft.setSkySpeed(skySpeed);
|
|
|
|
|
|
byte[] trackAngleByte = BitUtils.copyFrom(data, 22, 2);
|
|
|
- short trackAngle = BitUtils.toShort(trackAngleByte);
|
|
|
+ short trackAngle = BitUtils.toShort(trackAngleByte) ;
|
|
|
platformAircraft.setTrackAngle(trackAngle);
|
|
|
|
|
|
- byte[] yearByte = BitUtils.copyFrom(data, 24, 2);
|
|
|
- short year = BitUtils.toShort(yearByte);
|
|
|
- byte[] monthByte = BitUtils.copyFrom(data, 26, 1);
|
|
|
- int month = BitUtils.toInt(monthByte);
|
|
|
- byte[] dayByte = BitUtils.copyFrom(data, 27, 1);
|
|
|
- int day = BitUtils.toInt(dayByte);
|
|
|
- byte[] hourByte = BitUtils.copyFrom(data, 28, 1);
|
|
|
- int hour = BitUtils.toInt(hourByte);
|
|
|
- byte[] minByte = BitUtils.copyFrom(data, 29, 1);
|
|
|
- int min = BitUtils.toInt(minByte);
|
|
|
- byte[] secondByte = BitUtils.copyFrom(data, 30, 1);
|
|
|
- int second = BitUtils.toInt(secondByte);
|
|
|
- byte[] millisecondByte = BitUtils.copyFrom(data, 31, 1);
|
|
|
- int millisecond = BitUtils.toInt(millisecondByte);
|
|
|
- platformAircraft.setUtcTime(String.format("%04d/%02d/%02d %02d:%02d:%02d %03d", year, month, day, hour, min, second, millisecond));
|
|
|
+// byte[] yearByte = BitUtils.copyFrom(data, 24, 2);
|
|
|
+// short year = BitUtils.toShort(yearByte);
|
|
|
+// byte[] monthByte = BitUtils.copyFrom(data, 26, 1);
|
|
|
+// int month = BitUtils.toInt(monthByte);
|
|
|
+// byte[] dayByte = BitUtils.copyFrom(data, 27, 1);
|
|
|
+// int day = BitUtils.toInt(dayByte);
|
|
|
+// byte[] hourByte = BitUtils.copyFrom(data, 28, 1);
|
|
|
+// int hour = BitUtils.toInt(hourByte);
|
|
|
+// byte[] minByte = BitUtils.copyFrom(data, 29, 1);
|
|
|
+// int min = BitUtils.toInt(minByte);
|
|
|
+// byte[] secondByte = BitUtils.copyFrom(data, 30, 1);
|
|
|
+// int second = BitUtils.toInt(secondByte);
|
|
|
+// byte[] millisecondByte = BitUtils.copyFrom(data, 31, 1);
|
|
|
+// int millisecond = BitUtils.toInt(millisecondByte);
|
|
|
+// platformAircraft.setUtcTime(String.format("%04d/%02d/%02d %02d:%02d:%02d %03d", year, month, day, hour, min, second, millisecond));
|
|
|
return platformAircraft;
|
|
|
}
|
|
|
|
|
@@ -316,11 +316,6 @@ public class UdpDataUtils {
|
|
|
double tv = BitUtils.toShort(tvByte) * 0.1;
|
|
|
af.setVelocityZ(doubleToFloat(tv));
|
|
|
af.setSkySpeed(tv);
|
|
|
- //System.out.println(tv);
|
|
|
- //System.out.println(id + " " + x + " " + y + " " + h + " " + dv + " " + bv + " " + tv + " ");
|
|
|
- if(id == 1){
|
|
|
- System.out.println(id + " = " + ix + "," + iy + " " + " | " + af.getCoordinateX() + "," + af.getCoordinateY());
|
|
|
- }
|
|
|
return af;
|
|
|
}
|
|
|
|