Commit 4b522d9e authored by p x's avatar p x
Browse files

解决tbox 经度 -纬度 高程 航向角 车速解析问题

parent ffaea1e9
...@@ -9,7 +9,15 @@ public class PositionDto { ...@@ -9,7 +9,15 @@ public class PositionDto {
//纬度 //纬度
@Order(2) @Order(2)
private double latitude; private double latitude;
//高程 //高程 单位米
@Order(3) @Order(3)
private double elevation; private double elevation;
public double getLongitude() {
return longitude;
}
public double getLatitude() {
return latitude;
}
} }
...@@ -119,4 +119,8 @@ public class VehicleInfoDto { ...@@ -119,4 +119,8 @@ public class VehicleInfoDto {
public double getHeading() { public double getHeading() {
return heading; return heading;
} }
public PositionDto getPosition() {
return position;
}
} }
...@@ -407,10 +407,10 @@ public class Parse { ...@@ -407,10 +407,10 @@ public class Parse {
if(len<minValidLength) { if(len<minValidLength) {
int subtract = minValidLength-len; int subtract = minValidLength-len;
double f =(Long)o*Math.pow(10, subtract)*offset; double f =(Long)o*Math.pow(10, subtract)*offset;
tField.set(target, (float)f); tField.set(target, (double)f);
}else { }else {
double f =(Long)o*offset; double f =(Long)o*offset;
tField.set(target, (float)f); tField.set(target, (double)f);
} }
}else { }else {
double d =(Long)o*offset; double d =(Long)o*offset;
......
...@@ -20,9 +20,9 @@ public class SM4Utils { ...@@ -20,9 +20,9 @@ public class SM4Utils {
} }
/** /**
* 生成 SM4 密钥 * 生成 SM4 密钥
* @return 钥的 Base64 编码字符串 * @return 密钥的 Base64 编码字符串
* @throws Exception * @throws Exception 异常
*/ */
public static String generateKey() throws Exception { public static String generateKey() throws Exception {
KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, "BC"); KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, "BC");
...@@ -32,11 +32,11 @@ public class SM4Utils { ...@@ -32,11 +32,11 @@ public class SM4Utils {
} }
/** /**
* SM4 加密 * SM4 加密
* @param plainText 明文 * @param plainText 明文
* @param key 钥的 Base64 编码字符串 * @param key 密钥的 Base64 编码字符串
* @return 文的 Base64 编码字符串 * @return 密文的 Base64 编码字符串
* @throws Exception * @throws Exception 异常
*/ */
public static String encrypt(String plainText, String key) throws Exception { public static String encrypt(String plainText, String key) throws Exception {
byte[] keyBytes = Base64.getDecoder().decode(key); byte[] keyBytes = Base64.getDecoder().decode(key);
...@@ -48,11 +48,11 @@ public class SM4Utils { ...@@ -48,11 +48,11 @@ public class SM4Utils {
} }
/** /**
* SM4 解密 * SM4 解密
* @param cipherText 文的 Base64 编码字符串 * @param cipherText 密文的 Base64 编码字符串
* @param key 钥的 Base64 编码字符串 * @param key 密钥的 Base64 编码字符串
* @return 明文 * @return 明文
* @throws Exception * @throws Exception 异常
*/ */
public static String decrypt(String cipherText, String key) throws Exception { public static String decrypt(String cipherText, String key) throws Exception {
byte[] keyBytes = Base64.getDecoder().decode(key); byte[] keyBytes = Base64.getDecoder().decode(key);
......
...@@ -10,9 +10,9 @@ public class Position { ...@@ -10,9 +10,9 @@ public class Position {
private long longitude; private long longitude;
//纬度 //纬度
@Order(2) @Order(2)
@OffsetDef(value=0.0000001,minValidLength=9) @OffsetDef(value=0.00000001,minValidLength=10)
private long latitude; private long latitude;
//高程 //高程 单位分米
@Order(3) @Order(3)
@OffsetDef(value=0.1) @OffsetDef(value=0.1)
private long elevation; private long elevation;
......
...@@ -10,6 +10,6 @@ public class Position2D { ...@@ -10,6 +10,6 @@ public class Position2D {
private long longitude; private long longitude;
//纬度 //纬度
@Order(2) @Order(2)
@OffsetDef(value=0.0000001,minValidLength=9) @OffsetDef(value=0.00000001,minValidLength=10)
private long latitude; private long latitude;
} }
...@@ -36,7 +36,7 @@ public class VehicleInfo { ...@@ -36,7 +36,7 @@ public class VehicleInfo {
/****[0..3600000],正北方向顺时针旋转至与车辆当前运动方向重合所转 过的角度,单位为 1e-4 ° , 不可缺省,0xFFFFFFFF 表示异常**/ /****[0..3600000],正北方向顺时针旋转至与车辆当前运动方向重合所转 过的角度,单位为 1e-4 ° , 不可缺省,0xFFFFFFFF 表示异常**/
@Order(6) @Order(6)
@OffsetDef(value = 0.0001) @OffsetDef(value=0.0001,minValidLength=7)
private long heading; private long heading;
/** /**
...@@ -105,7 +105,7 @@ public class VehicleInfo { ...@@ -105,7 +105,7 @@ public class VehicleInfo {
@Order(21) @Order(21)
private short driveMode; private short driveMode;
//目的地位置 //车辆当前驾驶任务的终点位置
@Order(22) @Order(22)
private Position2D destLocation; private Position2D destLocation;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment