调试面板

工控机上报板块增加Result和Action的中文说明
This commit is contained in:
xuxinchao
2022-04-13 17:42:18 +08:00
parent 0038196596
commit 47bda98749
5 changed files with 51 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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
}

View File

@@ -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)
}
}

View File

@@ -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;