[660][adas][data-center] 添加节点检测功能,节点状态接口,移除节点超时接口
This commit is contained in:
@@ -30,6 +30,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume.Suspend
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm.TaskConfirmResp
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop.StopTaskResp
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.NodeStateInfo
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.cloud.s_r.SweeperTaskCloudSuspendResume.BigTaskActionResp
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
@@ -927,7 +928,7 @@ object CallerAutoPilotControlManager {
|
||||
* @param name 节点名称 目前只有SSM和FSM2024
|
||||
* @return 状态 SSM只能查询到超时状态;FSM2024可以查询到节点是否存在状态以及超时状态;
|
||||
*/
|
||||
fun getNodeStateInfo(name: AdasConstants.NodeName): Adas.NodeStateInfo? {
|
||||
fun getNodeStateInfo(name: AdasConstants.NodeName): NodeStateInfo? {
|
||||
return providerApi?.getNodeStateInfo(name)
|
||||
}
|
||||
}
|
||||
@@ -224,35 +224,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控SSM接口接收超时
|
||||
* 状态变动时才会回调,默认SSM状态正常
|
||||
* @param isTimeout true:SSM接口接收超时 false:SSM接口恢复正常
|
||||
*/
|
||||
fun invokeSsmReceiveTimeout(isTimeout: Boolean) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onSsmReceiveTimeout(isTimeout)
|
||||
}
|
||||
if (isTimeout) {
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.SSMINFO, SSMMsg(0, "连接超时", "ssm超时无响应", System.currentTimeMillis())))
|
||||
} else {
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.SSMINFO, SSMMsg(0, "连接恢复", "ssm连接恢复", System.currentTimeMillis())))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 域控FSM接口接收超时
|
||||
* 状态变动时才会回调,默认FSM状态正常 前提是存在FSM接口
|
||||
*
|
||||
* @param isTimeout true:FSM接口接收超时 false:FSM接口恢复正常
|
||||
*/
|
||||
fun invokeFsmReceiveTimeout(isTimeout: Boolean) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onFsmReceiveTimeout(isTimeout)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动调查询接口:AdasManager#sendStatusQueryReq(), 会收到以下回调
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoNodeStateListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhjt.mogo.adas.data.Adas
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import com.zhjt.mogo.adas.data.bean.NodeStateInfo
|
||||
|
||||
/**
|
||||
*节点状态
|
||||
@@ -11,6 +11,9 @@ import com.zhjt.mogo.adas.data.AdasConstants
|
||||
object CallerNodeStateListenerManager : CallerBase<IMoGoNodeStateListener>() {
|
||||
private val mutableMap = mutableMapOf<String, Set<AdasConstants.NodeName>>()
|
||||
|
||||
/**
|
||||
* nodeName传入要监听的节点状态名称,如果传递注册的时候将返回所有节点的状态
|
||||
*/
|
||||
fun addNodeStateListener(
|
||||
tag: String,
|
||||
nodeName: Set<AdasConstants.NodeName>?,
|
||||
@@ -29,15 +32,15 @@ object CallerNodeStateListenerManager : CallerBase<IMoGoNodeStateListener>() {
|
||||
super.removeListener(tag)
|
||||
}
|
||||
|
||||
fun invokeNodeState(name: AdasConstants.NodeName, stateInfo: Adas.NodeStateInfo) {
|
||||
fun invokeNodeState(stateInfo: NodeStateInfo) {
|
||||
M_LISTENERS.forEach {
|
||||
val names = mutableMap[it.key]
|
||||
val listener = it.value
|
||||
if (names.isNullOrEmpty()) {
|
||||
listener.onNodeStateInfo(name, stateInfo)
|
||||
listener.onNodeStateInfo(stateInfo)
|
||||
} else {
|
||||
if (names.contains(name)) {
|
||||
listener.onNodeStateInfo(name, stateInfo)
|
||||
if (names.contains(stateInfo.nodeName)) {
|
||||
listener.onNodeStateInfo(stateInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,11 +50,11 @@ object CallerNodeStateListenerManager : CallerBase<IMoGoNodeStateListener>() {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
mutableMap.forEach { it ->
|
||||
if (it.key == tag) {
|
||||
val value = it.value
|
||||
value.forEach { name ->
|
||||
val names = it.value
|
||||
names.forEach { name ->
|
||||
val state = CallerAutoPilotControlManager.getNodeStateInfo(name)
|
||||
state?.let {
|
||||
listener.onNodeStateInfo(name, state)
|
||||
listener.onNodeStateInfo(state)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user