[6.6.2] fix bug

This commit is contained in:
EmArrow
2024-10-10 19:12:07 +08:00
parent 28a19d40dc
commit 2076c6dc96
2 changed files with 35 additions and 11 deletions

View File

@@ -234,10 +234,12 @@ class RoadCrossCameraManager : IMoGoMapRoadListener, IGaoDeMapLocationListener {
roadCrossCameraList?.forEach {
val result = (!it.roadUniqueId.isNullOrEmpty()
&& it.roadUniqueId == roadCrossEnd)
roadCrossTrace(
TAG, mapOf("errorMsg" to "hasCrossCamera - 遍历匹配路口数据:$result - $roadCrossEnd")
)
return result
if(result){
roadCrossTrace(
TAG, mapOf("errorMsg" to "hasCrossCamera - 遍历匹配路口数据命中 - $roadCrossEnd")
)
return true
}
}
roadCrossTrace(

View File

@@ -19,7 +19,6 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.V2X_EVENT_TAG
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
import com.mogo.eagle.core.function.business.roadcross.RoadCrossCameraManager
import com.mogo.eagle.core.function.business.roadcross.RoadCrossCameraManager.Companion.instance
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
@@ -57,10 +56,14 @@ class RoadCrossRoamView @JvmOverloads constructor(
private const val MSG_HIDE_VIEW_TIME = 10_000L
}
@Volatile
private var isShow = false
private var showState by Delegates.observable(false) { _, oldV, newV ->
if (oldV != newV) {
updateView(newV)
if (!newV) {
isShow = false
}
updateView(newV)
}
private var animator: ObjectAnimator? = null
@@ -185,16 +188,28 @@ class RoadCrossRoamView @JvmOverloads constructor(
override fun onStopLineInfo(info: StopLine) {
super.onStopLineInfo(info)
val cross = CallerMapRoadListenerManager.getCrossEndInfo()
if (info.distance == 0.0 || info.distance > 200) {
CallerLogger.d("$M_MAP$TAG", "showState return , distance is ${info.distance}")
if (cross != null && cross != "0") {
CallerLogger.d("emArrow-tag", "未触发路口ID:$cross , 距离超出:${info.distance}")
}
return
}
showState = info.distance in 110.0..200.0
CallerLogger.d("emArrow-tag", "命中 before:$showState")
showState = info.distance in 100.0..200.0
CallerLogger.d("emArrow-tag", "命中 after:$showState路口ID:$cross , dis:${info.distance}")
}
private fun attachView() {
if (isShow) {
return
}
if (this.visibility == View.VISIBLE) {
return
}
// 没有路线不做提示
if (CallerAutoPilotStatusListenerManager.getLineId() == 0L) {
CallerLogger.d("$M_MAP$TAG", "没有路线不做提示")
return
}
// 处于漫游模式下不做处理
@@ -211,15 +226,22 @@ class RoadCrossRoamView @JvmOverloads constructor(
return
}
// 没有路侧设备,不做处理
if(!instance.hasCrossCamera()){
CallerLogger.d("emArrow-tag", "命中attachView")
val cross = CallerMapRoadListenerManager.getCrossEndInfo()
if (cross.isNullOrEmpty()) {
CallerLogger.d("emArrow-tag", "未触发路口ID:$cross")
return
}
if (!instance.hasCrossCamera()) {
CallerLogger.d("$M_MAP$TAG", "没有路侧设备,不做处理")
return
}
isShow = true
//播放语音
val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
var disStr = "前方即将通过路口,蘑菇为您提供路口全息影像,助力出行"
if(dis >= 80){
if (dis >= 80) {
disStr = "前方${dis}米将通过路口,蘑菇为您提供路口全息影像,助力出行"
}
AIAssist.getInstance(context).speakTTSVoice(disStr)