From 47bda98749d06d8a89dbb33cc5f6133f483ae5bf Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Wed, 13 Apr 2022 17:42:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工控机上报板块增加Result和Action的中文说明 --- .../autopilot/MoGoAutopilotProvider.kt | 17 +++++++++++++++++ .../hmi/ui/setting/DebugSettingView.kt | 4 ++-- .../api/autopilot/IMoGoAutopilotProvider.kt | 12 ++++++++++++ .../call/autopilot/CallerAutoPilotManager.kt | 18 ++++++++++++++++++ .../support/adas/high/common/MogoReport.java | 4 ++-- 5 files changed, 51 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index 342ae8c492..ba471cb925 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -42,6 +42,7 @@ import com.zhidao.support.adas.high.bean.IPCUpgradeInfo import com.zhidao.support.adas.high.common.Constants import com.zhidao.support.adas.high.common.Constants.IPC_CONNECTION_STATUS import com.zhidao.support.adas.high.common.CupidLogUtils +import com.zhidao.support.adas.high.common.MogoReport import io.netty.channel.Channel import java.util.concurrent.TimeUnit @@ -420,6 +421,22 @@ class MoGoAutopilotProvider : }) } + /** + * 获取工控机上报数据result code说明 + * @param resultCode 上报字段code + */ + override fun getReportResultDesc(resultCode: String): String { + return MogoReport.Result.getDesc(resultCode) + } + + /** + * 获取工控机上报数据action code说明 + * @param actionCode 上报字段code + */ + override fun getReportActionDesc(actionCode: String): String { + return MogoReport.Action.getDesc(actionCode) + } + private fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel) { try { msg?.let { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 244418a7da..1f7d3de420 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1611,13 +1611,13 @@ class DebugSettingView @JvmOverloads constructor( tvReportCode.text = "code:${it.code}" var resultStr = "result:" for (result in it.resultList) { - resultStr = "$resultStr$result " + resultStr = "$resultStr$result${CallerAutoPilotManager.getReportResultDesc(result)} " } tvReportResult.text = resultStr var actionStr = "action:" for (action in it.actionsList) { - actionStr = "$actionStr$action " + actionStr = "$actionStr$action${CallerAutoPilotManager.getReportActionDesc(action)} " } tvReportActions.text = actionStr diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt index 6f419b17b2..cc1a667a12 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt @@ -154,4 +154,16 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider { fun getProtocolVersion(): Int fun connectSpecifiedServer(ip: String) + + /** + * 获取工控机上报数据result code说明 + * @param resultCode 上报字段code + */ + fun getReportResultDesc(resultCode:String): String + + /** + * 获取工控机上报数据action code说明 + * @param actionCode 上报字段code + */ + fun getReportActionDesc(actionCode:String): String } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt index e641a2edbd..06091631a8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt @@ -177,4 +177,22 @@ object CallerAutoPilotManager { fun connectSpecifiedServer(ip: String) { providerApi?.connectSpecifiedServer(ip) } + + /** + * 获取工控机上报数据result code说明 + * @param code 上报字段code + */ + fun getReportResultDesc(resultCode: String): String? { + return providerApi?.getReportResultDesc(resultCode) + } + + /** + * 获取工控机上报数据action code说明 + * @param code 上报字段code + */ + fun getReportActionDesc(actionCode: String): String? { + return providerApi?.getReportActionDesc(actionCode) + } + + } \ No newline at end of file diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MogoReport.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MogoReport.java index ebe9dc5e08..30a69d0759 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MogoReport.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/MogoReport.java @@ -47,7 +47,7 @@ public class MogoReport { } - public String getDesc(String resultCode) { + public static String getDesc(String resultCode) { switch (resultCode) { case RESULT_AUTOPILOT_DISABLE: return AUTOPILOT_DISABLE.desc; @@ -114,7 +114,7 @@ public class MogoReport { } - public String getDesc(String actionCode) { + public static String getDesc(String actionCode) { switch (actionCode) { case ACTION_CONTACT_TECH_SUPPORT: return CONTACT_TECH_SUPPORT.desc;