[状态栏][算路/循迹]优化自动驾驶状态逻辑判断

This commit is contained in:
renwj
2022-09-14 17:57:24 +08:00
parent 53172adfae
commit ead7f12039
2 changed files with 4 additions and 3 deletions

View File

@@ -204,7 +204,7 @@ class TracingStatus(var state: Tracing = UNKNOWN): Status() {
TRACK_FINDED, TRACK_NOT_EXIST, TRACK_LOAD_FAIL, ROUTE_FAILED, UNKNOWN -> true
else -> false
}
val c2 = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE
val c2 = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
return c1 and c2
}
}

View File

@@ -4,6 +4,7 @@ import android.content.*
import android.util.*
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
import com.mogo.eagle.core.function.call.autopilot.*
import com.zhjt.mogo_core_function_devatools.status.entity.*
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.*
@@ -46,11 +47,11 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
super.onAutopilotStatusResponse(autoPilotStatusInfo)
if (autoPilotStatusInfo.state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE) {
if (autoPilotStatusInfo.state != STATUS_AUTOPILOT_RUNNING) {
send(TracingStatus(UNKNOWN))
return
}
if (old.isException() && autoPilotStatusInfo.state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (old.isException() && autoPilotStatusInfo.state == STATUS_AUTOPILOT_RUNNING) {
send(TracingStatus(TRACK_LOADED))
}
}