[6.2.4] fix bug of request in main thread

This commit is contained in:
zhongchao
2023-12-05 14:29:54 +08:00
parent d716b618a7
commit 5b40018700
11 changed files with 37 additions and 150 deletions

View File

@@ -26,6 +26,9 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
if (newValue == null) {
return@observable
}
if(newValue == 0L){
mAutopilotStatusInfo.isArriveAtStation = false
}
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotRouteLineId(newValue)
@@ -34,7 +37,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
fixAtStationState(newValue)
//todo emArrow chainLog
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponse(newValue)
@@ -42,19 +45,6 @@ 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 {