完善OBU场景测试
This commit is contained in:
@@ -17,5 +17,7 @@ public class MogoObuConst {
|
||||
public static String BROADCAST_OBU_TYPE_EXTRA_KEY = "obuType";
|
||||
// 场景操作状态,ObuConstants.STATUS
|
||||
public static String BROADCAST_OBU_STATES_EXTRA_KEY = "obuStates";
|
||||
// 场景预警等级,2-弹窗,3-弹窗+tts+地图绘制
|
||||
public static String BROADCAST_OBU_LEVEL_EXTRA_KEY = "obuLevel";
|
||||
|
||||
}
|
||||
|
||||
@@ -253,33 +253,29 @@ class MogoPrivateObuManager private constructor() {
|
||||
info?.let {
|
||||
//预警信息,预警类型 threat_level 3
|
||||
info.threat_info?.let {
|
||||
if (info.threat_info.threat_level > 1) {
|
||||
//预警方位
|
||||
val direction = info.ext_info.target_classification
|
||||
//显示警告红边
|
||||
mMogoServiceApis!!.v2XListenerManager.warningChangedForListenerWithDirection(
|
||||
getMessageDirection(direction),
|
||||
"ACTION_V2X_FRONT_WARNING"
|
||||
)
|
||||
|
||||
//处理预警类型
|
||||
val appId = info.threat_info.app_id
|
||||
Logger.d(
|
||||
MogoObuConst.TAG_MOGO_OBU,
|
||||
"direction = " + direction + "----" + getMessageDirection(
|
||||
direction
|
||||
) + "--appId = " + appId
|
||||
)
|
||||
handleSdkObu(
|
||||
info.vehicle_id,
|
||||
appId,
|
||||
info.threat_info.threat_level,
|
||||
getMessageDirection(direction),
|
||||
info.status,
|
||||
info.basic_info
|
||||
)
|
||||
// 这里不主动添加元素,原因是onCvxRvInfoIndInfo中会展示周边车,只用修改对应的车辆位置即可
|
||||
}
|
||||
//预警方位
|
||||
val direction = info.ext_info.target_classification
|
||||
//显示警告红边
|
||||
mMogoServiceApis!!.v2XListenerManager.warningChangedForListenerWithDirection(
|
||||
getMessageDirection(direction),
|
||||
"ACTION_V2X_FRONT_WARNING"
|
||||
)
|
||||
//处理预警类型
|
||||
val appId = info.threat_info.app_id
|
||||
Logger.d(
|
||||
MogoObuConst.TAG_MOGO_OBU,
|
||||
"direction = " + direction + "----" + getMessageDirection(
|
||||
direction
|
||||
) + "--appId = " + appId
|
||||
)
|
||||
handleSdkObu(
|
||||
info.vehicle_id,
|
||||
appId,
|
||||
info.threat_info.threat_level,
|
||||
getMessageDirection(direction),
|
||||
info.status,
|
||||
info.basic_info
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ class ObuTestTriggerReceiver : BroadcastReceiver() {
|
||||
*/
|
||||
val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0)
|
||||
val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0)
|
||||
val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3)
|
||||
Logger.d(
|
||||
TAG, "obuType:$obuType obuStatus:$obuStatus"
|
||||
)
|
||||
@@ -48,7 +49,7 @@ class ObuTestTriggerReceiver : BroadcastReceiver() {
|
||||
// 构建测试数据
|
||||
val cvxV2vThreatIndInfo = CvxV2vThreatIndInfo(1, 1, 1L)
|
||||
|
||||
val v2vThreat = V2vThreat(1, obuType, null, 1000, 2, 100)
|
||||
val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100)
|
||||
cvxV2vThreatIndInfo.threat_info = v2vThreat
|
||||
|
||||
val v2vThreatExt =
|
||||
|
||||
Reference in New Issue
Block a user