This commit is contained in:
zhongchao
2022-03-11 20:04:11 +08:00
parent c804f5162d
commit 5886f4feb7
81 changed files with 1689 additions and 1095 deletions

View File

@@ -77,10 +77,6 @@ object CallerAutoPilotManager {
providerApi?.setEnableLog(isEnableLog)
}
fun setIsWriteLog(isWriteLog: Boolean) {
providerApi?.setIsWriteLog(isWriteLog)
}
fun setAutoPilotSpeed(speed: Int): Boolean {
return providerApi?.setAutoPilotSpeed(speed) ?: false
}

View File

@@ -1,14 +1,13 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.util.concurrent.ConcurrentHashMap
/**
@@ -86,7 +85,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
*/
@Synchronized
fun invokeAutoPilotStatus() {
//LogUtils.dTag(TAG, "$mAutopilotStatusInfo")
invokeAutoPilotStatus(mAutopilotStatusInfo)
}
@@ -108,16 +106,14 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
/**
* 自动驾驶站点信息 回调
* @param autopilotStationInfo 自动驾驶网约车回调数据
* @param arrivalNotification 自动驾驶网约车回调数据
*/
@Synchronized
fun invokeArriveAtStation(autopilotStationInfo: AutopilotStationInfo) {
//LogUtils.dTag(TAG, "$autopilotStationInfo")
fun invokeArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotArriveAtStation(autopilotStationInfo)
listener.onAutopilotArriveAtStation(arrivalNotification)
}
}
@@ -139,12 +135,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
* 工控机监控节点 回调
*/
@Synchronized
fun invokeAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
//LogUtils.dTag(TAG, "$guardianInfo")
fun invokeAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotGuardian(guardianInfo)
}
}

View File

@@ -0,0 +1,73 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
/**
* 车辆地盘数据 回调监听
*/
object CallerAutopilotCarConfigListenerManager : CallerBase() {
private val TAG = "CallerAutopilotCarConfigListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_CAR_CONFIG_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotCarConfigListener> =
ConcurrentHashMap()
/**
* 添加 ADAS车辆状态&定位 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoAutopilotCarConfigListener
) {
if (M_AUTOPILOT_CAR_CONFIG_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_CAR_CONFIG_LISTENERS[tag] = listener
}
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_CAR_CONFIG_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_CAR_CONFIG_LISTENERS.remove(tag)
}
/**
* 删除自动驾驶按钮选中监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoAutopilotCarConfigListener) {
M_AUTOPILOT_CAR_CONFIG_LISTENERS.forEach {
if (it.value == listener) {
M_AUTOPILOT_CAR_CONFIG_LISTENERS.remove(it.key)
}
}
}
/**
* 工控机基础信息回调
* @param carConfigResp
*/
@Synchronized
fun invokeAutopilotCarConfigData(carConfigResp: MessagePad.CarConfigResp) {
M_AUTOPILOT_CAR_CONFIG_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotCarConfig(carConfigResp)
}
}
}

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
/**
@@ -62,17 +63,14 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
/**
* 车辆状态数据 回调
* @param autoPilotCarStateInfo
* @param gnssInfo
*/
@Synchronized
fun invokeAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
//LogUtils.dTag(TAG, "$autoPilotCarStateInfo")
//Log.w("DHY-location", "${autoPilotCarStateInfo?.values?.lon},${autoPilotCarStateInfo?.values?.lat} CallerAutopilotCarStatusListenerManager-invokeAutopilotCarStateData")
fun invokeAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotCarStateData(autoPilotCarStateInfo)
listener.onAutopilotCarStateData(gnssInfo)
}
}

View File

@@ -1,13 +1,12 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.util.concurrent.ConcurrentHashMap
/**
@@ -66,12 +65,10 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
* 识别交通元素数据发生更新 回调
*/
@Synchronized
fun invokeAutopilotIdentifyDataUpdate(trafficData: ArrayList<TrafficData>?) {
// Logger.d(TAG, "$trafficData")
fun invokeAutopilotIdentifyDataUpdate(trafficData: ArrayList<MessagePad.TrackedObject>?) {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value
// Logger.d(TAG, "tag:$tag listener:$listener")
listener.onAutopilotIdentifyDataUpdate(trafficData)
}
}
@@ -80,25 +77,23 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
* 报警信息 回调
*/
@Synchronized
fun invokeAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
// Logger.d(TAG, "$autopilotWarnMessage")
fun invokeAutopilotWarnMessage(warn: MessagePad.Warn?) {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value
// Logger.d(TAG, "tag:$tag listener:$listener")
listener.onAutopilotWarnMessage(autopilotWarnMessage)
listener.onAutopilotWarnMessage(warn)
}
}
/**
* 采集任务记录回调
*/
fun invokeAutopilotRecordResult(result: AutoPilotRecordResult) {
fun invokeAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotRecordResult(result)
listener.onAutopilotRecordResult(recordPanel)
}
}

View File

@@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
/**
@@ -78,16 +78,14 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
/**
* 路径规划 回调
* @param routeList 自动驾驶网约车回调数据
* @param globalPathResp 自动驾驶网约车回调数据
*/
@Synchronized
fun invokeAutopilotRotting(routeList: AutopilotRouteInfo) {
//LogUtils.dTag(TAG, "$routeList")
fun invokeAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
M_AUTOPILOT_PLANNING_LISTENER.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotRotting(routeList)
listener.onAutopilotRotting(globalPathResp)
}
}

View File

@@ -0,0 +1,85 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
* 车辆地盘数据 回调监听
*/
object CallerAutopilotVehicleStateListenerManager : CallerBase() {
private val TAG = "CallerAutopilotVehicleStateListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_VEHICLE_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotVehicleStateListener> =
ConcurrentHashMap()
/**
* 添加 ADAS车辆状态&定位 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoAutopilotVehicleStateListener
) {
if (M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_VEHICLE_LISTENERS[tag] = listener
}
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_VEHICLE_LISTENERS.remove(tag)
}
/**
* 删除自动驾驶按钮选中监听
* @param listener 要删除的监听对象
*/
fun removeListener(@Nullable listener: IMoGoAutopilotVehicleStateListener) {
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
if (it.value == listener) {
M_AUTOPILOT_VEHICLE_LISTENERS.remove(it.key)
}
}
}
/**
* 车辆转向灯数据回调
* @param lightSwitch
*/
@Synchronized
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotLightSwitchData(lightSwitch)
}
}
/**
* 车辆刹车灯数据回调
* @param brakeLight
*/
@Synchronized
fun invokeAutopilotBrakeLightData(brakeLight: Boolean) {
M_AUTOPILOT_VEHICLE_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotBrakeLightData(brakeLight)
}
}
}

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import record_cache.RecordPanelOuterClass
object CallerDevaToolsManager {
@@ -61,7 +62,7 @@ object CallerDevaToolsManager {
/**
* 收到工控机回调时触发
*/
fun onReceiveBadCaseRecord(record: AutoPilotRecordResult) {
fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel) {
devaToolsProviderApi?.onReceiveBadCaseRecord(record)
}
}