From 4d3ddd72913b175bf425b21c54b809d9fc14c4fd Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Mon, 15 Jul 2024 20:28:09 +0800 Subject: [PATCH] =?UTF-8?q?[6.4.4=5Fpnc=5Fpark]=E8=BF=90=E8=90=A5=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=A2=9E=E5=8A=A0PNC=5Fpar=5F=E4=BC=9A=E8=BD=A6?= =?UTF-8?q?=E3=80=81=E8=B6=85=E8=BD=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/MoGoAutopilotControlProvider.kt | 28 +++++++++++++++ .../function/hmi/ui/setting/SOPSettingView.kt | 18 ++++++++++ .../src/main/res/layout/view_sop_setting.xml | 34 +++++++++++++++++-- .../core/data/config/FunctionBuildConfig.kt | 16 +++++++++ .../IMoGoAutopilotControlProvider.kt | 16 +++++++++ .../CallerAutoPilotControlManager.kt | 20 +++++++++++ 6 files changed, 130 insertions(+), 2 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt index 9849c55113..9b06a4edfb 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt @@ -619,6 +619,34 @@ class MoGoAutopilotControlProvider : } } + /** + * 会车开关 + * isEnable = true 开启 + * isEnable = false 关闭 + * @return boolean + */ + override fun sendParkVehCross(isEnable: Boolean): Boolean { + return if (isEnable) { + AdasManager.getInstance().sendParkVehCross(1) > -1 + } else { + AdasManager.getInstance().sendParkVehCross(0) > -1 + } + } + + /** + * 超车开关 + * isEnable = true 开启 + * isEnable = false 关闭 + * @return boolean + */ + override fun sendParkVehOvertake(isEnable: Boolean): Boolean { + return if (isEnable) { + AdasManager.getInstance().sendParkVehOvertake(1) > -1 + } else { + AdasManager.getInstance().sendParkVehOvertake(0) > -1 + } + } + /** * 变道绕障的目标障碍物速度阈值 * @param speed 速度阈值 m/s diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 368e2d6a61..b0fa1c1e75 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -71,6 +71,8 @@ import kotlinx.android.synthetic.main.view_sop_setting.view.scObstacleAvoidance import kotlinx.android.synthetic.main.view_sop_setting.view.scObu import kotlinx.android.synthetic.main.view_sop_setting.view.scObuV2vView import kotlinx.android.synthetic.main.view_sop_setting.view.scObuWeaknessTrafficSop +import kotlinx.android.synthetic.main.view_sop_setting.view.scParkVehCross +import kotlinx.android.synthetic.main.view_sop_setting.view.scParkVehOvertake import kotlinx.android.synthetic.main.view_sop_setting.view.scRainMode import kotlinx.android.synthetic.main.view_sop_setting.view.scRouteDynamicEffect import kotlinx.android.synthetic.main.view_sop_setting.view.scRunRedLightSop @@ -511,6 +513,22 @@ internal class SOPSettingView @JvmOverloads constructor( * 与车相关类设置 */ private fun vehicleSetting() { + //PNC-park-会车 + scParkVehCross.isChecked = FunctionBuildConfig.isOpenParkVehCross + scParkVehCross.setOnCheckedChangeListener { _, isChecked -> + hmiAction("SOP PNC-park-会车, ", isChecked) + CallerAutoPilotControlManager.sendParkVehCross(isChecked) + FunctionBuildConfig.isOpenParkVehCross = isChecked + } + //PNC-park-超车 + scParkVehOvertake.isChecked = FunctionBuildConfig.isOpenOvertake + scParkVehOvertake.setOnCheckedChangeListener { _, isChecked -> + hmiAction("SOP PNC-park-超车, ", isChecked) + CallerAutoPilotControlManager.sendParkVehOvertake(isChecked) + FunctionBuildConfig.isOpenOvertake = isChecked + } + + //绕障类功能 scObstacleAvoidance.isChecked = FunctionBuildConfig.isDetouring scObstacleAvoidance.setOnCheckedChangeListener { _, isChecked -> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index c41a080f15..f94f9a8ae7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -410,6 +410,36 @@ app:layout_constraintGuide_percent="0.5" app:layout_constraintLeft_toLeftOf="@id/tvVehicleTitle" app:layout_constraintRight_toRightOf="parent" /> + + + + + + + + app:layout_constraintTop_toBottomOf="@id/scParkVehCross" /> + app:layout_constraintTop_toBottomOf="@id/scParkVehOvertake" />