From c2a0b44a9d073123f08a92087412bf4efb050d87 Mon Sep 17 00:00:00 2001 From: renwj Date: Mon, 25 Mar 2024 20:12:08 +0800 Subject: [PATCH] =?UTF-8?q?[6.3.0][=E5=B0=8F=E6=99=BA]=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3V2N=E4=BA=8B=E4=BB=B6=E5=88=B0=E6=9D=A5=E6=97=B6,?= =?UTF-8?q?=E5=B0=8F=E6=99=BA=E5=BD=A2=E8=B1=A1=E4=B8=8D=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/common/module/debug/DebugDataDispatch.kt | 4 ++-- .../eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 8 ++++---- .../v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java | 4 ++-- .../com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt | 5 +++++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/OCH/common/common/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt b/OCH/common/common/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt index c7b2f4fc8a..953c9bb585 100644 --- a/OCH/common/common/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt +++ b/OCH/common/common/src/debug/java/com/mogo/och/common/module/debug/DebugDataDispatch.kt @@ -172,9 +172,9 @@ object DebugDataDispatch { val poiType = intent.getStringExtra("poiType") poiType?.let { if(state==0){ - CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.START) + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) } }else{ - CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.STOP) + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) } } } } diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 0e854d9a85..ef3b23007b 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -147,7 +147,7 @@ internal object V2NIdentifyDrawer { object : IMoGoWarningStatusListener { override fun onShow() { super.onShow() - runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.START) } + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) } CallerVisualAngleManager.changeAngle( RoadEvent( itx.longitude, @@ -159,7 +159,7 @@ internal object V2NIdentifyDrawer { override fun onDismiss() { super.onDismiss() - runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.STOP) } + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) } CallerVisualAngleManager.changeAngle(Default()) } }, @@ -258,7 +258,7 @@ internal object V2NIdentifyDrawer { object : IMoGoWarningStatusListener { override fun onShow() { super.onShow() - runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.START) } + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.START) } CallerVisualAngleManager.changeAngle( RoadEvent( lon, @@ -270,7 +270,7 @@ internal object V2NIdentifyDrawer { override fun onDismiss() { super.onDismiss() - runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.STOP) } + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), State.STOP) } CallerVisualAngleManager.changeAngle(Default()) } }, diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java index f79d4c2451..e5470cf1e5 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/scenario/scene/road/V2XRoadEventScenario.java @@ -166,7 +166,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp V2XRoadEventEntity content = entity.getContent(); if (content != null) { try { - CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.valueOf(content.getPoiType())), State.START); + CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.getEnumType(content.getPoiType())), State.START); } catch (Throwable ignore) {} if (isNeedChangeAngle()) { MarkerLocation location = content.getLocation(); @@ -198,7 +198,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp V2XRoadEventEntity content = entity.getContent(); if (content != null) { try { - CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.valueOf(content.getPoiType())), State.STOP); + CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.getEnumType(content.getPoiType())), State.STOP); } catch (Throwable ignore) {} } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index d8b7412870..f3c6852fdd 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -1478,5 +1478,10 @@ enum class EventTypeEnumNew( else -> false } } + + @JvmStatic + fun getEnumType(poiType: String): EventTypeEnumNew { + return EventTypeEnumNew.values().find { it.poiType == poiType } ?: throw AssertionError("poiType: $poiType corresponding to enum value not find.") + } } } \ No newline at end of file