[6.6.0] union the chassis state in one caller

This commit is contained in:
EmArrow
2024-08-21 17:11:05 +08:00
parent c53b9359cf
commit cbe8c27e4c
55 changed files with 789 additions and 818 deletions

View File

@@ -47,17 +47,10 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerBackCameraVideoListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerBatteryManagementSystemListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisAccStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisDoorStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGnssListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerFaultManagementStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerFsm2024ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerLocalizationStateListenerManager
@@ -194,27 +187,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
CallerAutopilotActionsListenerManager.setVehicleState(vehicleState)
if (vehicleState != null) {
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂档档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
// 处理车辆状态
CallerChassisStatesListenerManager.invokeStates(vehicleState)
//车门
CallerChassisDoorStateListenerManager.invokeAutopilotDoorState(vehicleState.doorStateList)
//电量
if (vehicleState.hasBmsSoc()) {
CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates(
ChassisStatesOuterClass.BMSSystemStates.newBuilder()
.setBmsSoc(vehicleState.bmsSoc).build()
)
}
//清扫车(福田)清扫控制系统状态
vehicleState.sweeperFutianCleanSystemState?.also { sweeperState ->
val bytes: ByteArray = sweeperState.toByteArray()
@@ -233,7 +209,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
CallerChassisStatesListenerManager.invokeStatesDataException(header.timestamp.toLong())
}
}
@@ -255,36 +231,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
CallerAutopilotActionsListenerManager.setChassisStates(chassisStates)
if (chassisStates != null) {
chassisStates.bcmSystemStates?.let { bcmSystemStates ->
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(bcmSystemStates.brakeLightState != 0)
}
chassisStates.steerSystemStates?.let {
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(it.steeringWheelAngle)
}
chassisStates.gearSystemStates?.let { gearSystemStates ->
gearSystemStates.gearPosition?.let {
//挂档档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(it)
}
}
chassisStates.vehicleMotionStates?.let {
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(it.acceleration)
}
chassisStates.drivingSystemStates?.let {
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
}
chassisStates.brakeSystemStates?.let {
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
}
chassisStates.bmsSystemStates?.let {
//电量
CallerBatteryManagementSystemListenerManager.invokeBatteryManagementSystemStates(it)
}
CallerChassisStatesListenerManager.invokeNewStates(chassisStates)
chassisStates.taskSystemStates?.let { taskSystemStates ->
taskSystemStates.sweeperFutianTaskSystemStates?.let {
//清扫车(福田)清扫控制系统状态
@@ -294,7 +241,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
CallerChassisStatesListenerManager.invokeStatesDataException(header.timestamp.toLong())
}
}
@@ -308,7 +255,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
*/
override fun onLightSwitch(light: Chassis.LightSwitch) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(light)
CallerChassisStatesListenerManager.invokeAutopilotLightSwitchData(light)
}
//自动驾驶状态
@@ -324,7 +271,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
) {
if (autopilotState != null) {
//工控机模拟时间
CallerAutopilotVehicleStateListenerManager.invokeAutopilotTime(header.timestamp.toLong())
updateAutoPilotStatus(autopilotState.state, autopilotState.autopilotMode)
}
}

View File

@@ -2,16 +2,17 @@ package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
import android.content.Context
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_THROTTLE
import com.zhjt.mogo_core_function_devatools.status.entity.AcceleratorStatus
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
internal class AcceleratorImpl(ctx: Context): IFlow<AcceleratorStatus>(ctx), IMoGoChassisThrottleStateListener, IMoGoAutopilotActionsListener {
internal class AcceleratorImpl(ctx: Context): IFlow<AcceleratorStatus>(ctx),
IMoGoChassisStatesListener, IMoGoAutopilotActionsListener {
companion object {
@@ -28,13 +29,13 @@ internal class AcceleratorImpl(ctx: Context): IFlow<AcceleratorStatus>(ctx), IMo
private var extra: Any? = null
override fun onCreate() {
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerChassisThrottleStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
}

View File

@@ -2,16 +2,16 @@ package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
import android.content.Context
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_BRAKE
import com.zhjt.mogo_core_function_devatools.status.entity.BrakeStatus
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
internal class BrakeImpl(ctx: Context): IFlow<BrakeStatus>(ctx), IMoGoChassisBrakeStateListener, IMoGoAutopilotActionsListener {
internal class BrakeImpl(ctx: Context): IFlow<BrakeStatus>(ctx), IMoGoChassisStatesListener, IMoGoAutopilotActionsListener {
companion object {
private const val TAG = "BrakeImpl"
@@ -27,13 +27,13 @@ internal class BrakeImpl(ctx: Context): IFlow<BrakeStatus>(ctx), IMoGoChassisBra
private var extra: Any? = null
override fun onCreate() {
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerChassisBrakeStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
}

View File

@@ -4,17 +4,19 @@ import android.content.Context
import chassis.Chassis.LightSwitch
import chassis.Chassis.LightSwitch.LIGHT_FLASH
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_HAZARD_LIGHTS
import com.zhjt.mogo_core_function_devatools.status.entity.DoubleFlashStatus
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
internal class DoubleFlashImpl(ctx: Context): IFlow<DoubleFlashStatus>(ctx), IMoGoChassisLamplightListener, IMoGoAutopilotActionsListener {
internal class DoubleFlashImpl(ctx: Context): IFlow<DoubleFlashStatus>(ctx),
IMoGoChassisStatesListener, IMoGoAutopilotActionsListener {
companion object {
private const val TAG = "DoubleFlashImpl"
@@ -30,19 +32,19 @@ internal class DoubleFlashImpl(ctx: Context): IFlow<DoubleFlashStatus>(ctx), IMo
private var extra: Any? = null
override fun onCreate() {
CallerChassisLamplightListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
}
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
super.onAutopilotLightSwitchData(lightSwitch)
Logger.d(TAG, "-- onAutopilotLightSwitchData --: $lightSwitch")
CallerLogger.d("$M_DEVA$TAG", "-- onAutopilotLightSwitchData --: $lightSwitch")
if (last != lightSwitch) {
last = lightSwitch
if (lightSwitch == LIGHT_FLASH) {

View File

@@ -4,16 +4,17 @@ import android.content.Context
import chassis.Chassis.GearPosition
import chassis.Chassis.GearPosition.GEAR_NONE
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_GEAR
import com.zhjt.mogo_core_function_devatools.status.entity.GearStatus
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
internal class GearImpl(ctx: Context): IFlow<GearStatus>(ctx), IMoGoChassisGearStateListener, IMoGoAutopilotActionsListener {
internal class GearImpl(ctx: Context): IFlow<GearStatus>(ctx), IMoGoAutopilotActionsListener,
IMoGoChassisStatesListener {
companion object {
private const val TAG = "GeerImpl"
@@ -29,13 +30,13 @@ internal class GearImpl(ctx: Context): IFlow<GearStatus>(ctx), IMoGoChassisGearS
private var extra: Any? = null
override fun onCreate() {
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerChassisGearStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
}

View File

@@ -2,9 +2,9 @@ package com.zhjt.mogo_core_function_devatools.status.flow.autopilot
import android.content.Context
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
@@ -12,7 +12,7 @@ import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.UnableType.CHASSIS_STEERI
import com.zhjt.mogo_core_function_devatools.status.entity.SteerStatus
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
internal class SteerImpl(ctx: Context): IFlow<SteerStatus>(ctx), IMoGoChassisSteeringStateListener, IMoGoAutopilotActionsListener {
internal class SteerImpl(ctx: Context): IFlow<SteerStatus>(ctx), IMoGoChassisStatesListener, IMoGoAutopilotActionsListener {
companion object {
private const val TAG = "SteerImpl"
@@ -28,13 +28,13 @@ internal class SteerImpl(ctx: Context): IFlow<SteerStatus>(ctx), IMoGoChassisSte
private var extra: Any? = null
override fun onCreate() {
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutopilotActionsListenerManager.addListener(TAG, this)
}
override fun onDestroy() {
super.onDestroy()
CallerChassisSteeringStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutopilotActionsListenerManager.removeListener(TAG)
}

View File

@@ -5,8 +5,11 @@ import android.util.Log
import chassis.Chassis.GearPosition
import chassis.Chassis.LightSwitch
import chassis.ChassisStatesOuterClass
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
@@ -19,19 +22,10 @@ import system_master.SystemStatusInfo.StatusInfo
import java.util.concurrent.atomic.AtomicInteger
internal class CanImpl(ctx: Context) :
IFlow<CanStatus>(ctx),
IMoGoAutopilotVehicleStateListener,
IMoGoChassisAccStateListener,
IMoGoChassisSteeringStateListener,
IMoGoChassisGearStateListener,
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoAutopilotStatusListener,
IMoGoChassisLamplightListener,
IMoGoSweeperFutianCleanSystemListener {
IFlow<CanStatus>(ctx),
IMoGoChassisStatesListener,
IMoGoAutopilotStatusListener,
IMoGoSweeperFutianCleanSystemListener {
companion object {
const val TAG = "CanImpl"
@@ -43,14 +37,8 @@ internal class CanImpl(ctx: Context) :
override fun onCreate() {
send(CanStatus(CallerAutoPilotStatusListenerManager.isConnect()))
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerChassisLamplightListenerManager.addListener(TAG, this)
}
override fun onAutopilotLightSwitchData(lightSwitch: LightSwitch?) {
@@ -75,7 +63,10 @@ internal class CanImpl(ctx: Context) :
send(CanStatus(isCanEnabled()))
}
override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {
override fun onAutopilotIpcConnectStatusChanged(
status: AdasConstants.IpcConnectionStatus,
reason: String?
) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
send(CanStatus(isCanEnabled()))
}
@@ -101,16 +92,19 @@ internal class CanImpl(ctx: Context) :
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
send(CanStatus(isCanEnabled()))
}
override fun onSweeperFutianTaskIndexData(roboSweeperTaskIndex: RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex) {
}
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) {
super.onAutopilotGuardian(guardianInfo)
send(CanStatus(isCanEnabled()))
}
override fun onAutopilotStatusRespByQuery(status: StatusInfo) {
val state = status.healthInfoList?.find { "can_adapter".equals(it.name, true) }?.state?.ordinal
val state =
status.healthInfoList?.find { "can_adapter".equals(it.name, true) }?.state?.ordinal
Log.d(TAG, "state: $state")
if (state != null) {
this.state.set(state)
@@ -118,7 +112,8 @@ internal class CanImpl(ctx: Context) :
}
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
val state = statusInf.healthInfoList?.find { "can_adapter".equals(it.name, true) }?.state?.ordinal
val state =
statusInf.healthInfoList?.find { "can_adapter".equals(it.name, true) }?.state?.ordinal
Log.d(TAG, "state: $state")
if (state != null) {
this.state.set(state)
@@ -128,12 +123,7 @@ internal class CanImpl(ctx: Context) :
override fun onDestroy() {
super.onDestroy()
job?.safeCancel()
CallerChassisAccStateListenerManager.removeListener(TAG)
CallerChassisBrakeStateListenerManager.removeListener(TAG)
CallerChassisGearStateListenerManager.removeListener(TAG)
CallerChassisSteeringStateListenerManager.removeListener(TAG)
CallerChassisThrottleStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerChassisLamplightListenerManager.removeListener(TAG)
}
}

View File

@@ -24,7 +24,7 @@ import kotlinx.coroutines.flow.*
import java.util.concurrent.atomic.AtomicReference
import kotlin.math.*
class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChassisSteeringStateListener {
class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChassisStatesListener {
constructor(context: Context?) : super(context)
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
@@ -279,7 +279,7 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(true)
scope.launch(ThreadUtils.getCpuPool().asCoroutineDispatcher()) {
CallerDevaToolsManager.lookAroundProvider()?.flow()?.also { flow ->
@@ -306,7 +306,7 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisSteeringStateListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(false)
handler.get()?.looper?.quitSafely()
}

View File

@@ -27,7 +27,6 @@ import androidx.core.view.MenuCompat
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import chassis.Chassis
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.cloud.network.cronet.NetworkQualityListener
import com.mogo.cloud.network.cronet.QuicConfig
import com.mogo.cloud.passport.MoGoAiCloudClient
@@ -41,7 +40,6 @@ import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.config.JunkConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD
@@ -58,7 +56,13 @@ import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.multidisplay.TelematicConstant
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianCleanSystemListener
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuConnectListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuInfoListener
@@ -68,14 +72,20 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_DEMO
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.FUNC_MODE_RAIN
import com.mogo.eagle.core.function.api.setting.ISopSettingListener
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudCertManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
@@ -98,22 +108,213 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.AppUtils
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.CommonUtils
import com.mogo.eagle.core.utilcode.util.DeviceUtils
import com.mogo.eagle.core.utilcode.util.KeyboardUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils
import com.mogo.eagle.core.utilcode.util.ScreenUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.map.MogoData.Companion.mogoMapData
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.test.crashreport.CrashReportConstants
import com.mogo.test.crashreport.ITestCrashReportProvider
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
import com.mogo.tts.base.IMogoTTSCallback
import com.zhidaoauto.map.data.road.RoadCross
import com.zhjt.mogo.adas.data.AdasConstants
import com.zhjt.service.chain.ChainLog
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.coroutines.*
import kotlinx.android.synthetic.main.view_debug_setting.view.appVersionInfoLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.brakeThresholdDivider
import kotlinx.android.synthetic.main.view_debug_setting.view.btChangeEnv
import kotlinx.android.synthetic.main.view_debug_setting.view.btnAppReboot
import kotlinx.android.synthetic.main.view_debug_setting.view.btnBrakeThreshold
import kotlinx.android.synthetic.main.view_debug_setting.view.btnConnectServerIp
import kotlinx.android.synthetic.main.view_debug_setting.view.btnDisconnectIpc
import kotlinx.android.synthetic.main.view_debug_setting.view.btnDrawFusion
import kotlinx.android.synthetic.main.view_debug_setting.view.btnIpcReboot
import kotlinx.android.synthetic.main.view_debug_setting.view.btnPointCloudColor
import kotlinx.android.synthetic.main.view_debug_setting.view.btnPointCloudSize
import kotlinx.android.synthetic.main.view_debug_setting.view.btnRecordBag
import kotlinx.android.synthetic.main.view_debug_setting.view.btnRecordPackage
import kotlinx.android.synthetic.main.view_debug_setting.view.btnSetAutopilotIP
import kotlinx.android.synthetic.main.view_debug_setting.view.btnSetFifty
import kotlinx.android.synthetic.main.view_debug_setting.view.btnSetObuIP
import kotlinx.android.synthetic.main.view_debug_setting.view.btnSetOneHundred
import kotlinx.android.synthetic.main.view_debug_setting.view.btnStartTTS
import kotlinx.android.synthetic.main.view_debug_setting.view.btnThresholdDefine
import kotlinx.android.synthetic.main.view_debug_setting.view.btn_cache_hd_map
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasAutoPilot
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasDataTrack
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasTrafficlight
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasTrajectory
import kotlinx.android.synthetic.main.view_debug_setting.view.cbAdasVehicle
import kotlinx.android.synthetic.main.view_debug_setting.view.cbBusLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbDevaLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbHmiLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbMapLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbNetworkLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbObuLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbSsl
import kotlinx.android.synthetic.main.view_debug_setting.view.cbSweeperPLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbTaxiLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbTaxiPLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbTraceLog
import kotlinx.android.synthetic.main.view_debug_setting.view.cbV2xLog
import kotlinx.android.synthetic.main.view_debug_setting.view.changesight_back_btn
import kotlinx.android.synthetic.main.view_debug_setting.view.changesight_cross_btn
import kotlinx.android.synthetic.main.view_debug_setting.view.changesight_far_btn
import kotlinx.android.synthetic.main.view_debug_setting.view.changesight_top_btn
import kotlinx.android.synthetic.main.view_debug_setting.view.clDebugContain
import kotlinx.android.synthetic.main.view_debug_setting.view.commonLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.controlCenterLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.deviceBindLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.domainControllerLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.eagleEyeControllerLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.etAutopilotIP
import kotlinx.android.synthetic.main.view_debug_setting.view.etConnectServerIp
import kotlinx.android.synthetic.main.view_debug_setting.view.etInputBrakeThreshold
import kotlinx.android.synthetic.main.view_debug_setting.view.etInputRecordBagTime
import kotlinx.android.synthetic.main.view_debug_setting.view.etInputRecordTime
import kotlinx.android.synthetic.main.view_debug_setting.view.etLogCatch
import kotlinx.android.synthetic.main.view_debug_setting.view.etObuIP
import kotlinx.android.synthetic.main.view_debug_setting.view.etPointCloudColor
import kotlinx.android.synthetic.main.view_debug_setting.view.etPointCloudSize
import kotlinx.android.synthetic.main.view_debug_setting.view.etTTSContent
import kotlinx.android.synthetic.main.view_debug_setting.view.etThreshold
import kotlinx.android.synthetic.main.view_debug_setting.view.exportAllLogs
import kotlinx.android.synthetic.main.view_debug_setting.view.hdMapControllerLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.hmiControllerLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.logLoadingView
import kotlinx.android.synthetic.main.view_debug_setting.view.logcatCenterLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.obuConnectStatusTv
import kotlinx.android.synthetic.main.view_debug_setting.view.obuControllerLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.reportMsgLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.reset_changesight
import kotlinx.android.synthetic.main.view_debug_setting.view.rgGpsProvider
import kotlinx.android.synthetic.main.view_debug_setting.view.statusCenterLayout
import kotlinx.android.synthetic.main.view_debug_setting.view.swDevelopMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbADASLog
import kotlinx.android.synthetic.main.view_debug_setting.view.tbAppUpgrade
import kotlinx.android.synthetic.main.view_debug_setting.view.tbAppVersionInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tbBeautyMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbBusStationStrategyBorderPoint
import kotlinx.android.synthetic.main.view_debug_setting.view.tbCarAperture
import kotlinx.android.synthetic.main.view_debug_setting.view.tbChangeAutoPilotStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tbChangeCurrentCarIcon
import kotlinx.android.synthetic.main.view_debug_setting.view.tbChangeCurrentSkinMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbControlCenter
import kotlinx.android.synthetic.main.view_debug_setting.view.tbControlPassengerDriverMonitor
import kotlinx.android.synthetic.main.view_debug_setting.view.tbCronet
import kotlinx.android.synthetic.main.view_debug_setting.view.tbDeviceBind
import kotlinx.android.synthetic.main.view_debug_setting.view.tbDomainController
import kotlinx.android.synthetic.main.view_debug_setting.view.tbDrawPointCloudData
import kotlinx.android.synthetic.main.view_debug_setting.view.tbEagleEyeController
import kotlinx.android.synthetic.main.view_debug_setting.view.tbHdMapController
import kotlinx.android.synthetic.main.view_debug_setting.view.tbHdMapLog
import kotlinx.android.synthetic.main.view_debug_setting.view.tbHmiController
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDemoMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDrawAutopilotTrajectoryData
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDrawIdentifyData
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDrawPath
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsDrawUnknownIdentifyData
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsRainMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbIsStrictMode
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogCatch
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogDebugView
import kotlinx.android.synthetic.main.view_debug_setting.view.tbLogcatCenter
import kotlinx.android.synthetic.main.view_debug_setting.view.tbNetLog
import kotlinx.android.synthetic.main.view_debug_setting.view.tbObuController
import kotlinx.android.synthetic.main.view_debug_setting.view.tbObuLog
import kotlinx.android.synthetic.main.view_debug_setting.view.tbObuWarningFusionUnion
import kotlinx.android.synthetic.main.view_debug_setting.view.tbOpenAcceleration
import kotlinx.android.synthetic.main.view_debug_setting.view.tbOpenSnBinding
import kotlinx.android.synthetic.main.view_debug_setting.view.tbReportMore
import kotlinx.android.synthetic.main.view_debug_setting.view.tbReportWarning
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
import kotlinx.android.synthetic.main.view_debug_setting.view.tbSelfLog
import kotlinx.android.synthetic.main.view_debug_setting.view.tbStartAutopilotCommand
import kotlinx.android.synthetic.main.view_debug_setting.view.tbStatusCenter
import kotlinx.android.synthetic.main.view_debug_setting.view.tbTTSCenter
import kotlinx.android.synthetic.main.view_debug_setting.view.tbTraceEnable
import kotlinx.android.synthetic.main.view_debug_setting.view.tbVehicleStateController
import kotlinx.android.synthetic.main.view_debug_setting.view.trackerIPCProvider
import kotlinx.android.synthetic.main.view_debug_setting.view.trackerProvider
import kotlinx.android.synthetic.main.view_debug_setting.view.ttsCenterContainer
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAppBuildTimeInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAppContent
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAppHost
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAppVersionName
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAppVersionNameKey
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAutopilotConnectStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAutopilotInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvAutopilotProtocolVersionInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvBackgroundOperation
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCarInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCarInfoCopy
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCarInfoCopyClip
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCertFile
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCmdbCarInfoContent
import kotlinx.android.synthetic.main.view_debug_setting.view.tvCurEnv
import kotlinx.android.synthetic.main.view_debug_setting.view.tvDriverServerStartupStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tvGearInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvGitBranchInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIPCMac
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIdentifyInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIdentifyInfoCopy
import kotlinx.android.synthetic.main.view_debug_setting.view.tvInternetEnvironment
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcConnectStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcInfoKey
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcProtocolVersionInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcVersionInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcVersionInfoClip
import kotlinx.android.synthetic.main.view_debug_setting.view.tvIpcVersionInfoKey
import kotlinx.android.synthetic.main.view_debug_setting.view.tvLocationEnabled
import kotlinx.android.synthetic.main.view_debug_setting.view.tvMoGoMapVersion
import kotlinx.android.synthetic.main.view_debug_setting.view.tvMoGoMapVersionKey
import kotlinx.android.synthetic.main.view_debug_setting.view.tvObuConnectStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tvObuInfoContent
import kotlinx.android.synthetic.main.view_debug_setting.view.tvPadCopyrightId
import kotlinx.android.synthetic.main.view_debug_setting.view.tvPadSn
import kotlinx.android.synthetic.main.view_debug_setting.view.tvPadSnClip
import kotlinx.android.synthetic.main.view_debug_setting.view.tvPadSnKey
import kotlinx.android.synthetic.main.view_debug_setting.view.tvPlateNumber
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportActions
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportCode
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportLevel
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportMsg
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportResult
import kotlinx.android.synthetic.main.view_debug_setting.view.tvReportSrc
import kotlinx.android.synthetic.main.view_debug_setting.view.tvRouteInfoSize
import kotlinx.android.synthetic.main.view_debug_setting.view.tvRouteInfoSizeCopy
import kotlinx.android.synthetic.main.view_debug_setting.view.tvServerEnvironment
import kotlinx.android.synthetic.main.view_debug_setting.view.tvServerSocketStatus
import kotlinx.android.synthetic.main.view_debug_setting.view.tvSteeringInfo
import kotlinx.android.synthetic.main.view_debug_setting.view.tvTelematicTimeStamp
import kotlinx.android.synthetic.main.view_debug_setting.view.tvTrajectoryInfoSize
import kotlinx.android.synthetic.main.view_debug_setting.view.tvTrajectoryInfoSizeCopy
import kotlinx.android.synthetic.main.view_debug_setting.view.tvUniqueDeviceId
import kotlinx.android.synthetic.main.view_debug_setting.view.vehicleStateLayout
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.text.SimpleDateFormat
import java.util.*
import java.util.Date
import java.util.Timer
import java.util.TimerTask
import java.util.concurrent.TimeUnit
import kotlin.collections.component1
import kotlin.collections.component2
@@ -142,13 +343,8 @@ internal class DebugSettingView @JvmOverloads constructor(
IMoGoPlanningRottingListener,
IMoGoPlanningTrajectoryListener,
IMoGoDevaToolsFuncConfigListener,
IMoGoChassisLamplightListener,
IMoGoDevaToolsListener,
IMoGoChassisAccStateListener,
IMoGoChassisSteeringStateListener,
IMoGoChassisGearStateListener,
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoChassisStatesListener,
IMoGoSweeperFutianCleanSystemListener,
IMoGoObuInfoListener,
ISopSettingListener, IViewControlListener, IMoGoCloudListener {
@@ -255,16 +451,10 @@ internal class DebugSettingView @JvmOverloads constructor(
// 添加 规划路径相关回调 监听
CallerPlanningRottingListenerManager.addListener(TAG, this)
CallerPlanningTrajectoryListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisThrottleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 底盘灯光数据 监听
CallerChassisLamplightListenerManager.addListener(TAG, this)
//添加 底盘数据 监听
CallerChassisStatesListenerManager.addListener(TAG, this)
//雨天、美化、点云设置同步
CallerSopSettingManager.addListener(TAG, this)
@@ -304,16 +494,10 @@ internal class DebugSettingView @JvmOverloads constructor(
// 移除 规划路径相关回调 监听
CallerPlanningRottingListenerManager.removeListener(TAG)
CallerPlanningTrajectoryListenerManager.removeListener(TAG)
// 移除 车辆底盘数据回调 监听
CallerChassisAccStateListenerManager.removeListener(TAG)
CallerChassisBrakeStateListenerManager.removeListener(TAG)
CallerChassisGearStateListenerManager.removeListener(TAG)
CallerChassisSteeringStateListenerManager.removeListener(TAG)
CallerChassisThrottleStateListenerManager.removeListener(TAG)
// 移除 开发套件工具接口 监听
CallerDevaToolsListenerManager.removeListener(TAG)
// 移除 底盘灯光数据 监听
CallerChassisLamplightListenerManager.removeListener(TAG)
// 移除 底盘数据 监听
CallerChassisStatesListenerManager.removeListener(TAG)
// 移除 obu获取信息 监听
CallerObuInfoListenerManager.removeListener(TAG)
//雨天、美化、点云设置同步

View File

@@ -8,14 +8,14 @@ import androidx.constraintlayout.widget.ConstraintLayout
import chassis.Chassis
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.Utils
import kotlinx.android.synthetic.main.view_steering_brake.view.*
@@ -25,7 +25,7 @@ import kotlinx.android.synthetic.main.view_steering_brake.view.*
* 刹车调用模型的逻辑暂时放入view。 转向不受影响
*/
class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayout(context, attrs),
IMoGoChassisLamplightListener, IMoGoChassisLocationWGS84Listener {
IMoGoChassisStatesListener, IMoGoChassisLocationWGS84Listener {
companion object {
private const val TAG = "SteeringBrakeView"
@@ -41,7 +41,7 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerChassisLamplightListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
}
@@ -91,7 +91,7 @@ class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayo
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
}

View File

@@ -12,9 +12,9 @@ import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.Chassis
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTurnLightListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.v2x.CallerTurnLightListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
@@ -30,7 +30,7 @@ open class TurnLightViewStatus @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoChassisLamplightListener,
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoChassisStatesListener,
IMoGoTurnLightListener {
companion object {
@@ -72,13 +72,13 @@ open class TurnLightViewStatus @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerChassisLamplightListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerTurnLightListenerManager.addListener(TAG,this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerTurnLightListenerManager.removeListener(TAG)
}

View File

@@ -13,11 +13,9 @@ import chassis.Chassis.GearPosition
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisSteeringStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isBus
@@ -35,8 +33,7 @@ import kotlin.math.abs
* 档位随CAN数据做切换和高亮显示
* @since: 4/7/22
*/
class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
IMoGoChassisGearStateListener {
class SteeringWheelView : ConstraintLayout, IMoGoChassisStatesListener {
private var autopilotIV: ImageView? = null
private var steeringTVL: TextView? = null
private var steeringTVR: TextView? = null
@@ -57,8 +54,7 @@ class SteeringWheelView : ConstraintLayout, IMoGoChassisSteeringStateListener,
}
initView()
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
CallerChassisGearStateListenerManager.addListener(TAG, this)
CallerChassisSteeringStateListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
tapPositionView?.updateWithGear(GearPosition.GEAR_R)
}

View File

@@ -1,169 +0,0 @@
package com.mogo.eagle.core.function.hmi.ui.widget;
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisBrakeStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisGearStateListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisThrottleStateListenerManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import org.jetbrains.annotations.NotNull;
import chassis.Chassis;
import mogo.telematics.pad.MessagePad;
/**
* @author Jing
* @description 速度 加速度 档位 刹车 油门状态值
* @since: 6/24/22
*/
public class TrafficDataView extends ConstraintLayout implements
IMoGoChassisGearStateListener ,
IMoGoChassisBrakeStateListener,
IMoGoChassisThrottleStateListener,
IMoGoAutopilotPlanningActionsListener {
private static final String TAG = "TrafficDataView";
private TapPositionView tapPositionView;
private TextView speedTextView;
private TextView accTextView;
private ImageView speedImage;
private ImageView brakeStatus;
private static final int MSG_SEND_UPDATE = 1;
private volatile double acceleration;
private volatile float mBrake;
private volatile float mThrottle;
@SuppressLint("HandlerLeak")
private final Handler handler = new Handler() {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if (msg.what == MSG_SEND_UPDATE) {
java.text.DecimalFormat mFormat = new java.text.DecimalFormat("0.0");
String accStr = mFormat.format(Math.abs(acceleration));
if (acceleration > 0f) {
accTextView.setText(accStr);
} else {
accTextView.setText("- " + accStr);
}
int state = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
if (state < STATUS_AUTOPILOT_RUNNING) {
if (mBrake > 0) {
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
} else if (mThrottle >= 0 && mBrake == 0) {
brakeStatus.setImageResource(R.drawable.traffic_data_accelerator);
} else {
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
}
}
if (state == 2) {
brakeStatus.setImageResource(R.drawable.traffic_data_empty);
}
}
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
}
};
public TrafficDataView(@NonNull Context context) {
super(context);
}
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView(context);
}
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
CallerChassisGearStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisBrakeStateListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisThrottleStateListenerManager.INSTANCE.addListener(TAG, this);
CallerPlanningActionsListenerManager.INSTANCE.addListener(TAG, this);
}
private void initView(@NonNull Context context) {
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
tapPositionView = findViewById(R.id.traffic_position);
speedImage = findViewById(R.id.speedImage);
speedTextView = findViewById(R.id.speedTextView);
accTextView = findViewById(R.id.speedAccTextView);
brakeStatus = findViewById(R.id.brakeStatus);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
CallerChassisGearStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisBrakeStateListenerManager.INSTANCE.removeListener(TAG);
CallerChassisThrottleStateListenerManager.INSTANCE.removeListener(TAG);
CallerPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
}
@Override
public void pncActions(@NonNull MessagePad.PlanningActionMsg planningActionMsg) {
acceleration = planningActionMsg.getDestinationAcc();
}
/**
* 档位
*/
@Override
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
ThreadUtils.runOnUiThread(() -> {
if (tapPositionView != null) {
tapPositionView.updateWithGear(gear);
}
});
}
@Override
public void onAutopilotBrake(float brake) {
mBrake = brake;
}
@Override
public void onAutopilotThrottle(float throttle) {
mThrottle = throttle;
}
/**
* value呈现
*/
public void updateSpeedWithValue(int newSpeed) {
if (speedTextView != null) {
speedTextView.setText(String.valueOf(newSpeed));
}
}
}

View File

@@ -0,0 +1,148 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import chassis.Chassis.GearPosition
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getState
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import mogo.telematics.pad.MessagePad.PlanningActionMsg
import java.text.DecimalFormat
import kotlin.math.abs
/**
* @author Jing
* @description 速度 加速度 档位 刹车 油门状态值
* @since: 6/24/22
*/
open class TrafficDataView : ConstraintLayout, IMoGoChassisStatesListener,
IMoGoAutopilotPlanningActionsListener {
private var tapPositionView: TapPositionView? = null
private var speedTextView: TextView? = null
private var accTextView: TextView? = null
private var speedImage: ImageView? = null
private var brakeStatus: ImageView? = null
@Volatile
private var acceleration = 0.0
@Volatile
private var mBrake = 0f
@Volatile
private var mThrottle = 0f
@SuppressLint("HandlerLeak")
private val handler: Handler = object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message) {
super.handleMessage(msg)
if (msg.what == MSG_SEND_UPDATE) {
val mFormat = DecimalFormat("0.0")
val accStr = mFormat.format(abs(acceleration))
if (acceleration > 0f) {
accTextView?.text = accStr
} else {
accTextView?.text = "- $accStr"
}
val state = getState()
if (state < IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
if (mBrake > 0) {
brakeStatus?.setImageResource(R.drawable.traffic_data_brake)
} else if (mThrottle >= 0 && mBrake == 0f) {
brakeStatus?.setImageResource(R.drawable.traffic_data_accelerator)
} else {
brakeStatus?.setImageResource(R.drawable.traffic_data_empty)
}
}
if (state == 2) {
brakeStatus?.setImageResource(R.drawable.traffic_data_empty)
}
}
sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L)
}
}
constructor(context: Context) : super(context)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
initView(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
constructor(
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int,
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes)
override fun onAttachedToWindow() {
super.onAttachedToWindow()
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L)
CallerChassisStatesListenerManager.addListener(TAG, this)
CallerPlanningActionsListenerManager.addListener(TAG, this)
}
private fun initView(context: Context) {
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this)
tapPositionView = findViewById(R.id.traffic_position)
speedImage = findViewById(R.id.speedImage)
speedTextView = findViewById(R.id.speedTextView)
accTextView = findViewById(R.id.speedAccTextView)
brakeStatus = findViewById(R.id.brakeStatus)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisStatesListenerManager.removeListener(TAG)
CallerPlanningActionsListenerManager.removeListener(TAG)
}
override fun pncActions(planningActionMsg: PlanningActionMsg) {
acceleration = planningActionMsg.destinationAcc
}
override fun onAutopilotGearData(gear: GearPosition) {
ThreadUtils.runOnUiThread {
tapPositionView?.updateWithGear(gear)
}
}
override fun onAutopilotBrake(brake: Float) {
mBrake = brake
}
override fun onAutopilotThrottle(throttle: Float) {
mThrottle = throttle
}
/**
* value呈现
*/
fun updateSpeedWithValue(newSpeed: Int) {
speedTextView?.text = newSpeed.toString()
}
companion object {
private const val TAG = "TrafficDataView"
private const val MSG_SEND_UPDATE = 1
}
}

View File

@@ -7,12 +7,10 @@ import androidx.lifecycle.LifecycleObserver
import chassis.Chassis
import com.mogo.eagle.core.data.config.FunctionBuildConfig.accThreshold
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.map.MogoMap
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
@@ -24,7 +22,7 @@ import kotlin.properties.Delegates
class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, attrs),
IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener, LifecycleObserver {
IMoGoChassisLocationWGS84Listener, IMoGoChassisStatesListener, LifecycleObserver {
companion object {
private const val TAG = "MapBizView"
@@ -35,7 +33,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
map?.uiController?.showMyLocation(true)
initMapView()
CallerChassisLocationWGS84ListenerManager.addListener(TAG, 20, this)
CallerChassisLamplightListenerManager.addListener(TAG, this)
CallerChassisStatesListenerManager.addListener(TAG, this)
}
@@ -138,7 +136,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
override fun onDestroy() {
// 先取消注册数据再onDestroy
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
CallerChassisLamplightListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
super.onDestroy()
}