2.13.0 联调弱势交通
This commit is contained in:
@@ -9,7 +9,6 @@ import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.annotation.RequiresApi
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.impl;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
@@ -9,6 +11,7 @@ import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService;
|
||||
import com.mogo.eagle.core.function.impl.marker.drawer.MarkerDrawer;
|
||||
import com.mogo.eagle.core.function.impl.marker.drawer.TrafficMarkerDrawer;
|
||||
import com.mogo.eagle.core.function.impl.marker.drawer.V2XWarnDataDrawer;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.DataTypes
|
||||
@@ -98,9 +99,9 @@ object TrafficMarkerDrawer {
|
||||
* 更新识别数据颜色
|
||||
*/
|
||||
fun updateITrafficThreatLevelInfo(trafficData: TrafficData) {
|
||||
CallerLogger.d(TAG, "updateITrafficThreatLevelInfo trafficData = $trafficData")
|
||||
CallerLogger.d(TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
|
||||
// Log.e("liyz", "trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel + "----FunctionBuildConfig.debugTrackerProvider = " + FunctionBuildConfig.debugTrackerProvider)
|
||||
if (FunctionBuildConfig.debugTrackerProvider != 1) {
|
||||
return
|
||||
}
|
||||
@@ -166,8 +167,11 @@ object TrafficMarkerDrawer {
|
||||
private fun drawObuRecognizedDataMarker(trafficData: TrafficData) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
"drawObuRecognizedDataMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
// Log.d("liyz",
|
||||
// "drawObuRecognizedDataMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
// )
|
||||
if (trafficData.type != null) {
|
||||
val resId: Int = trafficData.type.traffic3DIconId
|
||||
|
||||
@@ -214,7 +218,7 @@ object TrafficMarkerDrawer {
|
||||
) {
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
"changeDynamicMarker trafficData.type = " + trafficData.type + "---trafficData.threatLevel = " + trafficData.threatLevel
|
||||
)
|
||||
if (trafficData.type != TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE) {
|
||||
mMarkersCaches[trafficData.uuid]?.setAnchorColor(trafficData.threatLevelColor())
|
||||
|
||||
@@ -409,8 +409,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
"ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
|
||||
)
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD -> {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//显示警告红边
|
||||
// CallerHmiManager.showWarning(direction)
|
||||
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
|
||||
@@ -447,11 +446,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
|
||||
}
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
// 关闭警告红边
|
||||
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
@@ -467,7 +464,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -489,11 +485,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
"onMogoObuRsmWarning ------> ${data.toString()}"
|
||||
)
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null && (data.participant.ptcType == 1 || data.participant.ptcType == 3)) {
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status}"
|
||||
)
|
||||
|
||||
if (data != null && data.participant != null) {
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //机动车
|
||||
v2xType =
|
||||
@@ -513,71 +505,69 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
|
||||
level = data.warningMsg.warningData[0].warningLevel
|
||||
}
|
||||
level = data.warningMsg.warningData[0].warningLevel //默认是1个
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status}"
|
||||
)
|
||||
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
when (data.warningMsg.warningData[0].status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.OBU,
|
||||
V2XMsg(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_NON
|
||||
)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_NON
|
||||
)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
// }
|
||||
|
||||
// 更新数据 TODO
|
||||
// TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
// CallerMapUIServiceManager.getMarkerService()
|
||||
// ?.updateITrafficInfo(it)
|
||||
// }
|
||||
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "cvxPtcThreatIndInfo2TrafficData ---it---> $it")
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> {// 更新
|
||||
|
||||
}
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it")
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> {// 更新
|
||||
}
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 更新数据 TODO 删除原来的,改变颜色,删除marker。不影响别的模型添加
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ class ObuTestNewObuReceiver : BroadcastReceiver() {
|
||||
val obuStatus = intent.getIntExtra("status", 0)
|
||||
val obuLevel = intent.getIntExtra("level", 3)
|
||||
val direction = intent.getIntExtra("direction", 0)
|
||||
Log.d("liyz", "obuType:$obuType obuStatus:$obuStatus obuLevel:$obuLevel")
|
||||
|
||||
val vehBasicsMsg = VehBasics(1)
|
||||
vehBasicsMsg.targetPosition = direction
|
||||
|
||||
Reference in New Issue
Block a user