From 4662ec2f1929aa0270eba0bc60a6d54ba86109a8 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 22 Mar 2022 19:57:16 +0800 Subject: [PATCH] =?UTF-8?q?[Feat]=E6=98=BE=E7=A4=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E5=8A=A0=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/tools/AutoPilotAndCheckView.kt | 11 ++++++++++- .../main/res/layout/view_auto_pilot_check.xml | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt index 72fc255bcd..19078e08ad 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/AutoPilotAndCheckView.kt @@ -8,15 +8,18 @@ import android.view.View import android.widget.FrameLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.KeyBoardUtil import com.mogo.eagle.core.utilcode.kotlin.onClick import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import kotlinx.android.synthetic.main.view_auto_pilot_check.view.* +import mogo.telematics.pad.MessagePad /** * @author ChenFufeng @@ -26,7 +29,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : FrameLayout( +) : IMoGoAutopilotCarConfigListener, FrameLayout( context, attrs, defStyleAttr @@ -46,6 +49,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor( @SuppressLint("ClickableViewAccessibility") private fun initView() { + CallerAutopilotCarConfigListenerManager.addListener(TAG, this) if (keyBoardUtil == null) { keyBoardUtil = KeyBoardUtil(sKeyBoardView, etInputSpeed) } @@ -187,4 +191,9 @@ class AutoPilotAndCheckView @JvmOverloads constructor( fun showDebugPanelView() fun showFeedbackView() } + + override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { + tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²" + etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString()) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml index 4d4bec61b1..c9c6fb2903 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_auto_pilot_check.xml @@ -187,6 +187,19 @@ + + + app:layout_constraintTop_toBottomOf="@id/tvAcceleration" /> + app:layout_constraintTop_toBottomOf="@id/tvAcceleration" />