From dbaca9cafb996502fd1b406bb759efbd604d5a00 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 9 Nov 2023 18:24:55 +0800 Subject: [PATCH] =?UTF-8?q?[6.2.0][Feat]=E8=B0=83=E8=AF=95=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=96=B0=E5=A2=9E=E6=97=A0=E4=BA=BA=E5=8C=96=E6=BC=94?= =?UTF-8?q?=E7=BB=83=E4=BB=BB=E5=8A=A1=E6=8B=89=E5=8F=96=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/setting/SOPSettingView.kt | 21 +++++-- .../src/main/res/layout/view_sop_setting.xml | 57 ++++++++++++++++++- .../src/main/res/values/strings.xml | 2 + .../api/unmanned/IUnmannedListener.kt | 8 +++ .../unmanned/CallerUnmannedListenerManager.kt | 31 ++++++++++ 5 files changed, 114 insertions(+), 5 deletions(-) create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/unmanned/IUnmannedListener.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/unmanned/CallerUnmannedListenerManager.kt 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 36d15a2f70..b713f0c36d 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 @@ -1,8 +1,6 @@ package com.mogo.eagle.core.function.hmi.ui.setting import android.content.Context -import android.text.Editable -import android.text.TextWatcher import android.util.AttributeSet import android.view.LayoutInflater import android.view.View @@ -30,11 +28,10 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.obu.CallerObuApiManager import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager +import com.mogo.eagle.core.function.call.unmanned.CallerUnmannedListenerManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog.Companion.hmiAction import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils -import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.zhjt.mogo.adas.data.AdasConstants @@ -493,6 +490,22 @@ internal class SOPSettingView @JvmOverloads constructor( hmiAction("SOP 融合模式, ", FunctionBuildConfig.fusionMode) CallerAutoPilotControlManager.sendFusionMode(FunctionBuildConfig.fusionMode) } + rgPullTime.setOnCheckedChangeListener { _, checkedId -> + when (checkedId) { + R.id.rbFortyFive -> { + CallerUnmannedListenerManager.dispatchPullTime(45) + } + R.id.rbThirty -> { + CallerUnmannedListenerManager.dispatchPullTime(30) + } + R.id.rbFifteen -> { + CallerUnmannedListenerManager.dispatchPullTime(15) + } + R.id.rbFive -> { + CallerUnmannedListenerManager.dispatchPullTime(5) + } + } + } } private var overTakeEditText: String = "" 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 add4a3d93e..1a05165d25 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 @@ -544,11 +544,66 @@ android:scaleX="1.2" android:scaleY="1.2" android:text="录包弹窗" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="@id/otherGuideLine" app:layout_constraintTop_toBottomOf="@id/scIPCReport" /> + + + + + + + + + + + + diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml index f47fcdb292..d5c81d68b3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml @@ -91,4 +91,6 @@ 同步中... 请求失败 异常 + + Taxi无人化演练任务拉取时间间隔 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/unmanned/IUnmannedListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/unmanned/IUnmannedListener.kt new file mode 100644 index 0000000000..bcb477607a --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/unmanned/IUnmannedListener.kt @@ -0,0 +1,8 @@ +package com.mogo.eagle.core.function.api.unmanned + +interface IUnmannedListener { + /** + * 单位: 秒(s) + */ + fun onPullTimeUpdate(time: Int) +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/unmanned/CallerUnmannedListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/unmanned/CallerUnmannedListenerManager.kt new file mode 100644 index 0000000000..7976be5de4 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/unmanned/CallerUnmannedListenerManager.kt @@ -0,0 +1,31 @@ +package com.mogo.eagle.core.function.call.unmanned + +import android.util.Log +import com.mogo.eagle.core.function.api.unmanned.IUnmannedListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * 无人化功能状态监听、回调管理者 + */ +object CallerUnmannedListenerManager:CallerBase() { + private const val TAG = "CallerUnmannedListenerManager" + + private var time: Int = 45 + + override fun doSomeAfterAddListener(tag: String, listener: IUnmannedListener) { + super.doSomeAfterAddListener(tag, listener) + listener.onPullTimeUpdate(time) + } + + fun dispatchPullTime(time: Int) { + this.time = time + M_LISTENERS.forEach { + val listener = it.value + try { + listener.onPullTimeUpdate(time) + } catch (e: Exception) { + Log.e(TAG, "转发消息出现异常:${e.message}") + } + } + } +} \ No newline at end of file