Merge remote-tracking branch 'origin/demo/shunyi_vr_map' into demo/shunyi_vr_map
This commit is contained in:
@@ -101,6 +101,9 @@ public class V2XMessageListener_401003 implements IMogoOnMessageListener<V2XPush
|
||||
showTip(alarmMessage.getTts());
|
||||
ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), alarmMessage);
|
||||
break;
|
||||
case "200006"://对向来车
|
||||
showTip(alarmMessage.getTts());
|
||||
break;
|
||||
default:
|
||||
ADASUtils.broadcastToADAS_TTS(V2XServiceManager.getContext(), alarmMessage);
|
||||
break;
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
@@ -195,6 +196,16 @@ public class V2XTestConsoleWindow extends ConstraintLayout {
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
|
||||
});
|
||||
|
||||
btnTriggerReverseVehicleRoutePrediction.setOnClickListener(v -> {
|
||||
V2XMessageEntity<List<V2XSpecialCarRes.V2XMarkerEntity>> v2XMessageEntity =
|
||||
TestOnLineCarUtils.getV2XScenarionVRReverseCarData();
|
||||
|
||||
Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION);
|
||||
intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity);
|
||||
LocalBroadcastManager.getInstance(getContext()).sendBroadcast(intent);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -289,4 +289,72 @@ public class TestOnLineCarUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 模拟 后方VIP
|
||||
*/
|
||||
public static V2XMessageEntity<List<V2XSpecialCarRes.V2XMarkerEntity>> getV2XScenarionVRBehindVIPData() {
|
||||
try {
|
||||
InputStream inputStream = V2XUtils.getApp()
|
||||
.getResources()
|
||||
.openRawResource(R.raw.scenario_push_vr_hehind_vip_data);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = -1;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
baos.write(buffer, 0, len);
|
||||
}
|
||||
inputStream.close();
|
||||
|
||||
// 加载数据源
|
||||
V2XSpecialCarRes v2xRoadEventEntity =
|
||||
GsonUtil.objectFromJson(baos.toString(), V2XSpecialCarRes.class);
|
||||
|
||||
V2XMessageEntity<List<V2XSpecialCarRes.V2XMarkerEntity>> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING);
|
||||
// 设置数据
|
||||
v2xMessageEntity.setContent(v2xRoadEventEntity.getCoordinates());
|
||||
// 控制展示状态
|
||||
v2xMessageEntity.setShowState(true);
|
||||
return v2xMessageEntity;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逆向车辆路线预判
|
||||
*/
|
||||
public static V2XMessageEntity<List<V2XSpecialCarRes.V2XMarkerEntity>> getV2XScenarionVRReverseCarData() {
|
||||
try {
|
||||
InputStream inputStream = V2XUtils.getApp()
|
||||
.getResources()
|
||||
.openRawResource(R.raw.scenario_push_vr_reverse_car_data);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
int len = -1;
|
||||
byte[] buffer = new byte[1024];
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
baos.write(buffer, 0, len);
|
||||
}
|
||||
inputStream.close();
|
||||
|
||||
// 加载数据源
|
||||
V2XSpecialCarRes v2xRoadEventEntity =
|
||||
GsonUtil.objectFromJson(baos.toString(), V2XSpecialCarRes.class);
|
||||
|
||||
V2XMessageEntity<List<V2XSpecialCarRes.V2XMarkerEntity>> v2xMessageEntity = new V2XMessageEntity<>();
|
||||
// 控制类型
|
||||
v2xMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING);
|
||||
// 设置数据
|
||||
v2xMessageEntity.setContent(v2xRoadEventEntity.getCoordinates());
|
||||
// 控制展示状态
|
||||
v2xMessageEntity.setShowState(true);
|
||||
return v2xMessageEntity;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"sceneId": "200009",
|
||||
"alarmContent": "发现后方VIP车辆,请注意避让",
|
||||
"expireTime": 30000,
|
||||
"sceneCategory": 0,
|
||||
"sceneDescription": "VIP车辆,请避让",
|
||||
"sceneName": "后方VIP车辆",
|
||||
"sceneLevel": 0,
|
||||
"sceneChannel": "",
|
||||
"sceneSn": "",
|
||||
"tts": "发现后方VIP车辆,注意避让",
|
||||
"zoom": false,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat": 40.968678,
|
||||
"lon": 116.405467
|
||||
},
|
||||
"lat": 40.968678,
|
||||
"lon": 116.405467,
|
||||
"userHead": "",
|
||||
"msgImgUrl": ""
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"sceneId": "200006",
|
||||
"alarmContent": "发现逆向来车,注意减速慢行",
|
||||
"expireTime": 30000,
|
||||
"sceneCategory": 0,
|
||||
"sceneDescription": "逆向车辆对主车行驶影响预判功能",
|
||||
"sceneName": "逆向车辆路线预判",
|
||||
"sceneLevel": 0,
|
||||
"sceneChannel": "",
|
||||
"sceneSn": "",
|
||||
"tts": "对向来车注意减速",
|
||||
"zoom": false,
|
||||
"zoomScale": 15,
|
||||
"location": {
|
||||
"lat": 40.968678,
|
||||
"lon": 116.405467
|
||||
},
|
||||
"lat": 40.968678,
|
||||
"lon": 116.405467,
|
||||
"userHead": "",
|
||||
"msgImgUrl": ""
|
||||
}
|
||||
Reference in New Issue
Block a user