[状态栏]更改是否自动驾驶状态判断逻辑

This commit is contained in:
renwj
2022-05-31 11:50:51 +08:00
parent 1064bff67b
commit cd491d5aa9
2 changed files with 4 additions and 2 deletions

View File

@@ -42,7 +42,8 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
super.onAutopilotStatusResponse(autoPilotStatusInfo)
if (autoPilotStatusInfo.pilotmode != 1) {
Log.d(TAG, "-- onAutopilotStatusResponse -- autopilotMode: ${autoPilotStatusInfo.pilotmode} :: state: ${autoPilotStatusInfo.state}")
if (autoPilotStatusInfo.state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
send(TracingStatus(UNKNOWN))
}
}

View File

@@ -2,6 +2,7 @@ package com.zhjt.mogo_core_function_devatools.status.model
import android.util.*
import androidx.lifecycle.*
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
import com.zhjt.mogo_core_function_devatools.status.entity.GpsStatus
@@ -83,7 +84,7 @@ internal class StatusModel : ViewModel() {
}
}
is TracingStatus -> {
val c1 = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode == 1
val c1 = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
val c2 = s.state.isException()
Log.d(TAG, "getExceptionStatus-::c1: $c1 -> c2: $c2")
if (c1 && c2) {