ad upgrade
add autopilot status judge
This commit is contained in:
@@ -32,6 +32,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
private var connectStatus = false
|
||||
private var dockerVersion :String ?=null //工控机版本
|
||||
private var autopilotStatus:Int ?=null //自动驾驶状态 0代表不可自动驾驶,1代表可自动驾驶,2代表自动驾驶中
|
||||
private var adUpgradeDialog : AdUpgradeDialog? = null
|
||||
|
||||
private var upgradeMode: Int=-1 //升级模式
|
||||
@@ -69,13 +71,17 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
adUpgradeDialog = AdUpgradeDialog(context)
|
||||
adUpgradeDialog?.setClickListener(object : AdUpgradeDialog.ClickListener{
|
||||
override fun confirm() {
|
||||
//确认升级
|
||||
Logger.i(TAG,"upgrade confirm")
|
||||
//设置当前状态为“升级中”
|
||||
AdUpgradeStateHelper.setUpgradeStatus(true)
|
||||
//TODO
|
||||
if(autopilotStatus==2){
|
||||
//当前处于自动驾驶状态,不可进行升级,Toast提示
|
||||
ToastUtils.showShort("升级前请先退出自动驾驶模式")
|
||||
}else{
|
||||
//确认升级
|
||||
Logger.i(TAG,"upgrade confirm")
|
||||
//设置当前状态为“升级中”
|
||||
AdUpgradeStateHelper.setUpgradeStatus(true)
|
||||
//TODO
|
||||
// AdasManager.getInstance().sendBaseInfo(IPCUpgradeInfo.affirm());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancel() {
|
||||
@@ -190,6 +196,9 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
private fun showCurrentAdVersion(){
|
||||
tvAdVersionContent?.let {
|
||||
// it.text = AdasManager.getInstance().getAdasConfig().getDockVersion())
|
||||
if(!dockerVersion.isNullOrEmpty()){
|
||||
it.text = dockerVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +214,8 @@ class SystemVersionView @JvmOverloads constructor(
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
connectStatus = autoPilotStatusInfo.connectStatus
|
||||
dockerVersion = autoPilotStatusInfo.dockVersion
|
||||
autopilotStatus = autoPilotStatusInfo.state
|
||||
setViewStatus()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user