From 27f3bf3ae092782ff0cfdf44ae5b1b6f3ab13fcd Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Wed, 13 Apr 2022 12:10:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改不规范代码 --- .../hmi/ui/setting/DebugSettingView.kt | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index ff38bc4435..244418a7da 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -16,7 +16,6 @@ import chassis.Chassis import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.commons.AbsMogoApplication import com.mogo.commons.debug.DebugConfig -import com.mogo.commons.voice.AIAssist import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.autopilot.* import com.mogo.eagle.core.data.config.FunctionBuildConfig @@ -463,7 +462,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 修改地图样式按钮(白天模式、夜间模式) */ - tbChangeCurrentMapStyle.setOnCheckedChangeListener { buttonView, isChecked -> + tbChangeCurrentMapStyle.setOnCheckedChangeListener { _, isChecked -> CallerHDMapManager.stepInVrMode(isChecked) } @@ -521,7 +520,7 @@ class DebugSettingView @JvmOverloads constructor( // 演示模式,上一次勾选的数据 - tbIsDrawAutopilotTrajectoryData.setOnCheckedChangeListener { buttonView, isChecked -> + tbIsDrawAutopilotTrajectoryData.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = isChecked } @@ -540,7 +539,7 @@ class DebugSettingView @JvmOverloads constructor( else -> R.id.rbGpsProviderAndroid } ) - rgGpsProvider.setOnCheckedChangeListener { group, checkedId -> + rgGpsProvider.setOnCheckedChangeListener { _, checkedId -> when (checkedId) { R.id.rbGpsProviderAndroid -> { FunctionBuildConfig.gpsProvider = 0 @@ -557,13 +556,13 @@ class DebugSettingView @JvmOverloads constructor( // 初始化 ADAS感知数据是否绘制 选择情况 tbIsDrawIdentifyData.isChecked = FunctionBuildConfig.isDrawIdentifyData - tbIsDrawIdentifyData.setOnCheckedChangeListener { buttonView, isChecked -> + tbIsDrawIdentifyData.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isDrawIdentifyData = isChecked } // 初始化 ADAS感知数据是否绘制 选择情况 tbIsDrawUnknownIdentifyData.isChecked = FunctionBuildConfig.isDrawUnknownIdentifyData - tbIsDrawUnknownIdentifyData.setOnCheckedChangeListener { buttonView, isChecked -> + tbIsDrawUnknownIdentifyData.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isDrawUnknownIdentifyData = isChecked } @@ -574,7 +573,7 @@ class DebugSettingView @JvmOverloads constructor( // } // 模拟自动驾驶中 - tbChangeAutoPilotStatus.setOnCheckedChangeListener { buttonView, isChecked -> + tbChangeAutoPilotStatus.setOnCheckedChangeListener { _, isChecked -> CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked) } when { @@ -609,7 +608,7 @@ class DebugSettingView @JvmOverloads constructor( //设置刹车加速度阈值信息 btnBrakeThreshold.setOnClickListener { val thresholdStr = etInputBrakeThreshold.text.toString() - if(thresholdStr.isNullOrEmpty()){ + if(thresholdStr.isEmpty()){ ToastUtils.showShort("请输入正确的判定刹车加速度阈值") }else{ try{ @@ -871,7 +870,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 显示、隐藏迈速表 */ - tbSpeedView.setOnCheckedChangeListener { buttonView, isChecked -> + tbSpeedView.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setSpeedChartViewVisibility(View.VISIBLE) } else { @@ -882,7 +881,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 显示、隐藏“自动驾驶控制按钮” */ - tbAutopilotStatusView.setOnCheckedChangeListener { buttonView, isChecked -> + tbAutopilotStatusView.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setAutopilotStatusViewVisibility(View.VISIBLE) } else { @@ -893,7 +892,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 显示、隐藏视角切换按钮 */ - tbPerspectiveSwitchView.setOnCheckedChangeListener { buttonView, isChecked -> + tbPerspectiveSwitchView.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setPerspectiveSwitchViewVisibility(View.VISIBLE) } else { @@ -904,7 +903,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 显示、隐藏工具箱 */ - tbCheckStatusView.setOnCheckedChangeListener { buttonView, isChecked -> + tbCheckStatusView.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setToolsViewVisibility(View.VISIBLE) } else { @@ -927,7 +926,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 打开、关闭转向灯控制 */ - tbOpenLight.setOnCheckedChangeListener { buttonView, isChecked -> + tbOpenLight.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setTurnLightFunction(true) } else { @@ -938,7 +937,7 @@ class DebugSettingView @JvmOverloads constructor( /** * 打开、关闭刹车控制 */ - tbOpenBrakeLight.setOnCheckedChangeListener { buttonView, isChecked -> + tbOpenBrakeLight.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setBrakeLightFunction(true) } else { @@ -949,7 +948,7 @@ class DebugSettingView @JvmOverloads constructor( /** * sn绑定控制 */ - tbOpenSnBinding.setOnCheckedChangeListener { buttonView, isChecked -> + tbOpenSnBinding.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { CallerHmiManager.setSnBinding(true) } else { @@ -1312,7 +1311,7 @@ class DebugSettingView @JvmOverloads constructor( */ private fun dataFilter(list: ArrayList): ArrayList { val tempList = ArrayList() - list?.let { + list.let { it.iterator().forEach { entity-> if(onlineSelected && entity.name.contains("online")){ tempList.add(entity) @@ -1591,7 +1590,7 @@ class DebugSettingView @JvmOverloads constructor( * 工控机基础信息回调 */ override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { - carConfigResp?.let { + carConfigResp.let { AppConfigInfo.plateNumber = it.plateNumber//车牌号 AppConfigInfo.iPCMacAddress = it.macAddress//工控机MAC地址 AppConfigInfo.protocolVersionNumber = it.protocolVersion.number//工控机协议版本