[状态栏][算路/循迹]优化自动驾驶状态逻辑判断
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user