From 35716406b18b7b35816c8cd15c6f2f1fe3572a62 Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 12 Mar 2024 11:48:44 +0800 Subject: [PATCH] =?UTF-8?q?[6.3.0][=E5=B0=8F=E6=99=BA]=20=E5=B0=86?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E4=BA=8B=E4=BB=B6=E4=BF=A1=E6=81=AF=E4=BC=A0?= =?UTF-8?q?=E7=BB=99=E8=AE=A2=E9=98=85=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 6 +++--- .../scene/road/V2XRoadEventScenario.java | 16 +++++++++++++--- .../core/function/api/hmi/xiaozhi/event/Event.kt | 7 ++++--- 3 files changed, 20 insertions(+), 9 deletions(-) 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