增加了注释讲解
更新了衡阳测试数据
This commit is contained in:
@@ -11,7 +11,21 @@ public
|
||||
* @author congtaowang
|
||||
* @since 2021/3/26
|
||||
*
|
||||
* 描述
|
||||
* 生成测试数据,执行指令
|
||||
* java LocParse.java
|
||||
*
|
||||
* loc.txt
|
||||
* adas0.txt
|
||||
* adas1.txt
|
||||
* adas2.txt
|
||||
* adas3.txt
|
||||
* adas4.txt
|
||||
* adas5.txt
|
||||
* adas6.txt
|
||||
* adas7.txt
|
||||
* adas8.txt
|
||||
* adas9.txt
|
||||
*
|
||||
*/
|
||||
class LocParse {
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -626,6 +626,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
private BufferedReader roadSizeBr;
|
||||
private JSONObject locJo = null;
|
||||
|
||||
/**
|
||||
* 处理模拟单Loc数据意图
|
||||
*/
|
||||
private void handleMockSingleLocDataIntent() throws Exception {
|
||||
if (locJo == null) {
|
||||
String locLine = "{\"systemTime\":1615529718585,\"satelliteTime\":1615529718585,\"lon\":116.73573385415098,\"lat\":40.19907712731953,\"alt\":34.4018669128417,\"heading\":0.342695406938048,\"speed\":0.003303937}";
|
||||
@@ -637,6 +640,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(100, 50L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理路侧模拟数据意图
|
||||
*/
|
||||
private void handleRoadSideMockDataIntent() throws Exception {
|
||||
if (roadSizeBr == null) {
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt")));
|
||||
@@ -680,6 +686,7 @@ public class MockIntentHandler implements IntentHandler {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
// 模拟处理当前车辆位置
|
||||
if (msg.what == 1) {
|
||||
try {
|
||||
if (!handleMockLocationIntent()) {
|
||||
@@ -694,7 +701,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
br = null;
|
||||
}
|
||||
} else if (msg.what == 21) {
|
||||
}
|
||||
// 模拟远端数据
|
||||
else if (msg.what == 21) {
|
||||
try {
|
||||
handleMockSnapshotIntent2();
|
||||
} catch (Exception e) {
|
||||
@@ -705,7 +714,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
|
||||
}
|
||||
} else if (msg.what == 3) {
|
||||
}
|
||||
// 模拟ADAS数据
|
||||
else if (msg.what == 3) {
|
||||
try {
|
||||
handleMockAdasIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -720,13 +731,17 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
readers = null;
|
||||
}
|
||||
} else if (msg.what == 100) {
|
||||
}
|
||||
// 模拟单个车数据
|
||||
else if (msg.what == 100) {
|
||||
try {
|
||||
handleMockSingleLocDataIntent();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (msg.what == 101) {
|
||||
}
|
||||
// 处理路侧模拟数据意图
|
||||
else if (msg.what == 101) {
|
||||
try {
|
||||
handleRoadSideMockDataIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -737,7 +752,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
roadSizeBr = null;
|
||||
}
|
||||
} else if (msg.what == 8) {
|
||||
}
|
||||
// 处理模拟Adas汽车意图
|
||||
else if (msg.what == 8) {
|
||||
try {
|
||||
handleMockAdasCarIntent();
|
||||
} catch (Exception e) {
|
||||
@@ -788,10 +805,12 @@ public class MockIntentHandler implements IntentHandler {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
mLocDelay += 50;
|
||||
// 这里处理自车移动,延时4秒
|
||||
if (mLocDelay > 4_000L) {
|
||||
mLocationMockHandler1.sendEmptyMessageDelayed(1, 0L);
|
||||
}
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(3, 0L);
|
||||
// 延时50毫秒重复发送自己
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(0, 50L);
|
||||
}
|
||||
};
|
||||
@@ -811,6 +830,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
|
||||
private BufferedReader br;
|
||||
|
||||
/**
|
||||
* 处理模拟位置意图
|
||||
*/
|
||||
private boolean handleMockLocationIntent() throws Exception {
|
||||
if (br == null) {
|
||||
br = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("loc.txt")));
|
||||
@@ -832,6 +854,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
|
||||
private BufferedReader br4;
|
||||
|
||||
/**
|
||||
* 模拟快照意图
|
||||
*/
|
||||
private boolean handleMockSnapshotIntent2() throws Exception {
|
||||
if (br4 == null) {
|
||||
br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt")));
|
||||
@@ -862,6 +887,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
private BufferedReader[] readers = null;
|
||||
private BufferedReader[] readers2 = null;
|
||||
|
||||
/**
|
||||
* 处理模拟ADAS数据意图
|
||||
*/
|
||||
private boolean handleMockAdasIntent() throws Exception {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
@@ -889,6 +917,9 @@ public class MockIntentHandler implements IntentHandler {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理模拟Adas汽车意图
|
||||
*/
|
||||
private boolean handleMockAdasCarIntent() throws Exception {
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user