From 020a324e7fc6f55431d0812f231dbde710f2c271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Tue, 10 Aug 2021 15:32:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=99=90=E9=80=9F=E9=A2=84?= =?UTF-8?q?=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/obu/mogo/MogoPrivateObuManager.kt | 82 ++++++++++++------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt index 2f381fb534..d9d2754607 100644 --- a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt +++ b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt @@ -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 ") } } }