merge
This commit is contained in:
@@ -3,6 +3,7 @@ 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.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import kotlin.random.Random
|
||||
@@ -17,8 +18,8 @@ object CallerAutoPilotManager {
|
||||
|
||||
private val providerApi: IMoGoAutopilotProvider?
|
||||
get() = CallerBase.getApiInstance(
|
||||
IMoGoAutopilotProvider::class.java,
|
||||
MogoServicePaths.PATH_AUTO_PILOT
|
||||
IMoGoAutopilotProvider::class.java,
|
||||
MogoServicePaths.PATH_AUTO_PILOT
|
||||
)
|
||||
|
||||
/**
|
||||
@@ -44,11 +45,10 @@ object CallerAutoPilotManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送json数据给 Autopilot 自动驾驶控制器
|
||||
* 具体的json格式需要与@宋克难 进行沟通
|
||||
* 发送红绿灯数据至工控机
|
||||
*/
|
||||
fun sendDataToAutopilot(jsonString: String) {
|
||||
providerApi?.sendMessageToAutopilot(jsonString)
|
||||
fun sendTrafficLightData(trafficLightResult: TrafficLightResult) {
|
||||
providerApi?.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
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
|
||||
|
||||
/**
|
||||
@@ -17,7 +15,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 域控制器相关的回调监听
|
||||
*/
|
||||
object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutoPilotStatusListenerManager"
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
|
||||
@@ -50,7 +47,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoAutopilotStatusListener
|
||||
) {
|
||||
if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
|
||||
@@ -63,7 +59,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)
|
||||
@@ -86,7 +81,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatus() {
|
||||
//LogUtils.dTag(TAG, "$mAutopilotStatusInfo")
|
||||
invokeAutoPilotStatus(mAutopilotStatusInfo)
|
||||
}
|
||||
|
||||
@@ -96,28 +90,24 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatus(autopilotStatusInfo: AutopilotStatusInfo) {
|
||||
//LogUtils.dTag(TAG, "$autopilotStatusInfo")
|
||||
mAutopilotStatusInfo = autopilotStatusInfo
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶站点信息 回调
|
||||
* @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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,11 +116,9 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotSNRequest() {
|
||||
//LogUtils.dTag(TAG, "")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotSNRequest()
|
||||
}
|
||||
}
|
||||
@@ -139,12 +127,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
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 mogo.telematics.pad.MessagePad
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 车辆地盘数据 回调监听
|
||||
*/
|
||||
object CallerAutopilotCarConfigListenerManager : CallerBase() {
|
||||
|
||||
// 存储所有注册了监听的对象,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)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_CAR_CONFIG_LISTENERS[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_CAR_CONFIG_LISTENERS.containsKey(tag)) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
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
|
||||
|
||||
/**
|
||||
@@ -13,7 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 车辆状态&定位 数据 数据 回调监听
|
||||
*/
|
||||
object CallerAutopilotCarStatusListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotCarStatusListenerManager"
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotCarStateListener> =
|
||||
@@ -30,7 +28,6 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoAutopilotCarStateListener
|
||||
) {
|
||||
if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
|
||||
@@ -42,7 +39,6 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)
|
||||
@@ -62,17 +58,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
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
|
||||
|
||||
/**
|
||||
@@ -16,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 域控制器感知数据
|
||||
*/
|
||||
object CallerAutopilotIdentifyListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotIdentifyListenerManager"
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_IDENTIFY_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotIdentifyListener> =
|
||||
@@ -32,7 +28,6 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoAutopilotIdentifyListener
|
||||
) {
|
||||
if (M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS[tag] = listener
|
||||
@@ -44,7 +39,6 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_IDENTIFY_LISTENERS.remove(tag)
|
||||
@@ -66,12 +60,10 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
|
||||
* 识别交通元素数据发生更新 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotIdentifyDataUpdate(trafficData: ArrayList<TrafficData>?) {
|
||||
// Logger.d(TAG, "$trafficData")
|
||||
fun invokeAutopilotIdentifyDataUpdate(trafficData: List<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 +72,22 @@ 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@ 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
|
||||
|
||||
/**
|
||||
@@ -14,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 规划路径相关回调
|
||||
*/
|
||||
object CallerAutopilotPlanningListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotPlanningListenerManager"
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_PLANNING_LISTENER: ConcurrentHashMap<String, IMoGoAutopilotPlanningListener> =
|
||||
@@ -31,7 +29,6 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoAutopilotPlanningListener
|
||||
) {
|
||||
if (M_AUTOPILOT_PLANNING_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_PLANNING_LISTENER[tag] = listener
|
||||
@@ -43,7 +40,6 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_PLANNING_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_PLANNING_LISTENER.remove(tag)
|
||||
@@ -67,27 +63,23 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotTrajectory(trajectoryInfo: ArrayList<ADASTrajectoryInfo>) {
|
||||
//LogUtils.dTag(TAG, "$trajectoryInfo")
|
||||
M_AUTOPILOT_PLANNING_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotTrajectory(trajectoryInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径规划 回调
|
||||
* @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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
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 java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 车辆地盘数据 回调监听
|
||||
*/
|
||||
object CallerAutopilotVehicleStateListenerManager : CallerBase() {
|
||||
|
||||
// 存储所有注册了监听的对象,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)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_VEHICLE_LISTENERS[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.base;
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.eagle.core.function.call.CallerBusManager;
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -23,7 +23,7 @@ public class CallerBase {
|
||||
T newInst = (T) ARouter.getInstance().build(path).navigation();
|
||||
try {
|
||||
CallerBusManager.registerApi(clazz, newInst);
|
||||
LogUtils.dTag(TAG, "keep IProvider instance to SingletonHolder: path = %s", path);
|
||||
CallerLogger.INSTANCE.d(TAG, "keep IProvider instance to SingletonHolder: path :" + path);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@ package com.mogo.eagle.core.function.call.devatools
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object CallerDevaToolsListenerManager {
|
||||
|
||||
private const val TAG = "CallDevaToolsListenerManager"
|
||||
|
||||
private val M_DEVA_TOOLS_LISTENER: ConcurrentHashMap<String, IMoGoDevaToolsListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
@@ -22,7 +19,6 @@ object CallerDevaToolsListenerManager {
|
||||
@Nullable listener: IMoGoDevaToolsListener
|
||||
) {
|
||||
if (M_DEVA_TOOLS_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_DEVA_TOOLS_LISTENER[tag] = listener
|
||||
@@ -34,7 +30,6 @@ object CallerDevaToolsListenerManager {
|
||||
*/
|
||||
fun unRegisterDevaToolsLogCatchListener(@Nullable tag: String) {
|
||||
if (!M_DEVA_TOOLS_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_DEVA_TOOLS_LISTENER.remove(tag)
|
||||
@@ -46,7 +41,6 @@ object CallerDevaToolsListenerManager {
|
||||
*/
|
||||
fun unRegisterDevaToolsLogCatchListener(@Nullable listener: IMoGoDevaToolsListener) {
|
||||
if (!M_DEVA_TOOLS_LISTENER.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "listener:$listener not exists")
|
||||
return
|
||||
}
|
||||
M_DEVA_TOOLS_LISTENER.forEach {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.mogo.eagle.core.function.call.devatools
|
||||
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
|
||||
import com.mogo.eagle.core.data.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 +61,7 @@ object CallerDevaToolsManager {
|
||||
/**
|
||||
* 收到工控机回调时触发
|
||||
*/
|
||||
fun onReceiveBadCaseRecord(record: AutoPilotRecordResult) {
|
||||
fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel) {
|
||||
devaToolsProviderApi?.onReceiveBadCaseRecord(record)
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.mogo.eagle.core.function.call.devatools.scene
|
||||
|
||||
import android.util.ArrayMap
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ADAS
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_DEVA
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_NETWORK
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_OTHER
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ROUTE
|
||||
import com.mogo.eagle.core.data.deva.scene.SceneLogCache
|
||||
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 {
|
||||
@@ -28,7 +29,7 @@ class Scene {
|
||||
|
||||
//初始化ADAS
|
||||
val adasMap = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_ADAS] = adasMap
|
||||
sceneCache[M_ADAS_IMPL] = adasMap
|
||||
|
||||
//初始化deva
|
||||
val devaMap = SceneLogCache(mutableMapOf(), true)
|
||||
@@ -36,7 +37,7 @@ class Scene {
|
||||
|
||||
//初始化路径规划
|
||||
val routeMap = SceneLogCache(mutableMapOf(), true)
|
||||
sceneCache[M_ROUTE] = routeMap
|
||||
sceneCache[M_OLD_ROUTE] = routeMap
|
||||
|
||||
//初始化其他模块,方便定位索引
|
||||
val otherMap = SceneLogCache(mutableMapOf(), true)
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.call.hmi
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -13,8 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
*/
|
||||
object CallerHmiListenerManager : CallerBase() {
|
||||
|
||||
private val TAG = "CallerHmiListenerManager"
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mIsChecked: Boolean = false
|
||||
|
||||
@@ -33,7 +30,6 @@ object CallerHmiListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoCheckAutoPilotBtnListener
|
||||
) {
|
||||
if (mAutoPilotBtnListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
mAutoPilotBtnListeners[tag] = listener
|
||||
@@ -46,7 +42,6 @@ object CallerHmiListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeCheckAutoPilotBtnListener(@Nullable tag: String) {
|
||||
if (!mAutoPilotBtnListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
mAutoPilotBtnListeners.remove(tag)
|
||||
@@ -57,12 +52,10 @@ object CallerHmiListenerManager : CallerBase() {
|
||||
* @param isChecked 选中状态
|
||||
*/
|
||||
fun invokeCheckAutoPilotBtnListener(isChecked: Boolean) {
|
||||
//LogUtils.dTag(TAG, "isChecked:$isChecked")
|
||||
mIsChecked = isChecked
|
||||
mAutoPilotBtnListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onCheck(mIsChecked)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
object CallerHmiManager : CallerBase() {
|
||||
private val waringProviderApi
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
.navigation() as? IMoGoWaringProvider;
|
||||
.navigation() as? IMoGoWaringProvider;
|
||||
|
||||
/**
|
||||
* 隐藏 脉速表
|
||||
@@ -64,14 +64,14 @@ object CallerHmiManager : CallerBase() {
|
||||
/**
|
||||
* 控制刹车功能
|
||||
*/
|
||||
fun setBrakeLightFunction(isOpen: Boolean) {
|
||||
fun setBrakeLightFunction (isOpen: Boolean) {
|
||||
waringProviderApi?.setBrakeLightFunction(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
fun toggleDebugView() {
|
||||
fun toggleDebugView(){
|
||||
waringProviderApi?.toggleDebugView()
|
||||
}
|
||||
|
||||
@@ -260,15 +260,16 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param downloadVersion 下载版本
|
||||
* @param upgradeStatus 升级状态
|
||||
*/
|
||||
fun showAdUpgradeStatus(upgradeMode: Int, downloadStatus: Int, currentProgress: Int, totalProgress: Int, downloadVersion: String, upgradeStatus: Int) {
|
||||
waringProviderApi?.showAdUpgradeStatus(upgradeMode, downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
fun showAdUpgradeStatus(upgradeMode : Int, downloadStatus : Int,currentProgress : Int,totalProgress : Int
|
||||
,downloadVersion : String,upgradeStatus : Int){
|
||||
waringProviderApi?.showAdUpgradeStatus(upgradeMode,downloadStatus, currentProgress, totalProgress, downloadVersion, upgradeStatus)
|
||||
}
|
||||
|
||||
/**
|
||||
*注册工控机升级提示圆点View的回调
|
||||
* @param 提示圆点View
|
||||
*/
|
||||
fun registerUpgradeTipsCallback(tipsView: () -> View) {
|
||||
fun registerUpgradeTipsCallback(tipsView:() -> View){
|
||||
waringProviderApi?.registerUpgradeTipsCallback(tipsView)
|
||||
}
|
||||
|
||||
@@ -277,7 +278,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param code
|
||||
* @param msg
|
||||
*/
|
||||
fun showDockerRebootResult(code: Int, msg: String) {
|
||||
fun showDockerRebootResult(code: Int,msg: String){
|
||||
waringProviderApi?.showDockerRebootResult(code, msg)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import android.util.Log
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -14,7 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 地图 位置改变 监听管理
|
||||
*/
|
||||
object CallerMapLocationListenerManager : CallerBase() {
|
||||
private val TAG = "CallerMapLocationListenerManager"
|
||||
|
||||
// 记录地图最后一次位置
|
||||
private var mLocation: MogoLocation? = null
|
||||
@@ -40,7 +37,6 @@ object CallerMapLocationListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoMapLocationListener
|
||||
) {
|
||||
if (mMapStyleChangeListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners[tag] = listener
|
||||
@@ -53,7 +49,6 @@ object CallerMapLocationListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!mMapStyleChangeListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners.remove(tag)
|
||||
@@ -65,7 +60,6 @@ object CallerMapLocationListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoMapLocationListener) {
|
||||
if (!mMapStyleChangeListeners.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "Tag:$listener not exists")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners.forEach {
|
||||
@@ -87,18 +81,10 @@ object CallerMapLocationListenerManager : CallerBase() {
|
||||
* @param location 选中状态
|
||||
*/
|
||||
fun invokeMapLocationChangeListener(location: MogoLocation?) {
|
||||
//LogUtils.dTag(TAG, "mapStyleMode:$location")
|
||||
// val longitude = "${location?.longitude}"
|
||||
// if (longitude.length>12){
|
||||
// Log.e("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
|
||||
// }else{
|
||||
// Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
|
||||
// }
|
||||
mLocation = location
|
||||
mMapStyleChangeListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onLocationChanged(location)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.call.map
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapStyleChangeListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -12,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* 地图 样式改变 监听管理
|
||||
*/
|
||||
object CallerMapStyleListenerManager : CallerBase() {
|
||||
private val TAG = "CallerMapStyleListenerManager"
|
||||
|
||||
// 记录地图样式
|
||||
private var mMapStyleMode = 0
|
||||
@@ -38,7 +36,6 @@ object CallerMapStyleListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoMapStyleChangeListener
|
||||
) {
|
||||
if (mMapStyleChangeListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners[tag] = listener
|
||||
@@ -51,7 +48,6 @@ object CallerMapStyleListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!mMapStyleChangeListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners.remove(tag)
|
||||
@@ -63,7 +59,6 @@ object CallerMapStyleListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoMapStyleChangeListener) {
|
||||
if (!mMapStyleChangeListeners.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "Tag:$listener not exists")
|
||||
return
|
||||
}
|
||||
mMapStyleChangeListeners.forEach {
|
||||
@@ -85,12 +80,10 @@ object CallerMapStyleListenerManager : CallerBase() {
|
||||
* @param mapStyleMode 选中状态
|
||||
*/
|
||||
fun invokeMapStyleChange(mapStyleMode: Int) {
|
||||
//LogUtils.dTag(TAG, "mapStyleMode:$mapStyleMode")
|
||||
mMapStyleMode = mapStyleMode
|
||||
mMapStyleChangeListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onMapStyleModeChange(mMapStyleMode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -14,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
* OBU 监听管理
|
||||
*/
|
||||
object CallerObuListenerManager : CallerBase() {
|
||||
private val TAG = "CallerObuListenerManager"
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo()
|
||||
@@ -47,7 +45,6 @@ object CallerObuListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoObuStatusListener
|
||||
) {
|
||||
if (mObuStatusListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
mObuStatusListeners[tag] = listener
|
||||
@@ -60,7 +57,6 @@ object CallerObuListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!mObuStatusListeners.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
mObuStatusListeners.remove(tag)
|
||||
@@ -72,7 +68,6 @@ object CallerObuListenerManager : CallerBase() {
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
|
||||
if (!mObuStatusListeners.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "Tag:$listener not exists")
|
||||
return
|
||||
}
|
||||
mObuStatusListeners.forEach {
|
||||
@@ -94,12 +89,10 @@ object CallerObuListenerManager : CallerBase() {
|
||||
* @param obuStatusInfo 选中状态
|
||||
*/
|
||||
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
|
||||
//LogUtils.dTag(TAG, "obuStatusInfo:$obuStatusInfo")
|
||||
mObuStatusInfo = obuStatusInfo
|
||||
mObuStatusListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onObuStatusResponse(mObuStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,13 +3,10 @@ package com.mogo.eagle.core.function.call.trafficlight
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object CallTrafficLightListenerManager {
|
||||
|
||||
private const val TAG = "CallTrafficLightListenerManager"
|
||||
|
||||
private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoTrafficLightListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
@@ -25,7 +22,6 @@ object CallTrafficLightListenerManager {
|
||||
@Nullable listener: IMoGoTrafficLightListener
|
||||
) {
|
||||
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
trafficLightResult?.let {
|
||||
@@ -40,7 +36,6 @@ object CallTrafficLightListenerManager {
|
||||
*/
|
||||
fun unRegisterTrafficLightListener(@Nullable tag: String) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
|
||||
@@ -52,7 +47,6 @@ object CallTrafficLightListenerManager {
|
||||
*/
|
||||
fun unRegisterTrafficLightListener(@Nullable listener: IMoGoTrafficLightListener) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "listener:$listener not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
@@ -72,7 +66,6 @@ object CallTrafficLightListenerManager {
|
||||
@Nullable listener: IMoGoTrafficLightListener
|
||||
) {
|
||||
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER[tag] = listener
|
||||
@@ -84,7 +77,6 @@ object CallTrafficLightListenerManager {
|
||||
*/
|
||||
fun unRegisterEnterCrossRoadListener(@Nullable tag: String) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
|
||||
@@ -96,7 +88,6 @@ object CallTrafficLightListenerManager {
|
||||
*/
|
||||
fun unRegisterEnterCrossRoadListener(@Nullable listener: IMoGoTrafficLightListener) {
|
||||
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "listener:$listener not exists")
|
||||
return
|
||||
}
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
@@ -110,7 +101,6 @@ object CallTrafficLightListenerManager {
|
||||
this.trafficLightResult = trafficLightResult
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
//LogUtils.dTag(TAG, "invokeTrafficLightStatus tag is : $tag")
|
||||
val listener = it.value
|
||||
listener.onTrafficLightStatus(trafficLightResult)
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@ package com.mogo.eagle.core.function.call.vip
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object CallVipSetListenerManager {
|
||||
|
||||
private const val TAG = "CallVipSetListenerManager"
|
||||
|
||||
private val M_VIP_SET_LISTENER: ConcurrentHashMap<String, IMoGoVipSetListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
@@ -24,7 +21,6 @@ object CallVipSetListenerManager {
|
||||
@Nullable listener: IMoGoVipSetListener
|
||||
) {
|
||||
if (M_VIP_SET_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
|
||||
return
|
||||
}
|
||||
listener.onVipSet(vipSet)
|
||||
@@ -37,7 +33,6 @@ object CallVipSetListenerManager {
|
||||
*/
|
||||
fun unRegisterVipSetListener(@Nullable tag: String) {
|
||||
if (!M_VIP_SET_LISTENER.containsKey(tag)) {
|
||||
LogUtils.eTag(TAG, "Tag:$tag not exists")
|
||||
return
|
||||
}
|
||||
M_VIP_SET_LISTENER.remove(tag)
|
||||
@@ -49,7 +44,6 @@ object CallVipSetListenerManager {
|
||||
*/
|
||||
fun unRegisterVipSetListener(@Nullable listener: IMoGoVipSetListener) {
|
||||
if (!M_VIP_SET_LISTENER.containsValue(listener)) {
|
||||
LogUtils.eTag(TAG, "listener:$listener not exists")
|
||||
return
|
||||
}
|
||||
M_VIP_SET_LISTENER.forEach {
|
||||
|
||||
Reference in New Issue
Block a user