Merge branch 'dev_robotaxi-d-app-module_270_220510_2.7.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_270_220510_2.7.0
This commit is contained in:
@@ -154,9 +154,15 @@ internal class TracingStatus(var state: Tracing = UNKNOWN): Status() {
|
||||
*/
|
||||
ROUTE_FAILED("EMAP_HADMAP_ENGINE_NO_ROUTING_INFO"),
|
||||
|
||||
/**
|
||||
* 未知状态
|
||||
*/
|
||||
UNKNOWN;
|
||||
|
||||
fun isException(): Boolean = this == TRACK_FINDED || this == TRACK_NOT_EXIST || this == TRACK_LOAD_FAIL || this == ROUTE_FAILED || this == UNKNOWN
|
||||
fun isException(): Boolean = when (this) {
|
||||
TRACK_FINDED, TRACK_NOT_EXIST, TRACK_LOAD_FAIL, ROUTE_FAILED, UNKNOWN -> true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
@@ -178,7 +184,7 @@ internal class TracingStatus(var state: Tracing = UNKNOWN): Status() {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun String.toState(): Tracing {
|
||||
internal fun String.toState(): Tracing? {
|
||||
return when(this) {
|
||||
"IMAP_TRA_EXIST" -> TRACK_FINDED
|
||||
"IMAP_TRA_LOADED" -> TRACK_LOADED
|
||||
@@ -186,6 +192,6 @@ internal fun String.toState(): Tracing {
|
||||
"EMAP_TRA_LOAD_FAILED" -> TRACK_LOAD_FAIL
|
||||
"IMAP_TRA_ROUTING" -> ROUTE_LOADED
|
||||
"EMAP_HADMAP_ENGINE_NO_ROUTING_INFO" -> ROUTE_FAILED
|
||||
else -> UNKNOWN
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.zhjt.mogo_core_function_devatools.status.flow.trace
|
||||
|
||||
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.call.autopilot.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.*
|
||||
import com.zhjt.mogo_core_function_devatools.status.entity.TracingStatus.Tracing.UNKNOWN
|
||||
import com.zhjt.mogo_core_function_devatools.status.flow.*
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
|
||||
@@ -14,13 +16,14 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
|
||||
const val TAG = "TracingImpl"
|
||||
}
|
||||
|
||||
private var old: String = ""
|
||||
private var old: TracingStatus.Tracing = UNKNOWN
|
||||
|
||||
override fun onCreate() {
|
||||
Log.d(TAG, "-- onCreate --")
|
||||
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
|
||||
old = code
|
||||
send(TracingStatus(code.toState()))
|
||||
val state = code.toState() ?: UNKNOWN
|
||||
old = state
|
||||
send(TracingStatus(state))
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@@ -29,9 +32,18 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
val current = guardianInfo?.code
|
||||
Log.d(TAG, "-- onAutopilotGuardian --: $current")
|
||||
if (current != null && current != old) {
|
||||
send(TracingStatus(current.toState()))
|
||||
old = current
|
||||
val newState = current?.toState()
|
||||
if (newState != null && newState != old) {
|
||||
send(TracingStatus(newState))
|
||||
old = newState
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
super.onAutopilotStatusResponse(autoPilotStatusInfo)
|
||||
if (autoPilotStatusInfo.pilotmode != 1) {
|
||||
send(TracingStatus(UNKNOWN))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,10 @@ internal class StatusModel : ViewModel() {
|
||||
}
|
||||
}
|
||||
is TracingStatus -> {
|
||||
if (CallerAutoPilotManager.isConnected() && (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode == 1) && s.state.isException()) {
|
||||
val c1 = CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().pilotmode == 1
|
||||
val c2 = s.state.isException()
|
||||
Log.d(TAG, "getExceptionStatus-::c1: $c1 -> c2: $c2")
|
||||
if (c1 && c2) {
|
||||
s
|
||||
} else {
|
||||
null
|
||||
|
||||
@@ -73,6 +73,7 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
/**
|
||||
* 底盘的自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
@Volatile
|
||||
var pilotmode = 0
|
||||
|
||||
// 默认未连接
|
||||
|
||||
@@ -82,7 +82,7 @@ MOGO_LOCATION_VERSION=1.3.59
|
||||
MOGO_TELEMATIC_VERSION=1.3.59
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.2.0.5
|
||||
MAP_SDK_VERSION=2.2.0.6
|
||||
MAP_SDK_OPERATION_VERSION=1.0.13
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
Reference in New Issue
Block a user