From bee1572295634474a7d640388869b722fe6a97d0 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Fri, 23 Sep 2022 12:03:59 +0800 Subject: [PATCH] add func of take over in condition --- .../core/function/hmi/ui/MoGoHmiFragment.kt | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index 63eb143fe9..8ae5d0cce1 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -45,6 +45,7 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy import com.mogo.eagle.core.function.api.hmi.IMoGoHmiViewProxy.IViewNotificationProvider import com.mogo.eagle.core.function.api.hmi.view.IOchBusView @@ -55,6 +56,7 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener 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.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager import com.mogo.eagle.core.function.call.check.CallerCheckManager @@ -1394,10 +1396,10 @@ class MoGoHmiFragment : MvpFragment(), ) reportListFloatWindow?.refreshData(reportList) - if(FunctionBuildConfig.isDemoMode){ + if (FunctionBuildConfig.isDemoMode) { return@let } - if(takeOver){ + if (takeOver) { return@let } when (it.code) { @@ -1405,25 +1407,28 @@ class MoGoHmiFragment : MvpFragment(), EXIT_AUTOPILOT_FOR_LOCATION, EXIT_AUTOPILOT_FOR_CHASSIS, EXIT_AUTOPILOT_FOR_DISTANCE -> { - showWarningV2X( - EventTypeEnum.TAKE_OVER_EVENT.poiType, - EventTypeEnum.TAKE_OVER_EVENT.content, - EventTypeEnum.TAKE_OVER_EVENT.tts, - EventTypeEnum.TAKE_OVER_EVENT.poiType, - object : IMoGoWarningStatusListener { - override fun onShow() { - takeOver = true - clTakeOverView.visibility = View.VISIBLE - } + if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + && getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING) { + showWarningV2X( + EventTypeEnum.TAKE_OVER_EVENT.poiType, + EventTypeEnum.TAKE_OVER_EVENT.content, + EventTypeEnum.TAKE_OVER_EVENT.tts, + EventTypeEnum.TAKE_OVER_EVENT.poiType, + object : IMoGoWarningStatusListener { + override fun onShow() { + takeOver = true + clTakeOverView.visibility = View.VISIBLE + } - override fun onDismiss() { - takeOver = false - clTakeOverView.visibility = View.GONE - } - }, - true, - 6000L - ) + override fun onDismiss() { + takeOver = false + clTakeOverView.visibility = View.GONE + } + }, + true, + 6000L + ) + } } } }