From 9802124169df132fe3f5f1619dd26982d6722e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Tue, 12 Oct 2021 21:24:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=A9=BE=E9=A9=B6=E7=8A=B6=E6=80=81=E4=BF=A1=E6=81=AF=E5=9B=9E?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 董宏宇 --- .idea/misc.xml | 2 +- .../autopilot/MoGoAutoPilotProvider.java | 1 - .../hmi/ui/setting/DebugSettingView.kt | 29 +++- .../main/res/layout/view_debug_setting.xml | 43 ++++-- .../obu/mogo/MogoPrivateObuManager.kt | 8 +- .../data/autopilot/AutopilotStatusInfo.kt | 57 ++++++++ .../IMoGoAutoPilotStatusListener.java | 18 ++- .../CallerAutoPilotStatusListenerManager.kt | 127 ++++++++++++++++++ .../call/obu/CallerObuListenerManager.kt | 17 ++- modules/mogo-module-adas/build.gradle | 2 + .../mogo/module/adas/AdasEventManager.java | 24 +++- .../mogo/module/adas/IAdasDataListener.java | 5 - modules/mogo-module-common/build.gradle | 1 + .../SnapshotLocationDataCenter.java | 11 +- .../service/impl/adas/MogoADASController.java | 1 + 15 files changed, 309 insertions(+), 37 deletions(-) create mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutopilotStatusInfo.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt diff --git a/.idea/misc.xml b/.idea/misc.xml index 37fc2ab8e9..e73cf5868e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -16,7 +16,7 @@ - + diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutoPilotProvider.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutoPilotProvider.java index dd0bf443e9..23e8734979 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutoPilotProvider.java +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutoPilotProvider.java @@ -5,7 +5,6 @@ import android.content.Context; import com.mogo.eagle.core.data.autopilot.AdasControlCommandParameter; import com.mogo.eagle.core.data.autopilot.RemoteControlAutoPilotParameters; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotProvider; -import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener; import com.mogo.eagle.core.utilcode.util.GsonUtils; import com.mogo.eagle.core.utilcode.util.LogUtils; import com.zhidao.support.adas.high.AdasManager; 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 c2ab39e8e8..dcbd2d555a 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 @@ -6,9 +6,13 @@ import android.view.LayoutInflater import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.cloud.passport.MoGoAiCloudClient import com.mogo.eagle.core.data.app.AppConfigInfo +import com.mogo.eagle.core.data.autopilot.AdasOCHData +import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.obu.ObuStatusInfo +import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager import com.mogo.eagle.core.function.call.obu.CallerOBUManager import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager import com.mogo.eagle.core.function.hmi.R @@ -30,7 +34,8 @@ class DebugSettingView @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 -) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener { +) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener, + IMoGoAutoPilotStatusListener { private val TAG = "DebugSettingView" @@ -42,16 +47,19 @@ class DebugSettingView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() CallerObuListenerManager.addListener(TAG, this) + CallerAutoPilotStatusListenerManager.addListener(TAG, this) } override fun onDetachedFromWindow() { super.onDetachedFromWindow() CallerObuListenerManager.removeListener(TAG) - + CallerAutoPilotStatusListenerManager.removeListener(TAG) } private fun initView() { - tvObuInfo.text = CallerObuListenerManager.getObuStatusInfo() + tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString() + tvAutopilotInfo.text = + CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString() // 初始化App 配置信息 val appConfigInfo = AppConfigInfo() @@ -89,4 +97,19 @@ class DebugSettingView @JvmOverloads constructor( tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) } + /** + * 自动驾驶相关回调 + */ + override fun onAutoPilotArriveAtStation(data: AdasOCHData?) { + + } + + override fun onAutoPilotStateChanged(state: Int, reason: String?) { + + } + + override fun onAutoPilotStatusResponse(autopilotStatusInfo: AutopilotStatusInfo?) { + tvAutopilotInfo.text = GsonUtils.toJson(autopilotStatusInfo) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index ccfc505233..9fabf69347 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -1,7 +1,7 @@ - +