From 2b83ad28d9229ac73813ee45e6027452fd69a102 Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Mon, 21 Mar 2022 11:28:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E6=8E=A7=E6=9C=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=9B=9E=E8=B0=83=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改工控机异常回调显示 --- .../hmi/ui/setting/DebugSettingView.kt | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) 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 d2fec88cd1..aba1ba3798 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 @@ -1149,33 +1149,44 @@ class DebugSettingView @JvmOverloads constructor( * 工控机异常回调 */ override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) { - guardianInfo?.let { - reportMsgLayout.visibility = View.VISIBLE - tvReportSrc.text = it.src - tvReportLevel.text = it.level - tvReportMsg.text = it.msg - tvReportCode.text = it.code - tvReportResult.text = it.getResult(0) - tvReportActions.text = it.getActions(0) + ThreadUtils.runOnUiThread{ + guardianInfo?.let { + reportMsgLayout.visibility = View.VISIBLE + tvReportSrc.text = "src:${it.src}" + tvReportLevel.text = "level:${it.level}" + tvReportMsg.text = "msg:${it.msg}" + tvReportCode.text = "code:${it.code}" + var resultStr="result:" + for(result in it.resultList){ + resultStr = "$resultStr$result " + } + tvReportResult.text = resultStr - if("error".equals(it.level)){ - //字体为红色,吐司提示 - tvReportSrc.setTextColor(Color.RED) - tvReportLevel.setTextColor(Color.RED) - tvReportMsg.setTextColor(Color.RED) - tvReportCode.setTextColor(Color.RED) - tvReportResult.setTextColor(Color.RED) - tvReportActions.setTextColor(Color.RED) - ToastUtils.showShort(it.msg) - }else{ - tvReportSrc.setTextColor(Color.BLACK) - tvReportLevel.setTextColor(Color.BLACK) - tvReportMsg.setTextColor(Color.BLACK) - tvReportCode.setTextColor(Color.BLACK) - tvReportResult.setTextColor(Color.BLACK) - tvReportActions.setTextColor(Color.BLACK) + var actionStr="action:" + for(action in it.actionsList){ + actionStr = "$actionStr$action " + } + tvReportActions.text = actionStr + + + if("error".equals(it.level)){ + //字体为红色,吐司提示 + tvReportSrc.setTextColor(Color.RED) + tvReportLevel.setTextColor(Color.RED) + tvReportMsg.setTextColor(Color.RED) + tvReportCode.setTextColor(Color.RED) + tvReportResult.setTextColor(Color.RED) + tvReportActions.setTextColor(Color.RED) + ToastUtils.showShort(it.msg) + }else{ + tvReportSrc.setTextColor(Color.BLACK) + tvReportLevel.setTextColor(Color.BLACK) + tvReportMsg.setTextColor(Color.BLACK) + tvReportCode.setTextColor(Color.BLACK) + tvReportResult.setTextColor(Color.BLACK) + tvReportActions.setTextColor(Color.BLACK) + } } - } }