[6.5.0][道路事件] 添加小智形象状态变化通知

This commit is contained in:
renwj
2024-07-24 11:04:33 +08:00
parent 863f5b1e39
commit b209e214d1
3 changed files with 50 additions and 0 deletions

View File

@@ -11,8 +11,12 @@ import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State.START
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State.STOP
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -116,6 +120,11 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener {
)
if (angle >= 90 || distance >= 150) {
CallerRoadV2NEventWindowListenerManager.dismiss(it.getBusStationId())
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION), STOP)
}
}
busStationListNeedNotified.remove(it.getBusStationId())
trackEvent("dismiss --> busStationId=${it.getBusStationId()}")
Logger.d(
@@ -156,6 +165,11 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener {
if (list.isNotEmpty()) {
list.first().also {
it.notifyTime = System.currentTimeMillis()
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION), START)
}
}
CallerRoadV2NEventWindowListenerManager.showImage(
it.getBusStationId(),
it.notifyTime,

View File

@@ -18,6 +18,8 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType.V2X
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2nNioEventListener
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State.START
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
@@ -183,6 +185,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
} else {
sb.append("发现前方${distance.toInt()}${ if (poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.poiType) "车道施工" else "车道事故" }@@, 蘑菇时刻为您守护")
}
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(poiType)), START)
}
}
val ss = sb.toString()
val content = ss.substring(0, ss.indexOf("@@"))
val tts = ss.replace("@@", "")
@@ -239,6 +246,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
return@Callback true
}
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE), START)
}
}
// 弹事件框
val alertContent = String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt())
val alertTts = String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt())
@@ -353,6 +365,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
Logger.i(TAG, "people cross -- 3 --")
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS), START)
}
}
// 弹事件框
val alertContent = String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt())
val alertTts = String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt())

View File

@@ -7,13 +7,17 @@ import android.os.HandlerThread
import android.os.Looper
import android.view.animation.DecelerateInterpolator
import androidx.core.util.Pair
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.api.hmi.xiaozhi.event.V2N
import com.mogo.eagle.core.function.api.hmi.xiaozhi.state.State.STOP
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
@@ -128,6 +132,11 @@ class AiRoadMarker {
CallerHmiManager.dismissGreenWave()
} else {
CallerRoadV2NEventWindowListenerManager.dismiss(marker.id)
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(marker.poiType)), STOP)
}
}
}
}
wrapper.addPoint(p)
@@ -296,6 +305,11 @@ class AiRoadMarker {
aiMakers.remove(id)?.also {
val m = it.marker.get()
CallerRoadV2NEventWindowListenerManager.dismiss(m.id)
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(marker.poiType)), STOP)
}
}
}
}
MarkerRemoveManager.addMarker(wrapper)
@@ -325,6 +339,11 @@ class AiRoadMarker {
CallerHmiManager.dismissGreenWave()
} else {
MarkerRemoveManager.removeMarker(marker.id)
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
runCatching {
CallerHmiManager.notifyXiaoZhiStatusChanged(V2N(EventTypeEnumNew.getEnumType(marker.poiType)), STOP)
}
}
CallerRoadV2NEventWindowListenerManager.dismiss(marker.id)
}
}