[6.1.0][车前引导线] 优化因自驾状态未同步,导致引导线未绘制的问题

This commit is contained in:
renwj
2023-09-21 16:57:38 +08:00
parent d06c9b56fc
commit 0df219c58a
3 changed files with 29 additions and 71 deletions

View File

@@ -34,6 +34,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
fixAtStationState(newValue)
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponse(newValue)
@@ -41,6 +42,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private fun fixAtStationState(autoPilotMode: Int) {
if (autoPilotMode == 2) {
//自驾状态下将到站状态置为false
mAutopilotStatusInfo.isArriveAtStation = false
} else {
//其它状态下, 将到站状态置为false
val arriveAtStation = mAutopilotStatusInfo.isArriveAtStation
if (arriveAtStation) {
mAutopilotStatusInfo.isArriveAtStation = false
}
}
}
private var dockerV: String by Delegates.observable("") { _, oldValue, newValue ->
if (!oldValue.contentEquals(newValue)) {
M_LISTENERS.forEach {
@@ -105,6 +119,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
fun getAutoPilotReportMessageContent(): String = autoPilotMessageContent
fun isArriveAtStation(): Boolean = mAutopilotStatusInfo.isArriveAtStation
/**
* 通过Gnss定位更新来同步更新自动驾驶状态
*/
@@ -156,6 +172,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
@Synchronized
fun invokeArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
mAutopilotStatusInfo.isArriveAtStation = true
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotArriveAtStation(arrivalNotification)