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 472ab73e41..daf126f9c7 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 @@ -51,6 +51,11 @@ class AutoPilotAndCheckView @JvmOverloads constructor( initView() } + companion object { + private var maxAcceleration: Double = 2.0 + private var speedLimit: Double = 0.0 + } + @SuppressLint("ClickableViewAccessibility") private fun initView() { background = ColorDrawable(Color.parseColor("#F0151D41")) @@ -124,6 +129,12 @@ class AutoPilotAndCheckView @JvmOverloads constructor( if (AppConfigInfo.isConnectAutopilot) { CallerAutoPilotManager.getCarConfig() } + if (maxAcceleration > 0) { + tvAcceleration.text = "加速度 $maxAcceleration m/s²" + } + if (speedLimit > 0) { + etInputSpeed.setText((speedLimit * 3.6).toInt().toString()) + } // // 比如需要设置默认速度 // val speed = "30" // etInputSpeed.setText(speed) @@ -204,6 +215,8 @@ class AutoPilotAndCheckView @JvmOverloads constructor( override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { UiThreadHandler.post { tvAcceleration?.let { + maxAcceleration = carConfigResp.maxAcceleration + speedLimit = carConfigResp.speedLimit tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²" etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString()) } 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 4db5534755..cb55f1540f 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 @@ -185,7 +185,6 @@ android:layout_height="wrap_content" android:layout_marginStart="123px" android:layout_marginTop="12px" - android:text="加速度 2 m/s²" android:textColor="#A7B6F0" android:textSize="32px" app:layout_constraintStart_toStartOf="parent"