[6.3.0][小智] 将具体事件信息传给订阅者

This commit is contained in:
renwj
2024-03-12 11:48:44 +08:00
parent 6500052211
commit 35716406b1
3 changed files with 20 additions and 9 deletions

View File

@@ -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())
}
},

View File

@@ -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<V2XRoadEventEntity> imp
@Override
public void onShow() {
CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(Event.V2N, State.START);
V2XMessageEntity<V2XRoadEventEntity> 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<V2XRoadEventEntity> imp
@Override
public void onDismiss() {
CallerHmiManager.INSTANCE.notifyXiaoZhiStatusChanged(Event.V2N, State.STOP);
if (isNeedChangeAngle()) {
V2XMessageEntity<V2XRoadEventEntity> 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();

View File

@@ -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
}
sealed interface Event
data class V2N(val type: EventTypeEnumNew): Event