From be4084a726e3c780ff15cf9bc554d460deb66823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Thu, 21 Oct 2021 21:08:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=95=BF=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E5=AF=BC=E8=87=B4Anr=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 董宏宇 --- .../core/function/hmi/ui/setting/DebugSettingView.kt | 11 +++++++++-- .../core/function/hmi/ui/widget/SpeedPanelView.kt | 10 ++++++---- 2 files changed, 15 insertions(+), 6 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 d48f3f38ab..c5a76d6ccc 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 @@ -158,11 +158,18 @@ class DebugSettingView @JvmOverloads constructor( * OBU状态回调 */ override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) { - tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) + tvObuInfo.post { + tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) + } } + /** + * 自动驾驶状态回调 + */ override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { - tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo) + tvAutopilotInfo.post { + tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo) + } } override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) { diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt index 8b9ed400fa..f813b70e1f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SpeedPanelView.kt @@ -126,10 +126,12 @@ class SpeedPanelView @JvmOverloads constructor( } override fun onCarLocationChanged2(latLng: Location) { - val speed = (latLng.speed * 3.6f).toInt() - mSpeedChartView.setArcColor(Color.parseColor(if (speed > 60) "#DB3137" else "#3E77F6")) - mSpeedChartView.setValues(speed) - setBackgroundResource(if (speed > 60) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor) + mSpeedChartView.post { + val speed = (latLng.speed * 3.6f).toInt() + mSpeedChartView.setArcColor(Color.parseColor(if (speed > 60) "#DB3137" else "#3E77F6")) + mSpeedChartView.setValues(speed) + setBackgroundResource(if (speed > 60) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor) + } } override fun onStatusChanged(descriptor: StatusDescriptor?, isTrue: Boolean) {