[6.7.0][FSM] refactor: 异常后原因修改成多条数组返回;

This commit is contained in:
aibingbing
2024-09-25 17:33:29 +08:00
parent 41f1b7312c
commit a05d978ac2
11 changed files with 33 additions and 47 deletions

View File

@@ -22,7 +22,6 @@ import com.zhjt.mogo_core_function_devatools.status.entity.FSMStateCode
import com.zhjt.mogo_core_function_devatools.status.entity.FSMStatus
import com.zhjt.mogo_core_function_devatools.status.entity.GearStatus
import com.zhjt.mogo_core_function_devatools.status.entity.IAutopilotPreLaunchStatus
import com.zhjt.mogo_core_function_devatools.status.entity.SpeedStatus
import com.zhjt.mogo_core_function_devatools.status.entity.Status
import com.zhjt.mogo_core_function_devatools.status.entity.SteerStatus
import kotlinx.android.synthetic.main.view_start_autopilot_status.view.fSMStatusLayout
@@ -72,7 +71,7 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
private fun initView() {
// 默认展示 FSM 情况未知的状态
handleFSM(FSMStatus(FSMStateCode.UnKnown, "未知"))
handleFSM(FSMStatus(FSMStateCode.UnKnown, listOf("未知")))
}
/**
@@ -132,9 +131,7 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
FSMStateCode.ExistError -> {
fSMStatusLayout?.onClick {
CallerHmiManager.showFSMExceptionStatusWindow(ArrayList<String>().also {
it += status.desc
})
CallerHmiManager.showFSMExceptionStatusWindow(status.descList)
}
fSMStatusLayout?.setImageDrawable(
ContextCompat.getDrawable(
@@ -233,7 +230,6 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
}
}
override fun onAttachedToWindow() {
super.onAttachedToWindow()
StatusManager.addListener(TAG, this)
@@ -256,10 +252,6 @@ class StartAutoPilotStatusView @JvmOverloads constructor(
handleFSM(status)
}
is SpeedStatus -> {
// TODO
}
else -> {
handleWithoutFSM(status)
}

View File

@@ -54,7 +54,7 @@ class FSMStatusDetailView @JvmOverloads constructor(
}
}
fun setFsmErrorStatus(msgArray: ArrayList<String>) {
fun setFsmErrorStatus(msgArray: List<String>) {
tvTitle?.text = "FSM异常"
runCatching {
val c = Color.parseColor("#FF4E41")
@@ -93,7 +93,7 @@ class FSMStatusDetailView @JvmOverloads constructor(
removeFsmMsgItemView()
}
private fun addFsmMsgItemView(msgArray: ArrayList<String>, isError: Boolean) {
private fun addFsmMsgItemView(msgArray: List<String>, isError: Boolean) {
if (llFsmMsgContainerLayout == null) {
Logger.e(TAG, "addFsmMsmItemView llFsmMsgContainerLayout is null")
return
@@ -145,14 +145,7 @@ class FSMStatusDetailView @JvmOverloads constructor(
}
FSMStateCode.ExistError -> {
// TODO 修改成多条
setFsmErrorStatus(ArrayList<String>().also {
it += status.desc
it += status.desc
it += status.desc
it += status.desc
it += status.desc
})
setFsmErrorStatus(status.descList)
}
}
}

View File

@@ -25,7 +25,7 @@ class FSMStatusDetailWindowManager private constructor() {
}
fun showExceptionStatus(
context: Context, errorMsg: ArrayList<String>
context: Context, errorMsg: List<String>
) {
if (mFSMStatusDetailView == null) {
mFSMStatusDetailView = FSMStatusDetailView(context)

View File

@@ -355,7 +355,7 @@ class MoGoHmiProvider : IMoGoHmiProvider {
/**
* 展示 FSM 异常状态弹框
*/
override fun showFSMExceptionStatusWindow(errorMsg: ArrayList<String>) {
override fun showFSMExceptionStatusWindow(errorMsg: List<String>) {
context?.let { FSMStatusDetailWindowManager.fsmStatusDetailWindowManager.showExceptionStatus(it, errorMsg)}
}