[dev_robobus-d_230413_3.1.0]fix不处于平行驾驶状态下弱网也提示平行驾驶接管提示
This commit is contained in:
@@ -2,9 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui.vehicle
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
|
import android.util.Log
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
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.config.FunctionBuildConfig
|
||||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||||
@@ -31,6 +33,8 @@ class TakeOverView @JvmOverloads constructor(
|
|||||||
const val TAG = "TakeOverView"
|
const val TAG = "TakeOverView"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var autopilotStatus: Int = 0 //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中,7:平行驾驶中
|
||||||
|
|
||||||
init {
|
init {
|
||||||
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
||||||
}
|
}
|
||||||
@@ -42,6 +46,16 @@ class TakeOverView @JvmOverloads constructor(
|
|||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
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_NETWORK_WEAK,
|
||||||
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_CONNECTION_ERROR -> {
|
MogoReport.Code.Error.EMAP.EPARALLEL_AICLOUD_CONNECTION_ERROR -> {
|
||||||
CallerHmiManager.warningV2X(
|
//如果是平行驾驶状态下,提示弱网接管
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
|
Log.i(TAG,"弱网时自动驾驶状态:${autopilotStatus}")
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
|
if(autopilotStatus == 7){
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
|
CallerHmiManager.warningV2X(
|
||||||
object : IMoGoWarningStatusListener {
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
|
||||||
override fun onShow() {
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
|
||||||
takeOver = true
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts,
|
||||||
visibility = View.VISIBLE
|
object : IMoGoWarningStatusListener {
|
||||||
//加入消息盒子
|
override fun onShow() {
|
||||||
saveMsgBox(
|
takeOver = true
|
||||||
MsgBoxBean(
|
visibility = View.VISIBLE
|
||||||
MsgBoxType.V2X, V2XMsg(
|
//加入消息盒子
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
|
Log.i(TAG,"弱网时加入消息盒子${EventTypeEnumNew.NETWORK_WEAK_EVENT.content}")
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
|
saveMsgBox(
|
||||||
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
|
MsgBoxBean(
|
||||||
|
MsgBoxType.V2X, V2XMsg(
|
||||||
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.poiType,
|
||||||
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.content,
|
||||||
|
EventTypeEnumNew.NETWORK_WEAK_EVENT.tts
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDismiss() {
|
override fun onDismiss() {
|
||||||
takeOver = false
|
takeOver = false
|
||||||
visibility = View.GONE
|
visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
|||||||
var satelliteTime = 0.0
|
var satelliteTime = 0.0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start
|
* 自动驾驶状态 0是不可用 1是ready 2是自动驾驶start 7:平行驾驶中
|
||||||
*/
|
*/
|
||||||
var state = 0
|
var state = 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user