[6.4.0][启自驾指引] 优化代码逻辑
This commit is contained in:
@@ -19,7 +19,7 @@ import com.zhjt.mogo_core_function_devatools.status.entity.RTKStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.Status
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
//import com.zhjt.mogo_core_function_devatools.status.entity.NetStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteStart //import com.zhjt.mogo_core_function_devatools.status.entity.NetStatus
|
||||
import com.zhjt.mogo_core_function_devatools.status.model.StatusModel
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.OverViewImpl
|
||||
@@ -186,7 +186,16 @@ object StatusManager {
|
||||
}?.forEachIndexed { index, status ->
|
||||
val shl = 1 shl index
|
||||
if (status.isException()) {
|
||||
ret = ret or shl
|
||||
ret = if (status is RouteDownloadStatus) {
|
||||
if (status.state == RouteStart) {
|
||||
ret or shl
|
||||
} else {
|
||||
ret or (shl shl 1)
|
||||
}
|
||||
} else {
|
||||
ret or shl
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ret
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.status.entity
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteFailed
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteNone
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.RouteState.RouteStart
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
|
||||
|
||||
@@ -461,7 +462,7 @@ enum class RouteState {
|
||||
data class RouteDownloadStatus(val lineId: Long = -1, val state: RouteState = RouteNone): Status(), IAutopilotPreLaunchStatus {
|
||||
|
||||
override fun isException(): Boolean {
|
||||
return state == RouteFailed
|
||||
return state == RouteStart || state == RouteFailed
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
|
||||
@@ -25,8 +25,8 @@ internal class StatusModel : ViewModel() {
|
||||
it += BrakeStatus(0.0f)
|
||||
it += DoubleFlashStatus(0)
|
||||
it += GearStatus(0)
|
||||
it += SpeedStatus(0f)
|
||||
it += RouteDownloadStatus()
|
||||
it += SpeedStatus(0f)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ object CallerAutoPilotControlManager {
|
||||
* 刹车: 1<<2
|
||||
* 双闪: 1<<3
|
||||
* 档位: 1<<4
|
||||
* 轨迹下载: (下载中) 1<<5; (下载失败)1<<6
|
||||
*/
|
||||
val exceptionValue = CallerDevaToolsManager.getExceptionStatusBeforeLaunchAutopilot()
|
||||
if (exceptionValue != 0) {
|
||||
@@ -95,6 +96,10 @@ object CallerAutoPilotControlManager {
|
||||
if ((exceptionValue and (1 shl 4)) != 0) {
|
||||
sb.append("档位$")
|
||||
}
|
||||
if ((exceptionValue and (1 shl 5)) != 0 || ((exceptionValue and (1 shl 6)) != 0)) {
|
||||
sb.setLength(0)
|
||||
sb.append("轨迹未就绪,请稍后重试")
|
||||
}
|
||||
val voiceText = sb.toString().let { str ->
|
||||
val count = str.count { it == '$' }
|
||||
if (count == 1) {
|
||||
|
||||
Reference in New Issue
Block a user