merge
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import android.os.SystemClock
|
||||
import chassis.SpecialVehicleTaskCmdOuterClass
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
@@ -393,4 +394,11 @@ object CallerAutoPilotManager {
|
||||
fun sendStatusQueryReq() {
|
||||
providerApi?.sendStatusQueryReq()
|
||||
}
|
||||
|
||||
/**
|
||||
* 福田清扫车业务指令下发
|
||||
*/
|
||||
fun sendSweeperFuTianTaskCmd(fuTianTaskCmd: SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd) {
|
||||
providerApi?.sendSweeperFuTianTaskCmd(fuTianTaskCmd)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhidao.support.adas.high.bean.AutopilotStatistics
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
||||
object CallerAutopilotStatisticsListenerManager : CallerBase() {
|
||||
|
||||
private val M_AUTOPILOT_STATISTICS_LISTENER: ConcurrentHashMap<String, IMoGoAutopilotStatisticsListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotStatisticsListener
|
||||
) {
|
||||
if (M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATISTICS_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_AUTOPILOT_STATISTICS_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoAutopilotStatisticsListener) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun invokeAutopilotStatistics(statistics: AutopilotStatistics?) {
|
||||
M_AUTOPILOT_STATISTICS_LISTENER.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotStatistics(statistics)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import chassis.Chassis
|
||||
import chassis.VehicleStateOuterClass
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -132,6 +133,16 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clean system state 清扫车(福田)清扫控制系统状态
|
||||
*/
|
||||
fun invokeSweeperFutianCleanSystemState(cleanSystemState: VehicleStateOuterClass.SweeperFuTianCleanSystemState){
|
||||
M_AUTOPILOT_VEHICLE_LISTENERS.forEach{
|
||||
val listener = it.value
|
||||
listener.onSweeperFutianCleanSystemState(cleanSystemState)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工控机时间回调
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoStartAutopilotFailedListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo_msg.MogoReportMsg
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 启动自动驾驶失败监听
|
||||
* 注册/取消注册
|
||||
*/
|
||||
object CallerStartAutopilotFailedListenerManager : CallerBase() {
|
||||
|
||||
private val M_START_AUTOPILOT_FAILED_LISTENER: ConcurrentHashMap<String, IMoGoStartAutopilotFailedListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoStartAutopilotFailedListener
|
||||
) {
|
||||
if (M_START_AUTOPILOT_FAILED_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_START_AUTOPILOT_FAILED_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
if (!M_START_AUTOPILOT_FAILED_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoStartAutopilotFailedListener) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun invokeStartAutopilotFailed(message: MogoReportMsg.MogoReportMessage?) {
|
||||
M_START_AUTOPILOT_FAILED_LISTENER.forEach {
|
||||
val listener = it.value
|
||||
listener.onStartAutopilotFailed(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user