[BadCase]BadCase入口触发超过4小时,不展示

This commit is contained in:
renwj
2022-05-09 17:09:31 +08:00
parent 6ab6caccc7
commit 1ce99f8cdb
6 changed files with 24 additions and 10 deletions

View File

@@ -175,6 +175,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
autopilotState: MessagePad.AutopilotState?
) {
if (autopilotState != null) {
//工控机模拟时间
CallerAutopilotVehicleStateListenerManager.invokeAutopilotTime(header.timestamp.toLong())
if (HdMapBuildConfig.isMapLoaded) {
// 初始化自动驾驶状态信息
val autopilotStatusInfo = getAutoPilotStatusInfo()

View File

@@ -14,6 +14,7 @@ import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.kotlin.PX
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -193,7 +194,7 @@ internal object BadCaseManager : LifecycleEventObserver {
private fun CoroutineScope.showBadCaseInternal(record: AutoPilotRecord) = launch {
viewHolder?.get()?.also { itx ->
presenter.updateLastModified(record.toLongTime())
presenter.updateLastModified(CallerAutopilotVehicleStateListenerManager.getAutopilotTimeStamp())
showEntry()
itx.onClick {
showBadCaseFloat(

View File

@@ -30,5 +30,4 @@ interface IMoGoAutopilotVehicleStateListener {
* @param gear 档位
*/
fun onAutopilotGearData(gear: Chassis.GearPosition)
}

View File

@@ -15,6 +15,9 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
private val M_AUTOPILOT_VEHICLE_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotVehicleStateListener> =
ConcurrentHashMap()
@Volatile
private var timeStamp: Long = 0L
/**
* 添加 ADAS车辆状态&定位 监听
* @param tag 标记,用来注销监听使用
@@ -57,7 +60,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
* 车辆转向灯数据回调
* @param lightSwitch
*/
@Synchronized
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
val listener = it.value
@@ -69,7 +71,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
* 车辆刹车灯数据回调
* @param brakeLight
*/
@Synchronized
fun invokeAutopilotBrakeLightData(brakeLight: Boolean) {
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
val listener = it.value
@@ -81,7 +82,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
* 车辆方向盘转向角回调
* @param steering 方向盘转向角
*/
@Synchronized
fun invokeAutopilotSteeringData(steering: Float){
M_AUTOPILOT_VEHICLE_LISTENERS.forEach{
val listener = it.value
@@ -93,7 +93,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
* 车辆挂挡档位
* @param gear 档位
*/
@Synchronized
fun invokeAutopilotGearData(gear: Chassis.GearPosition){
M_AUTOPILOT_VEHICLE_LISTENERS.forEach{
val listener = it.value
@@ -101,5 +100,17 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
}
}
/**
* 工控机时间回调
*/
fun invokeAutopilotTime(time: Long) {
this.timeStamp = time
}
/**
* 获取工控机的时间, 单位是秒
*/
fun getAutopilotTimeStamp(): Long {
return this.timeStamp
}
}