[686][hardware]LED屏幕 红绿灯不消失问题修复

This commit is contained in:
xinfengkun
2024-12-25 16:03:03 +08:00
parent 2b405f6421
commit d5e3455f6f

View File

@@ -53,7 +53,7 @@ open class BaseLedUIViewModel : ViewModel() {
currentStationReportUI = StationReportUI(stationName, state)
}
open fun receive(msg: LedUI) {
open suspend fun receive(msg: LedUI) {
Log.e(
TAG,
"receive --> ${msg.javaClass.simpleName}[priority=${msg.priority}] current:${currentLedUI.javaClass.simpleName}[priority=${currentLedUI.priority}]"
@@ -118,7 +118,7 @@ open class BaseLedUIViewModel : ViewModel() {
}
}
private fun showUI(msg: LedUI) {
private suspend fun showUI(msg: LedUI) {
Log.i(TAG, "showUI ledUI=${msg.javaClass.simpleName}[priority=${msg.priority}]")
// 如果当前类型是 需要打断恢复的,放入等待队列
if (currentLedUI.interruptRestore) {
@@ -157,7 +157,7 @@ open class BaseLedUIViewModel : ViewModel() {
}
}
private fun dismissUI(msg: LedUI) {
private suspend fun dismissUI(msg: LedUI) {
Log.i(TAG, "dismissUI ledUI=${msg.javaClass.simpleName}[priority=${msg.priority}]")
currentCountDownJob?.also {
it.cancel()
@@ -166,7 +166,7 @@ open class BaseLedUIViewModel : ViewModel() {
restoreLastUI()
}
private fun restoreLastUI() {
private suspend fun restoreLastUI() {
//恢复打断
val restoreUI = pollRestoreLedUI()
if (restoreUI != null) {
@@ -177,7 +177,7 @@ open class BaseLedUIViewModel : ViewModel() {
}
}
private fun startBasicUISwitchLoop() {
private suspend fun startBasicUISwitchLoop() {
if (currentRouteInfoUI != null) {
showUI(currentRouteInfoUI!!)
} else if (currentStationReportUI != null) {
@@ -193,7 +193,7 @@ open class BaseLedUIViewModel : ViewModel() {
kotlin.runCatching { baseUICountDownJob?.cancel() }
}
private fun basicUISwitchInternal() {
private suspend fun basicUISwitchInternal() {
Log.i(TAG, "baseUISwitchInternal()")
cancelBasicUISwitch()
viewModelScope.launch {