From cee45c4fb4415f9479bc93207ba1c1e74190a7fa Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 21 Dec 2021 18:03:55 +0800 Subject: [PATCH] =?UTF-8?q?[Add]=20=E5=A2=9E=E5=8A=A0=E4=BA=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=BF=9E=E6=8E=A5=E5=B7=A5=E6=8E=A7=E6=9C=BAIP?= =?UTF-8?q?=E7=9A=84=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- app/build.gradle | 58 -------- config.gradle | 2 +- .../autopilot/MoGoAutopilotProvider.kt | 29 +++- .../hmi/ui/setting/DebugSettingView.kt | 18 +++ .../main/res/layout/view_debug_setting.xml | 19 +++ .../mogo-core-function-main/build.gradle | 124 +++++++++--------- .../function/main/MainMoGoApplication.java | 2 +- .../api/autopilot/IMoGoAutopilotProvider.java | 6 +- .../call/autopilot/CallerAutoPilotManager.kt | 14 +- .../map/impl/custom/CustomMapApiBuilder.java | 2 +- modules.txt | 1 - modules/mogo-module-push-noop/.gitignore | 14 -- modules/mogo-module-push-noop/README.md | 4 - modules/mogo-module-push-noop/build.gradle | 60 --------- .../mogo-module-push-noop/consumer-rules.pro | 0 .../mogo-module-push-noop/gradle.properties | 3 - .../mogo-module-push-noop/proguard-rules.pro | 21 --- .../src/main/AndroidManifest.xml | 3 - .../module/push/noop/PushModuleProvider.java | 80 ----------- settings.gradle | 1 - .../main/java/com/mogo/tts/pad/PadTTS.java | 1 + 21 files changed, 145 insertions(+), 317 deletions(-) delete mode 100644 modules/mogo-module-push-noop/.gitignore delete mode 100644 modules/mogo-module-push-noop/README.md delete mode 100644 modules/mogo-module-push-noop/build.gradle delete mode 100644 modules/mogo-module-push-noop/consumer-rules.pro delete mode 100644 modules/mogo-module-push-noop/gradle.properties delete mode 100644 modules/mogo-module-push-noop/proguard-rules.pro delete mode 100644 modules/mogo-module-push-noop/src/main/AndroidManifest.xml delete mode 100644 modules/mogo-module-push-noop/src/main/java/com/mogo/module/push/noop/PushModuleProvider.java diff --git a/app/build.gradle b/app/build.gradle index be86273e76..c67b2e265e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -192,67 +192,9 @@ dependencies { releaseImplementation rootProject.ext.dependencies.releaseleakcanary if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { - implementation rootProject.ext.dependencies.mogoaicloudservicesdk - implementation rootProject.ext.dependencies.mogocommons - implementation rootProject.ext.dependencies.modulecommon - implementation rootProject.ext.dependencies.mogoservice - implementation rootProject.ext.dependencies.moduleV2x - implementation rootProject.ext.dependencies.moduleshare - implementation rootProject.ext.dependencies.tanluupload - implementation rootProject.ext.dependencies.mogomonitor - implementation rootProject.ext.dependencies.moduleextensions - implementation rootProject.ext.dependencies.modulemap - implementation rootProject.ext.dependencies.moduleADAS - implementation rootProject.ext.dependencies.modulepushbase - implementation rootProject.ext.dependencies.modulepush - implementation rootProject.ext.dependencies.callchat - implementation rootProject.ext.dependencies.callchatprovider - implementation rootProject.ext.dependencies.mapcustom - implementation rootProject.ext.dependencies.crashreportupgrade - implementation rootProject.ext.dependencies.crashreportbugly - - implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_function_main - implementation rootProject.ext.dependencies.mogo_core_function_obu_mogo - implementation rootProject.ext.dependencies.mogo_core_function_smp - implementation rootProject.ext.dependencies.mogo_core_function_hmi - implementation rootProject.ext.dependencies.mogo_core_function_notice - implementation rootProject.ext.dependencies.mogo_core_function_autopilot - implementation rootProject.ext.dependencies.mogo_core_function_check - implementation rootProject.ext.dependencies.mogo_core_function_map - implementation rootProject.ext.dependencies.mogo_core_function_v2x - implementation rootProject.ext.dependencies.mogo_core_function_monitoring } else { - implementation project(':foudations:mogo-aicloud-services-sdk') - implementation project(':foudations:mogo-commons') - implementation project(':modules:mogo-module-common') - implementation project(':modules:mogo-module-service') - implementation project(':modules:mogo-module-v2x') - implementation project(':modules:mogo-module-share') - implementation project(':modules:tanlulib') - implementation project(':modules:mogo-module-monitor') - implementation project(':modules:mogo-module-extensions') - implementation project(':modules:mogo-module-map') - implementation project(':modules:mogo-module-adas') - implementation project(":modules:mogo-module-push-base") - implementation project(":modules:mogo-module-push") - implementation project(':modules:mogo-module-carchatting') - implementation project(':modules:mogo-module-carchattingprovider') - implementation project(':libraries:map-custom') - implementation project(':test:crashreport-upgrade') -// implementation project(':test:crashreport-bugly') - - implementation project(':core:mogo-core-data') implementation project(':core:function-impl:mogo-core-function-main') - implementation project(':core:function-impl:mogo-core-function-obu-mogo') - implementation project(':core:function-impl:mogo-core-function-smp') - implementation project(':core:function-impl:mogo-core-function-hmi') - implementation project(':core:function-impl:mogo-core-function-autopilot') - implementation project(':core:function-impl:mogo-core-function-check') - implementation project(':core:function-impl:mogo-core-function-map') - implementation project(':core:function-impl:mogo-core-function-notice') - implementation project(':core:function-impl:mogo-core-function-v2x') - implementation project(':core:function-impl:mogo-core-function-monitoring') } apply from: "./functions/tts.gradle" diff --git a/config.gradle b/config.gradle index 902901d534..ce9ec23bb0 100644 --- a/config.gradle +++ b/config.gradle @@ -114,7 +114,7 @@ ext { obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", mogoobu : 'com.zhidao.support.obu:mogoobu:1.0.0.19', mogoami : 'com.zhidao.support.obu.ami:mogoami:1.0.0.10', - adasHigh : 'com.zhidao.support.adas:high:1.2.1.1', + adasHigh : 'com.zhidao.support.adas:high:1.2.1.2', // google googlezxing : "com.google.zxing:core:3.3.3", 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 e51c6d550f..0a59085289 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 @@ -1,6 +1,8 @@ package com.mogo.eagle.core.function.autopilot +import android.Manifest.permission import android.content.Context +import androidx.annotation.RequiresPermission import com.alibaba.android.arouter.facade.annotation.Route import com.mogo.eagle.core.data.autopilot.AutopilotControlCmdParameter import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters @@ -9,8 +11,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer import com.mogo.eagle.core.utilcode.util.GsonUtils import com.mogo.eagle.core.utilcode.util.LogUtils +import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.zhidao.support.adas.high.AdasManager import com.zhidao.support.adas.high.common.CupidLogUtils +import java.util.concurrent.TimeUnit /** * @author xiaoyuzhou @@ -19,7 +23,7 @@ import com.zhidao.support.adas.high.common.CupidLogUtils */ @Route(path = MogoServicePaths.PATH_AUTO_PILOT) class MoGoAutopilotProvider : - IMoGoAutopilotProvider { + IMoGoAutopilotProvider { private val TAG = "MoGoAutoPilotProvider" override val functionName: String @@ -31,8 +35,29 @@ class MoGoAutopilotProvider : AsyncDataToAutopilotServer.INSTANCE.initServer() } - override fun connectAutoPilot() { + /** + * 连接自动驾驶域控制器 + * + * @param autoPilotIp 指定与控制器IP + */ + override fun resetIpAddress(autoPilotIp: String) { + // 关闭通信 + AdasManager.getInstance().closeAllMsg() + // 延时执行连接指定IP地址 + ThreadUtils.executeBySingleWithDelay(object : ThreadUtils.SimpleTask() { + @RequiresPermission(permission.INTERNET) + override fun doInBackground(): String { + // 设置IP地址 + AdasManager.getInstance().setIPCIp(autoPilotIp) + // 打开通讯连接 + AdasManager.getInstance().startAllMsg() + return "" + } + override fun onSuccess(result: String?) { + + } + }, 1000, TimeUnit.MILLISECONDS) } override fun startAutoPilot(result: AutopilotControlParameters) { 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 d5af6d9536..15f4c9551d 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 @@ -165,6 +165,24 @@ class DebugSettingView @JvmOverloads constructor( } } + // 初始化工控机 IP信息 + val autoPilotIpAddress = + SharedPrefsMgr.getInstance(context).getString(MoGoConfig.AUTOPILOT_IP, "192.168.1.102") + + etAutopilotIP.setText(autoPilotIpAddress) + etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) } + + btnSetAutopilotIP.setOnClickListener { + val autoPilotIp = etAutopilotIP.text.toString() + if (autoPilotIp.isNotEmpty()) { + CallerAutoPilotManager.resetIpAddress(autoPilotIp) + // 保存本地 AutoPilot IP地址 + SharedPrefsMgr.getInstance(context).putString(MoGoConfig.AUTOPILOT_IP, autoPilotIp) + } else { + ToastUtils.showShort("请输入正确的IP地址") + } + } + // 域控制器 btnRecordPackage.setOnClickListener { CallerAutoPilotManager.recordPackage() 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 98d8b17085..b6682323d5 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 @@ -409,6 +409,25 @@ android:textColor="#000" android:textSize="@dimen/dp_34" android:textStyle="bold" /> + + +