From 9023bacf2411fadb7886af86d0bebfc8e2d55afd Mon Sep 17 00:00:00 2001 From: yangyakun Date: Tue, 4 Jun 2024 11:18:19 +0800 Subject: [PATCH] =?UTF-8?q?[6.4.4]=20[=E8=87=AA=E5=8A=A8=E9=A9=BE=E9=A9=B6?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4toast=E6=8F=90=E7=A4=BA]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OchAutoPilotStatusListenerManager.kt | 27 ++++++++++++++++--- .../common/src/main/res/values/strings.xml | 3 +++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt index 733f62b82a..632ac2859d 100644 --- a/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt +++ b/OCH/common/common/src/main/java/com/mogo/och/common/module/manager/autopilot/autopilot/OchAutoPilotStatusListenerManager.kt @@ -4,6 +4,8 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager +import com.mogo.eagle.core.utilcode.util.ToastUtils +import com.mogo.och.common.module.R import com.mogo.och.common.module.manager.autopilot.trajectory.TrajectoryManager import com.mogo.och.common.module.utils.CallerBase import com.zhjt.mogo.adas.data.AdasConstants @@ -13,11 +15,31 @@ import mogo_msg.MogoReportMsg import system_master.SsmInfo import system_master.SystemStatusInfo import java.lang.Exception +import kotlin.properties.Delegates object OchAutoPilotStatusListenerManager : CallerBase(),IMoGoAutopilotStatusListener, (Boolean) -> Unit { const val TAG = "OCHAutoPilotStatusListenerManager" + + private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue -> + if (oldValue != newValue) { + if(oldValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){ + if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){ + ToastUtils.showLong(R.string.common_change2_autopilot2_manual) + } + }else if(oldValue==IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING){ + if(newValue==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE){ + ToastUtils.showLong(R.string.common_change2_pxjs_manual) + } + } + + M_LISTENERS.forEach { + val listener = it.value + listener.onAutopilotStatusResponse(newValue) + } + } + } init { //2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口 CallerAutoPilotStatusListenerManager.addListener(TAG, this) @@ -37,10 +59,7 @@ object OchAutoPilotStatusListenerManager : CallerBase取消 扫描二维码完成车辆绑定 + + 自动驾驶已退出,请立即接管,注意周边环境 小心驾驶 + 平行驾驶已退出,请立即接管,注意周边环境 小心驾驶 \ No newline at end of file