完善OBU场景测试

This commit is contained in:
董宏宇
2021-08-11 15:04:31 +08:00
parent c7030efa0b
commit 896472ec09
5 changed files with 30 additions and 29 deletions

2
.idea/misc.xml generated
View File

@@ -21,6 +21,8 @@
<entry key="modules/mogo-module-left-panel/src/main/res/layout/module_left_panel_simple_speed.xml" value="0.202734375" />
<entry key="modules/mogo-module-main/src/main/res/layout/module_main_activity_main.xml" value="0.25" />
<entry key="modules/mogo-module-map/src/main/res/layout/module_map_fragment_map.xml" value="0.202734375" />
<entry key="modules/mogo-module-search/src/main/res/layout/fragment_navi_setting.xml" value="0.2703125" />
<entry key="modules/mogo-module-search/src/main/res/layout/fragment_search.xml" value="0.2703125" />
<entry key="modules/mogo-module-v2x/src/main/res/layout/item_v2x_fault_help_vr.xml" value="0.28854166666666664" />
<entry key="modules/mogo-module-warning/src/main/res/drawable/bg_waring_limiting_velocity.xml" value="0.28515625" />
<entry key="modules/mogo-module-warning/src/main/res/drawable/bg_waring_traffic_light_vr.xml" value="0.29791666666666666" />

View File

@@ -24,7 +24,7 @@ adb shell am broadcast -a com.hmi.v2x.limitingvelocity --ez limitingVelocityIsSh
adb shell am broadcast -a com.hmi.v2x.limitingvelocity --ez limitingVelocityIsShow false
// 控制OBU场景自测
adb shell am broadcast -a com.obu.test_trigger --ei obuType 0x2A01 --ei obuStates 1
adb shell am broadcast -a com.obu.test_trigger --ei obuStates 1 --ei obuLevel 3 --ei obuType 0x2A01

View File

@@ -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";
}

View File

@@ -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
)
}
}
}

View File

@@ -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 =