[6.1.0]运营面板修改
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
@@ -50,6 +51,11 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
const val TAG = "SOPSettingView"
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU连接状态
|
||||
*/
|
||||
private var obuConnectStatus = false
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_sop_setting, this, true)
|
||||
initView()
|
||||
@@ -71,9 +77,139 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
* V2X消息设置
|
||||
*/
|
||||
private fun v2xSetting(){
|
||||
//V2X总开关
|
||||
scV2XSwitch.isChecked = FunctionBuildConfig.v2xMainSwitch
|
||||
scV2XSwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||
FunctionBuildConfig.v2xMainSwitch = isChecked
|
||||
if(isChecked){
|
||||
//V2N总开关
|
||||
scV2NSwitch.isChecked = FunctionBuildConfig.v2nMainSwitch
|
||||
hmiAction("SOP V2N总开关, ",FunctionBuildConfig.v2nMainSwitch)
|
||||
//V2I总开关
|
||||
scV2ISwitch.isChecked = HmiBuildConfig.isShowObuV2iView
|
||||
hmiAction("SOP V2I总开关, ",HmiBuildConfig.isShowObuV2iView)
|
||||
//V2V总开关
|
||||
scObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
|
||||
hmiAction("SOP V2V总开关, ",HmiBuildConfig.isShowObuV2vView)
|
||||
//obu总开关
|
||||
scObu.isChecked = obuConnectStatus
|
||||
hmiAction("SOP obu总开关, ",obuConnectStatus)
|
||||
if(obuConnectStatus){
|
||||
CallerObuApiManager.resetObuIpAddress(MogoObuConst.OBU_DEFAULT_IP)
|
||||
}
|
||||
}else{
|
||||
//V2N总开关
|
||||
scV2NSwitch.isChecked = false
|
||||
//V2I总开关
|
||||
scV2ISwitch.isChecked = false
|
||||
//V2V总开关
|
||||
scObuV2vView.isChecked = false
|
||||
hmiAction("SOP obuV2V开关, ",false)
|
||||
//obu总开关
|
||||
scObu.isChecked = false
|
||||
hmiAction("SOP OBU控制总开关, ",false)
|
||||
//断开链接
|
||||
CallerObuApiManager.disConnectObu()
|
||||
}
|
||||
scV2NSwitch.isEnabled = isChecked
|
||||
scV2ISwitch.isEnabled = isChecked
|
||||
scObuV2vView.isEnabled = isChecked
|
||||
scObu.isEnabled = isChecked
|
||||
}
|
||||
|
||||
//V2N总开关
|
||||
scV2NSwitch.isChecked = FunctionBuildConfig.v2nMainSwitch
|
||||
//根据V2N状态设置子开关是否可以点击
|
||||
//V2N新链路
|
||||
scNewV2NData.isEnabled = FunctionBuildConfig.v2nMainSwitch
|
||||
//V2N场景进PNC
|
||||
scV2nPnc.isEnabled = FunctionBuildConfig.v2nMainSwitch
|
||||
//绿波通行(默认关闭)
|
||||
scGreenWaveSop.isEnabled = FunctionBuildConfig.v2nMainSwitch
|
||||
scV2NSwitch.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(isChecked){
|
||||
//V2N新链路
|
||||
scNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData
|
||||
hmiAction("SOP 是否是V2N新链路(云->工控机->App)",FunctionBuildConfig.isNewV2NData)
|
||||
//V2N场景进PNC
|
||||
scV2nPnc.isChecked = FunctionBuildConfig.isV2NPnc
|
||||
hmiAction("SOP V2N场景进PNC, ",FunctionBuildConfig.isV2NPnc)
|
||||
CallerAutoPilotControlManager.sendV2nToPncCmd(FunctionBuildConfig.isV2NPnc)
|
||||
//绿波通行
|
||||
scGreenWaveSop.isChecked = HmiBuildConfig.isShowGreenWaveView
|
||||
hmiAction("SOP obu绿波通行, ",HmiBuildConfig.isShowGreenWaveView)
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, "1".toByteArray())
|
||||
}else{
|
||||
//V2N新链路
|
||||
scNewV2NData.isChecked = false
|
||||
hmiAction("SOP 是否是V2N新链路(云->工控机->App)",false)
|
||||
//V2N场景进PNC
|
||||
scV2nPnc.isChecked = false
|
||||
hmiAction("SOP V2N场景进PNC, ",false)
|
||||
CallerAutoPilotControlManager.sendV2nToPncCmd(false)
|
||||
//绿波通行
|
||||
scGreenWaveSop.isChecked = false
|
||||
hmiAction("SOP obu绿波通行, ",false)
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, "0".toByteArray())
|
||||
}
|
||||
scNewV2NData.isEnabled = isChecked
|
||||
scV2nPnc.isEnabled = isChecked
|
||||
scGreenWaveSop.isEnabled = isChecked
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
FunctionBuildConfig.v2nMainSwitch = isChecked
|
||||
}
|
||||
|
||||
//V2I总开关
|
||||
scV2ISwitch.isChecked = HmiBuildConfig.isShowObuV2iView //是否展示obu的v2i
|
||||
//根据V2I状态设置子开关是否可以点击
|
||||
scV2iPnc.isEnabled = HmiBuildConfig.isShowObuV2iView
|
||||
scRunRedLightSop.isEnabled = HmiBuildConfig.isShowObuV2iView
|
||||
scObuWeaknessTrafficSop.isEnabled = HmiBuildConfig.isShowObuV2iView
|
||||
scV2ISwitch.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(isChecked){
|
||||
//V2I场景进PNC
|
||||
scV2iPnc.isChecked = FunctionBuildConfig.isV2IPnc
|
||||
hmiAction("SOP V2I场景进PNC, ",FunctionBuildConfig.isV2IPnc)
|
||||
CallerAutoPilotControlManager.sendV2iToPncCmd(FunctionBuildConfig.isV2IPnc)
|
||||
//闯红灯预警
|
||||
scRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView
|
||||
hmiAction("SOP obu闯红灯预警, ",HmiBuildConfig.isShowRunRedLightView)
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_RUNREDLIGHT_WARNING, "1".toByteArray())
|
||||
//路侧弱势交通参与者
|
||||
scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
hmiAction("SOP obu弱势交通控制, ",HmiBuildConfig.isShowObuWeaknessTrafficView)
|
||||
}else{
|
||||
//V2I场景进PNC
|
||||
scV2iPnc.isChecked = false
|
||||
CallerAutoPilotControlManager.sendV2iToPncCmd(false)
|
||||
hmiAction("SOP V2I场景进PNC, ",false)
|
||||
//闯红灯预警
|
||||
scRunRedLightSop.isChecked = false
|
||||
hmiAction("SOP obu闯红灯预警, ",false)
|
||||
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_RUNREDLIGHT_WARNING, "0".toByteArray())
|
||||
|
||||
//路侧弱势交通参与者
|
||||
scObuWeaknessTrafficSop.isChecked = false
|
||||
|
||||
hmiAction("SOP obu弱势交通控制, ",false)
|
||||
}
|
||||
scV2iPnc.isEnabled = isChecked
|
||||
scRunRedLightSop.isEnabled = isChecked
|
||||
scObuWeaknessTrafficSop.isEnabled = isChecked
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
HmiBuildConfig.isShowObuV2iView = isChecked
|
||||
}
|
||||
|
||||
//V2N新链路
|
||||
scNewV2NData.isChecked = FunctionBuildConfig.isNewV2NData
|
||||
scNewV2NData.setOnCheckedChangeListener { _, isChecked ->
|
||||
scNewV2NData.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP 是否是V2N新链路(云->工控机->App)",isChecked)
|
||||
FunctionBuildConfig.isNewV2NData = isChecked
|
||||
}
|
||||
@@ -91,7 +227,10 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
|
||||
//绿波通行(默认关闭)
|
||||
scGreenWaveSop.isChecked = HmiBuildConfig.isShowGreenWaveView
|
||||
scGreenWaveSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
scGreenWaveSop.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP obu绿波通行, ",isChecked)
|
||||
HmiBuildConfig.isShowGreenWaveView = isChecked
|
||||
if (HmiBuildConfig.isShowGreenWaveView) {
|
||||
@@ -114,7 +253,10 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
|
||||
//闯红灯预警(默认关闭)
|
||||
scRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView
|
||||
scRunRedLightSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
scRunRedLightSop.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP obu闯红灯预警, ",isChecked)
|
||||
HmiBuildConfig.isShowRunRedLightView = isChecked
|
||||
if (HmiBuildConfig.isShowRunRedLightView) {
|
||||
@@ -126,21 +268,31 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
|
||||
//路侧弱势交通参与者(默认开启)
|
||||
scObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
scObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
scObuWeaknessTrafficSop.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP obu弱势交通控制, ",isChecked)
|
||||
HmiBuildConfig.isShowObuWeaknessTrafficView = isChecked
|
||||
}
|
||||
|
||||
//V2V总开关(默认关闭)
|
||||
scObuV2vView.isChecked = HmiBuildConfig.isShowObuV2vView
|
||||
scObuV2vView.setOnCheckedChangeListener { _, isChecked ->
|
||||
scObuV2vView.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP obuV2V开关, ",isChecked)
|
||||
HmiBuildConfig.isShowObuV2vView = isChecked
|
||||
}
|
||||
|
||||
//obu总开关
|
||||
scObu.isChecked = CallerObuApiManager.isConnected()
|
||||
scObu.setOnCheckedChangeListener { _, isChecked ->
|
||||
obuConnectStatus = CallerObuApiManager.isConnected()
|
||||
scObu.isChecked = obuConnectStatus
|
||||
scObu.setOnCheckedChangeListener { compoundButton, isChecked ->
|
||||
if(!compoundButton.isPressed){
|
||||
return@setOnCheckedChangeListener
|
||||
}
|
||||
hmiAction("SOP OBU控制总开关, ",isChecked)
|
||||
if (isChecked) {
|
||||
CallerObuApiManager.resetObuIpAddress(MogoObuConst.OBU_DEFAULT_IP)
|
||||
@@ -298,6 +450,7 @@ internal class SOPSettingView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
//限速标识
|
||||
//TODO
|
||||
scSpeedLimit.isChecked = HmiBuildConfig.isShowLimitingVelocityView
|
||||
scSpeedLimit.setOnCheckedChangeListener { _, isChecked ->
|
||||
hmiAction("SOP 限速标识开关, ",isChecked)
|
||||
|
||||
@@ -36,16 +36,15 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="V2X总开关"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_28"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:scaleY="1.6"
|
||||
android:scaleX="1.6"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:scaleY="1.4"
|
||||
android:scaleX="1.4"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
<!--V2N总开关-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/scV2NSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -53,7 +52,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scV2XSwitch"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:text="V2N总开关"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.4"
|
||||
android:scaleY="1.4"
|
||||
@@ -76,7 +74,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="V2N新链路"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -91,7 +88,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="V2N场景进PNC"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -124,8 +120,9 @@
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/v2xGuideLine"
|
||||
app:layout_constraintTop_toBottomOf="@id/scGreenWaveSop"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
/>
|
||||
<!--V2I场景进PNC-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
@@ -176,8 +173,9 @@
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/v2xGuideLine"
|
||||
app:layout_constraintTop_toBottomOf="@id/scObuWeaknessTrafficSop"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
/>
|
||||
<!--obu总开关-->
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
@@ -189,8 +187,9 @@
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/v2xGuideLine"
|
||||
app:layout_constraintTop_toBottomOf="@id/scObuV2vView"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -224,8 +223,8 @@
|
||||
android:textColor="@color/black"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
@@ -248,7 +247,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMapTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="危险障碍物颜色标记"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -263,7 +261,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvMapTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="引导线动态效果"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -278,7 +275,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scMarkingObstacles"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="点云效果"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -293,7 +289,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scRouteDynamicEffect"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="自车光圈"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -353,7 +348,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvVehicleTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="绕障类功能"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -368,7 +362,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvVehicleTitle"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="美化模式"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -383,7 +376,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scObstacleAvoidance"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="雨天模式"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -398,7 +390,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scDemoMode"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="弱网减速停车"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
@@ -413,7 +404,6 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/scRainMode"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:text="故障减速停车"
|
||||
android:textColor="@color/color_D4D8DC"
|
||||
android:textSize="@dimen/sp_28"
|
||||
android:scaleX="1.2"
|
||||
android:scaleY="1.2"
|
||||
|
||||
Reference in New Issue
Block a user