[dev_robobus-d_230413_3.1.0]fix不处于平行驾驶状态下弱网也提示平行驾驶接管提示

This commit is contained in:
xuxinchao
2023-04-17 11:31:13 +08:00
parent 464ef23c54
commit f655da0bde
2 changed files with 42 additions and 23 deletions

View File

@@ -2,9 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.vehicle
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
@@ -31,6 +33,8 @@ class TakeOverView @JvmOverloads constructor(
const val TAG = "TakeOverView"
}
private var autopilotStatus: Int = 0 //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中,7:平行驾驶中
init {
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
}
@@ -42,6 +46,16 @@ class TakeOverView @JvmOverloads constructor(
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
}
/**
* 自动驾驶状态信息
*
* @param autoPilotStatusInfo 状态信息
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
autopilotStatus = autoPilotStatusInfo.state
Log.i(TAG,"自动驾驶状态${autopilotStatus}")
}
/**
* 工控机监控节点上报
*/
@@ -90,32 +104,37 @@ class TakeOverView @JvmOverloads constructor(
//弱网
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_NETWORK_WEAK,
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_CONNECTION_ERROR -> {
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
visibility = View.VISIBLE
//加入消息盒子
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
//如果是平行驾驶状态下,提示弱网接管
Log.i(TAG,"弱网时自动驾驶状态:${autopilotStatus}")
if(autopilotStatus == 7){
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
object : IMoGoWarningStatusListener {
override fun onShow() {
takeOver = true
visibility = View.VISIBLE
//加入消息盒子
Log.i(TAG,"弱网时加入消息盒子${EventTypeEnumNew.NETWORK_WEAK_EVENT.content}")
saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X, V2XMsg(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
)
)
)
)
}
}
override fun onDismiss() {
takeOver = false
visibility = View.GONE
override fun onDismiss() {
takeOver = false
visibility = View.GONE
}
}
}
)
)
}
}
}
}

View File

@@ -47,7 +47,7 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
var satelliteTime = 0.0
/**
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start 7:平行驾驶中
*/
var state = 0