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 c6adbd00bf..f8a6fec0f3 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 @@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.angle.scenes.Default import com.mogo.eagle.core.function.angle.scenes.RoadEvent import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener -import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.Event +import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager @@ -256,7 +256,7 @@ internal object V2NIdentifyDrawer { object : IMoGoWarningStatusListener { override fun onShow() { super.onShow() - CallerHmiManager.notifyXiaoZhiStatusChanged(Event.V2N, State.START) + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(poiType)), State.START) } CallerVisualAngleManager.changeAngle( RoadEvent( lon, @@ -268,7 +268,7 @@ internal object V2NIdentifyDrawer { override fun onDismiss() { super.onDismiss() - CallerHmiManager.notifyXiaoZhiStatusChanged(Event.V2N, State.STOP) + runCatching { CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.valueOf(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 88d8f62c05..f79d4c2451 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 @@ -17,7 +17,7 @@ import com.mogo.eagle.core.data.msgbox.V2XMsg; import com.mogo.eagle.core.function.angle.scenes.Default; import com.mogo.eagle.core.function.angle.scenes.RoadEvent; import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener; -import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.Event; +import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N; import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State; import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; @@ -161,11 +161,13 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void onShow() { - CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(Event.V2N, State.START); V2XMessageEntity entity = getV2XMessageEntity(); if (entity != null) { V2XRoadEventEntity content = entity.getContent(); if (content != null) { + try { + CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.valueOf(content.getPoiType())), State.START); + } catch (Throwable ignore) {} if (isNeedChangeAngle()) { MarkerLocation location = content.getLocation(); if (location != null) { @@ -190,8 +192,16 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp @Override public void onDismiss() { - CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(Event.V2N, State.STOP); if (isNeedChangeAngle()) { + V2XMessageEntity entity = getV2XMessageEntity(); + if (entity != null) { + V2XRoadEventEntity content = entity.getContent(); + if (content != null) { + try { + CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(new V2N(EventTypeEnumNew.valueOf(content.getPoiType())), State.STOP); + } catch (Throwable ignore) {} + } + } CallerVisualAngleManager.INSTANCE.changeAngle(new Default(3, TimeUnit.SECONDS)); } release(); diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/xiaozhi/event/Event.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/xiaozhi/event/Event.kt index 5052fd4a8e..447cd8954b 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/xiaozhi/event/Event.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/xiaozhi/event/Event.kt @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.api.hmi.xiaozhi.event -enum class Event { +import com.mogo.eagle.core.data.enums.EventTypeEnumNew - V2N -} \ No newline at end of file +sealed interface Event + +data class V2N(val type: EventTypeEnumNew): Event \ No newline at end of file