add chain log of startAutopilot(bus and taxi), add new func of upload map log:
This commit is contained in:
@@ -3,9 +3,15 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
import android.os.SystemClock
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
@@ -43,6 +49,14 @@ object CallerAutoPilotManager {
|
||||
*
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_LINK_ADAS,
|
||||
endpoint = TracingConstants.Endpoint.PAD,
|
||||
nodeAliasCode = CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT,
|
||||
paramIndexes = [0],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters == null) {
|
||||
//LogUtils.eTag(TAG, "自动驾驶控制参数异常,请检查参数信息")
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
||||
object CallerMapDevaListenerManager : CallerBase() {
|
||||
|
||||
private val mMapDevaListeners: ConcurrentHashMap<String, IMoGoMapDevaProvider> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
private var filePath: String? = null
|
||||
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoMapDevaProvider
|
||||
) {
|
||||
if (mMapDevaListeners.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMapDevaListeners[tag] = listener
|
||||
filePath?.let {
|
||||
listener.uploadFile(it)
|
||||
}
|
||||
}
|
||||
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!mMapDevaListeners.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
mMapDevaListeners.remove(tag)
|
||||
}
|
||||
|
||||
fun removeListener(@Nullable listener: IMoGoMapDevaProvider) {
|
||||
if (!mMapDevaListeners.containsValue(listener)) {
|
||||
return
|
||||
}
|
||||
mMapDevaListeners.forEach {
|
||||
if (it.value == listener) {
|
||||
mMapDevaListeners.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeUploadLogFile(filePath: String) {
|
||||
this.filePath = filePath
|
||||
mMapDevaListeners.forEach {
|
||||
val listener = it.value
|
||||
listener.uploadFile(filePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user