完成限速预警

This commit is contained in:
董宏宇
2021-08-10 15:32:09 +08:00
parent a10f9e25fd
commit 020a324e7f

View File

@@ -127,6 +127,24 @@ class MogoPrivateObuManager private constructor() {
}
// 限速预警信息
override fun onCvxSlwThreatIndInfo(info: CvxSlwThreatIndInfo?) {
super.onCvxSlwThreatIndInfo(info)
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxSlwThreatIndInfo ------> $info")
info?.let {
when (info.status) {
// 删除
2 -> {
mIMoGoWaringProvider?.disableLimitingVelocity()
}
// 添加\更新
else -> {
mIMoGoWaringProvider?.showLimitingVelocity(info.ext_info.speed_limit_max.toInt())
}
}
}
}
// 红绿灯信息
override fun onCvxMapSpatInfoIndInfo(info: CvxMapSpatInfoIndInfo?) {
super.onCvxMapSpatInfoIndInfo(info)
@@ -137,7 +155,7 @@ class MogoPrivateObuManager private constructor() {
2 -> {
mIMoGoWaringProvider?.disableWarningTrafficLight()
}
// 添加\更新红绿灯状态
// 添加\更新
else -> {
info.ivp_threat_ext.lights.forEach {
when (it.phase) {
@@ -166,42 +184,44 @@ class MogoPrivateObuManager private constructor() {
//V2V预警信息 TODO 他车是否一直出现
override fun onCvxV2vThreatIndInfo(info: CvxV2vThreatIndInfo) {
override fun onCvxV2vThreatIndInfo(info: CvxV2vThreatIndInfo?) {
Logger.e(MogoObuConst.TAG_MOGO_OBU, "onCvxV2vThreatIndInfo ------> $info")
//预警信息,预警类型 threat_level 3
if (info.threat_info != null) {
if (info.threat_info.threat_level == 3) {
//预警方位
val direction = info.ext_info.target_classification
info?.let {
//预警信息,预警类型 threat_level 3
if (info.threat_info != null) {
if (info.threat_info.threat_level == 3) {
//预警方位
val direction = info.ext_info.target_classification
//显示警告弹框
mMogoServiceApis!!.v2XListenerManager.warningChangedForListenerWithDirection(
getMessageDirection(direction),
"ACTION_V2X_FRONT_WARNING"
)
//显示警告弹框
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(
appId,
//处理预警类型
val appId = info.threat_info.app_id
Logger.d(
MogoObuConst.TAG_MOGO_OBU,
"direction = " + direction + "----" + getMessageDirection(direction) + "--appId = " + appId
)
handleSdkObu(
appId,
info.threat_info.threat_level,
getMessageDirection(direction),
info.status
)
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
mObuRecognizedResultDrawer?.updateCvxRvInfoIndInfo(
info.threat_info.threat_level,
getMessageDirection(direction),
info.status
info.vehicle_id,
info.basic_info
)
} else {
Logger.e(MogoObuConst.TAG_MOGO_OBU, "info == null ")
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
mObuRecognizedResultDrawer?.updateCvxRvInfoIndInfo(
info.threat_info.threat_level,
info.vehicle_id,
info.basic_info
)
} else {
Logger.e(MogoObuConst.TAG_MOGO_OBU, "info == null ")
}
}
}