[V2X]鬼探头道路预警逻辑优化
This commit is contained in:
@@ -73,6 +73,6 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
|
||||
CallerHmiManager.showLimitingVelocity(1)
|
||||
}
|
||||
CallerHmiManager.showWarningV2X(v2xType, alertContent, ttsContent, tag, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(v2xType.toString(), alertContent, ttsContent, tag, null, true, 5000L)
|
||||
}
|
||||
}
|
||||
@@ -464,14 +464,14 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
/**
|
||||
* 展示VR下V2X预警
|
||||
*
|
||||
* @param v2xType V2X类型
|
||||
* @param poiType V2X类型
|
||||
* @param alertContent 提醒文本
|
||||
* @param ttsContent tts语音播报消息
|
||||
* @param tag tag绑定弹窗的标志
|
||||
*/
|
||||
@Synchronized
|
||||
override fun showWarningV2X(
|
||||
v2xType: Int,
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
@@ -487,9 +487,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (floatWindow == null || TextUtils.isEmpty(showTag) || !floatWindow.isShow() || floatWindow.config.floatTag != tag) {
|
||||
// 代理View初始化了才可以弹窗
|
||||
mViewNotification?.let { notificationView ->
|
||||
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType.toString()))
|
||||
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon(v2xType))
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnum.getWarningContent(v2xType.toString())
|
||||
?: EventTypeEnum.getWarningContent(v2xType)
|
||||
if (warningContent.isEmpty()) {
|
||||
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
||||
return@launchWhenResumed
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.telecom.Call
|
||||
import android.util.Log
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
@@ -346,7 +344,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
// CallerHmiManager.showWarning(direction)
|
||||
|
||||
//显示弹框,语音提示
|
||||
CallerHmiManager.showWarningV2X(appId.toInt(),
|
||||
CallerHmiManager.showWarningV2X(appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
@@ -456,7 +454,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerHmiManager.showWarningV2X(v2xType.toInt(),
|
||||
CallerHmiManager.showWarningV2X(v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
@@ -655,7 +653,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
|
||||
alertContent = EventTypeEnum.getWarningContent(appId.toString())
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(), null, true, 5000L
|
||||
)
|
||||
}
|
||||
@@ -722,7 +720,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
val maxSpeed = currentLight.glosa_suggested_speed_max.toInt()
|
||||
if (maxSpeed > 0) {
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
@@ -855,7 +853,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
)
|
||||
if (level == 2 || level == 3) {
|
||||
//显示弹框,语音提示
|
||||
CallerHmiManager.showWarningV2X(appId,
|
||||
CallerHmiManager.showWarningV2X(appId.toString(),
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction).toString(),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
|
||||
@@ -558,7 +558,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
}
|
||||
// 显示弹框,语音提示
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId,
|
||||
appId.toString(),
|
||||
content,
|
||||
tts,
|
||||
"$appId",
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.common.enums.EventTypeEnum;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@@ -50,7 +52,13 @@ public class V2XAlarmServer {
|
||||
// 计算车辆距离指定气泡的距离
|
||||
MarkerLocation eventLocation = v2XRoadEventEntity.getLocation();
|
||||
// 1、判断是否到达了触发距离,20 ~ 500,
|
||||
if (v2XRoadEventEntity.getDistance() <= 500) {
|
||||
double distance = v2XRoadEventEntity.getDistance();
|
||||
if (distance <= 500) {
|
||||
if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
|
||||
if (distance > 15) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// 2、道路事件方向与当前行驶方向角度偏差《20度以内
|
||||
double carBearing = currentLocation.getBearing();
|
||||
double eventBearing = eventLocation.getAngle();
|
||||
|
||||
@@ -98,7 +98,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
V2XRoadEventEntity content = entity != null ? entity.getContent() : null;
|
||||
if (content != null) {
|
||||
//显示警告红边
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType(), content.getAlarmContent(), content.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5));
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(content.getPoiType(), content.getAlarmContent(), content.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(5));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class V2XOptimalRouteVREventScenario
|
||||
if (entity != null) {
|
||||
V2XOptimalRouteDataRes content = entity.getContent();
|
||||
if (content != null) {
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType(), "为您推荐最优路线", "已为您选择最优路线", TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(entity.getType() + "", "为您推荐最优路线", "已为您选择最优路线", TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(30));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoMapL
|
||||
int v2xType = getV2XTypeForFrontWarning(mMarkerEntity);
|
||||
V2XMessageEntity entity = getV2XMessageEntity();
|
||||
if (v2xType != 0) {
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(v2xType, getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(3));
|
||||
CallerHmiManager.INSTANCE.showWarningV2X(v2xType + "", getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(), TAG, this, !entity.isOnlyShow(), TimeUnit.SECONDS.toMillis(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
private fun redLightWarning() {
|
||||
CallerLogger.d("$M_V2X$TAG", "=====闯红灯预警=====")
|
||||
ThreadUtils.runOnUiThread {
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType.toInt(), EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, EventTypeEnum.TYPE_USECASE_ID_IVP.content, EventTypeEnum.TYPE_USECASE_ID_IVP.tts, EventTypeEnum.TYPE_USECASE_ID_IVP.poiType, null, true, 5000L)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
speed
|
||||
)
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType.toInt(), content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
|
||||
CallerHmiManager.showWarningV2X(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, content, tts, EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType, null, true, 5000L)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
if (abs(currentResult!!.remain - it.remain) > 5 && currentResult.isGreen()) {
|
||||
CallerLogger.d("$M_V2X$TAG", "调用showWarningV2X to show")
|
||||
CallerHmiManager.showWarningV2X(
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType.toInt(),
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.content,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.tts,
|
||||
EventTypeEnum.TYPE_VIP_IDENTIFICATION.poiType,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"lat":39.969055,
|
||||
"lon":116.410811
|
||||
},
|
||||
"poiType":"10011",
|
||||
"poiType":"10024",
|
||||
"type":"CARD_TYPE_ROAD_CONDITION",
|
||||
"uploadType":"2",
|
||||
"userInfo":{
|
||||
@@ -41,5 +41,5 @@
|
||||
"userName":"零下的雨"
|
||||
}
|
||||
},
|
||||
"poiType":"10011"
|
||||
"poiType":"10024"
|
||||
}
|
||||
Reference in New Issue
Block a user