Merge branch 'dev_robotaxi-d-app-module_2110_220915_2.11.0_gkjpb' into dev_robotaxi-d-app-module_2120_221017_2.12.0
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.module.service.routeoverlay.RouteStrategy
|
||||
import kotlinx.android.synthetic.main.view_sop_setting.view.*
|
||||
|
||||
/**
|
||||
* SOP设置窗口
|
||||
*/
|
||||
class SOPSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr){
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_sop_setting, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
//绕障类功能开关
|
||||
tbObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring
|
||||
tbObstacleAvoidance.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.sendDetouring(isChecked)
|
||||
FunctionBuildConfig.isDetouring = isChecked
|
||||
}
|
||||
|
||||
//危险障碍物颜色标记开关
|
||||
tbMarkingObstacles.setOnCheckedChangeListener { _, isChecked ->
|
||||
|
||||
}
|
||||
|
||||
//引导线动态效果
|
||||
tbRouteDynamicEffect.isChecked =
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) && !AppIdentityModeUtils.isBus(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
tbRouteDynamicEffect.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) {
|
||||
RouteStrategy.enable(true)
|
||||
} else {
|
||||
RouteStrategy.enable(false)
|
||||
}
|
||||
}
|
||||
|
||||
//红绿灯标识
|
||||
tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView
|
||||
tbTrafficLight.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(!isChecked){
|
||||
HmiBuildConfig.isShowTrafficLightView = false
|
||||
}else{
|
||||
HmiBuildConfig.isShowTrafficLightView = true
|
||||
CallerHmiManager.disableWarningTrafficLight()
|
||||
}
|
||||
}
|
||||
|
||||
//限速标识
|
||||
tbSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
|
||||
tbSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(isChecked){
|
||||
HmiBuildConfig.isShowLimitingVelocityView = true
|
||||
}else{
|
||||
HmiBuildConfig.isShowLimitingVelocityView = false
|
||||
CallerHmiManager.disableLimitingVelocity()
|
||||
}
|
||||
}
|
||||
|
||||
//自车感知到的他车碰撞预警
|
||||
tbCollisionWarning.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
|
||||
}
|
||||
|
||||
// 演示模式,上一次勾选的数据
|
||||
tbDemoMode.isChecked = FunctionBuildConfig.isDemoMode
|
||||
// 演示模式
|
||||
tbDemoMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.setDemoMode(isChecked)
|
||||
if (!isChecked) {
|
||||
//关闭美化模式时,通知工控机
|
||||
CallerAutoPilotManager.setIPCDemoMode(isChecked)
|
||||
}
|
||||
FunctionBuildConfig.isDemoMode = isChecked
|
||||
}
|
||||
//只在司机端设置美化模式开关功能
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbDemoMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
|
||||
// 雨天模式,上一次勾选的数据
|
||||
tbRainMode.isChecked = FunctionBuildConfig.isRainMode
|
||||
//雨天模式
|
||||
tbRainMode.setOnCheckedChangeListener { _, isChecked ->
|
||||
CallerAutoPilotManager.setRainMode(isChecked)
|
||||
FunctionBuildConfig.isRainMode = isChecked
|
||||
}
|
||||
//雨天模式按钮只在司机屏生效,乘客屏不显示
|
||||
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
tbRainMode.visibility = View.GONE
|
||||
}
|
||||
|
||||
//OBU控制总开关
|
||||
tbObu.isChecked = CallerOBUManager.isConnected()
|
||||
tbObu.setOnCheckedChangeListener { _, isChecked ->
|
||||
if(!isChecked){
|
||||
if(AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerOBUManager.resetObuIpAddress("192.168.1.199")
|
||||
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
CallerOBUManager.resetObuIpAddress("192.168.8.199")
|
||||
}
|
||||
}else{
|
||||
//断开链接
|
||||
CallerOBUManager.disConnectObu()
|
||||
}
|
||||
}
|
||||
|
||||
//变道绕障的目标障碍物速度阈值
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
ivSpeedReduce.setOnClickListener {
|
||||
if(FunctionBuildConfig.detouringSpeed<=3){
|
||||
ToastUtils.showShort("阈值小可为3 m/s")
|
||||
}else{
|
||||
FunctionBuildConfig.detouringSpeed--
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
}
|
||||
ivSpeedAdd.setOnClickListener {
|
||||
if(FunctionBuildConfig.detouringSpeed>=7){
|
||||
ToastUtils.showShort("阈值最大可为7 m/s")
|
||||
}else{
|
||||
FunctionBuildConfig.detouringSpeed++
|
||||
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
|
||||
}
|
||||
}
|
||||
btnSpeedSet.setOnClickListener {
|
||||
val isSuccess = CallerAutoPilotManager.sendDetouringSpeed(FunctionBuildConfig.detouringSpeed.toDouble())
|
||||
if(isSuccess == true){
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置成功")
|
||||
}else{
|
||||
ToastUtils.showShort("变道绕障的目标障碍物速度阈值设置失败")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 387 B |
Binary file not shown.
|
After Width: | Height: | Size: 302 B |
@@ -0,0 +1,196 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_800"
|
||||
android:layout_height="@dimen/dp_1100"
|
||||
android:background="#FFFFFF">
|
||||
<!--绕障类功能-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObstacleAvoidance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启绕障类功能"
|
||||
android:textOn="关闭绕障类功能"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
<!--危险障碍物颜色标记-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbMarkingObstacles"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「危险障碍物颜色标记」"
|
||||
android:textOn="关闭「危险障碍物颜色标记」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObstacleAvoidance"
|
||||
/>
|
||||
<!--引导线动态效果-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRouteDynamicEffect"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「引导线动态效果」"
|
||||
android:textOn="关闭「引导线动态效果」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbMarkingObstacles"
|
||||
/>
|
||||
<!--红绿灯标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbTrafficLight"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="隐藏红绿灯标识"
|
||||
android:textOn="展示红绿灯标识"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRouteDynamicEffect"
|
||||
/>
|
||||
<!--限速标识-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbSpeedLimit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="展示限速标识"
|
||||
android:textOn="隐藏限速标识"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbTrafficLight"
|
||||
/>
|
||||
<!--自车感知到的他车碰撞预警-->
|
||||
<ToggleButton
|
||||
android:id="@+id/tbCollisionWarning"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启「自车感知到的他车碰撞预警」"
|
||||
android:textOn="关闭「自车感知到的他车碰撞预警」"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbSpeedLimit"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbDemoMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启美化模式"
|
||||
android:textOn="关闭美化模式"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbCollisionWarning"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbRainMode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="开启雨天模式"
|
||||
android:textOn="关闭雨天模式"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbDemoMode"
|
||||
/>
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbObu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:background="@drawable/radio_button_normal_background_right"
|
||||
android:textColor="#000"
|
||||
android:textOff="关闭OBU"
|
||||
android:textOn="开启OBU"
|
||||
android:textSize="@dimen/dp_24"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeedThresholdTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tbObu"
|
||||
android:text="变道速度阈值:"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#1A1A1A"
|
||||
android:layout_margin="10dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedReduce"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeedThresholdTitle"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeedThresholdTitle"
|
||||
android:src="@drawable/icon_reduce"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSpeed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedReduce"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedReduce"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSpeedAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvSpeed"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvSpeed"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvSpeed"
|
||||
android:src="@drawable/icon_add"
|
||||
android:padding="10dp"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnSpeedSet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintBottom_toBottomOf="@id/ivSpeedAdd"
|
||||
app:layout_constraintLeft_toRightOf="@id/ivSpeedAdd"
|
||||
android:text="设置阈值"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnSpeedSet"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user