This commit is contained in:
zhongchao
2022-03-17 19:06:22 +08:00
parent 22c7920027
commit ee881c99e7
33 changed files with 330 additions and 403 deletions

View File

@@ -138,4 +138,18 @@ object CallerAutoPilotManager {
fun isConnected(): Boolean {
return providerApi?.isConnected() ?: false
}
/**
* 查询工控机基础配置信息
*/
fun getCarConfig(){
providerApi?.getCarConfig()
}
/**
* 获取全局路径
*/
fun getGlobalPath(){
providerApi?.getGlobalPath()
}
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.call.devatools
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import java.util.concurrent.ConcurrentHashMap
@@ -64,4 +65,11 @@ object CallerDevaToolsListenerManager {
}
}
fun invokeDevaToolsModuleLogChanges(moduleTag: MutableMap<String, SceneModule>){
M_DEVA_TOOLS_LISTENER.forEach {
val listener = it.value
listener.moduleLogChanged(moduleTag)
}
}
}

View File

@@ -4,7 +4,9 @@ import android.content.Context
import android.view.ContextMenu
import android.view.View
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.chain.ChainLogParam
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import record_cache.RecordPanelOuterClass
@@ -53,6 +55,35 @@ object CallerDevaToolsManager {
return devaToolsProviderApi?.getTraceInfo() ?: HashMap()
}
/**
* 更新模块TAG
*/
fun getModuleTAG(): MutableMap<String, SceneModule>? {
return devaToolsProviderApi?.getModuleTAG()
}
/**
* 更新模块TAG
*/
fun updateModuleTAG(moduleTag: MutableMap<String, SceneModule>) {
devaToolsProviderApi?.updateModuleTAG(moduleTag)
}
/**
* 获取场景TAG
* 注:现阶段返回 网约车场景,包含 TAXI , BUS
*/
fun getSceneLogTAG(): MutableMap<String, SceneTAG>? {
return devaToolsProviderApi?.getSceneLogTAG()
}
/**
* 更新场景TAG
*/
fun updateSceneTAG(sceneTag: MutableMap<String, SceneTAG>) {
devaToolsProviderApi?.updateSceneTAG(sceneTag)
}
/**
* 初始化BadCase相关配置
*/

View File

@@ -1,94 +0,0 @@
package com.mogo.eagle.core.function.call.devatools.scene
import android.util.ArrayMap
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NETWORK
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneLogCache
import java.util.*
class Scene {
companion object {
private val sceneCache: MutableMap<String, SceneLogCache> =
Collections.synchronizedMap(ArrayMap())
val scene: Scene by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
Scene()
}
}
init {
//初始化网络
val networkMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_NETWORK] = networkMap
//初始化ADAS
val adasMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_ADAS_IMPL] = adasMap
//初始化deva
val devaMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_DEVA] = devaMap
//初始化路径规划
val routeMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_OLD_ROUTE] = routeMap
//初始化其他模块,方便定位索引
val otherMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_OTHER] = otherMap
}
fun check(tag: String): Boolean {
return if (canLog()) {
classifyLog(tag)
} else {
false
}
}
//前置收口
private fun canLog(): Boolean {
return true
}
/**
* log分类,现阶段通过控制模块等级来限制,后续有需要再细分至模块对应类层级
*/
private fun classifyLog(tag: String): Boolean {
var moduleName: String? = null
var businessName: String? = null
if (tag.contains("_")) {
val tagSplit = tag.split("_")
moduleName = tagSplit[0]
if (tagSplit.size > 1) {
businessName = tagSplit[1]
}
}
if (moduleName.isNullOrEmpty()) {
val otherLogCache = sceneCache[M_OTHER]
otherLogCache!!.tagMap!![tag] = true
return otherLogCache.logger
}
if (businessName.isNullOrEmpty()) {
return false
}
//此处存在用户自定义方式,可根据过滤找到对应不符合标准的模块
var logCache = sceneCache[moduleName]
if (logCache == null) {
logCache = SceneLogCache(mutableMapOf(), true)
logCache.tagMap!![businessName] = true
}
sceneCache[moduleName] = logCache
return logCache.logger
}
}