From 3dcb2e05de15c604506d77f442fd4633a5e0976a Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Fri, 25 Mar 2022 18:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加断开工控机连接功能入口 --- .../autopilot/MoGoAutopilotProvider.kt | 7 +++++++ .../hmi/ui/setting/DebugSettingView.kt | 9 +++++---- .../main/res/layout/view_debug_setting.xml | 20 ++++++++++++++++--- .../api/autopilot/IMoGoAutopilotProvider.kt | 5 +++++ .../call/autopilot/CallerAutoPilotManager.kt | 7 +++++++ 5 files changed, 41 insertions(+), 7 deletions(-) diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index 363922b59a..13d7dac84d 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -207,6 +207,13 @@ class MoGoAutopilotProvider : }, 1000, TimeUnit.MILLISECONDS) } + /** + * 断开与工控机的连接 + */ + override fun disconnectIpc() { + AdasManager.getInstance().disconnect() + } + override fun onMapCollectStart(cmdId: Int, cmdTime: Long) { val result = recordPackage(2, cmdId) CallerLogger.d("$M_ADAS_IMPL$TAG", "开始记录包: [$cmdId, $result]") 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 cd25df7a14..0bf25f12fd 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 @@ -396,9 +396,6 @@ class DebugSettingView @JvmOverloads constructor( //日志中心事件点击监听 setLogCheckedChangeListener() - - - //OBU配置信息 tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString() @@ -527,6 +524,10 @@ class DebugSettingView @JvmOverloads constructor( } } + //断开与工控机的连接 + btnDisconnectIpc.setOnClickListener { + CallerAutoPilotManager.disconnectIpc() + } updateSpeedSettingViews() @@ -966,7 +967,7 @@ class DebugSettingView @JvmOverloads constructor( } override fun upgradeVersionUrls(urls: Map?) { - //todo 版本信息更新 + } }) 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 d74b47cd8a..e6e28ae6db 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 @@ -604,13 +604,28 @@ app:layout_constraintTop_toTopOf="@id/btnSetAutopilotIP" app:layout_constraintBottom_toBottomOf="@id/btnSetAutopilotIP" app:layout_constraintLeft_toRightOf="@id/btnSetAutopilotIP" - app:layout_constraintRight_toRightOf="parent" + app:layout_constraintRight_toLeftOf="@id/btnDisconnectIpc" android:layout_marginStart="@dimen/dp_30" - android:layout_marginEnd="@dimen/dp_30" + android:layout_marginEnd="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" android:layout_marginBottom="@dimen/dp_10" /> +