[Feat]显示自动驾驶加速度

This commit is contained in:
chenfufeng
2022-03-22 19:57:16 +08:00
parent fd4059cb81
commit 4662ec2f19
2 changed files with 25 additions and 3 deletions

View File

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

View File

@@ -187,6 +187,19 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="@+id/tvAcceleration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="加速度 2 m/s²"
android:textColor="#A7B6F0"
android:textSize="32px"
android:layout_marginTop="12px"
android:layout_marginStart="123px"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition"
/>
<View
android:layout_width="14px"
android:layout_height="50px"
@@ -195,7 +208,7 @@
android:background="@color/color_FF2966EC"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" />
app:layout_constraintTop_toBottomOf="@id/tvAcceleration" />
<TextView
android:id="@+id/tvSystemOperation"
@@ -209,7 +222,7 @@
android:textSize="42px"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/llSpeedPosition" />
app:layout_constraintTop_toBottomOf="@id/tvAcceleration" />
<com.mogo.eagle.core.function.hmi.ui.widget.CheckSystemView
android:id="@+id/checkSystemView"