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

This commit is contained in:
xuxinchao
2023-04-17 12:32:52 +08:00
parent f655da0bde
commit 49eaecb096

View File

@@ -34,6 +34,8 @@ class TakeOverView @JvmOverloads constructor(
}
private var autopilotStatus: Int = 0 //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中,7:平行驾驶中
private var isParallel: Boolean = false //是否是平行驾驶
init {
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
@@ -53,6 +55,11 @@ class TakeOverView @JvmOverloads constructor(
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
autopilotStatus = autoPilotStatusInfo.state
if(autoPilotStatusInfo.state == 7){
isParallel = true
}else if(autoPilotStatusInfo.state == 2){
isParallel = false
}
Log.i(TAG,"自动驾驶状态${autopilotStatus}")
}
@@ -106,7 +113,7 @@ class TakeOverView @JvmOverloads constructor(
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_CONNECTION_ERROR -> {
//如果是平行驾驶状态下,提示弱网接管
Log.i(TAG,"弱网时自动驾驶状态:${autopilotStatus}")
if(autopilotStatus == 7){
if(autopilotStatus == 7 || isParallel){
CallerHmiManager.warningV2X(
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,