增加了设置连接工控机IP的调用

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2021-12-21 18:03:55 +08:00
parent 9bbb5ede54
commit cee45c4fb4
21 changed files with 145 additions and 317 deletions

View File

@@ -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"

View File

@@ -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",

View File

@@ -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<String>() {
@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) {

View File

@@ -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()

View File

@@ -409,6 +409,25 @@
android:textColor="#000"
android:textSize="@dimen/dp_34"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etAutopilotIP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#32009688"
android:gravity="center"
android:minHeight="48dp"
android:padding="@dimen/dp_5"
android:text="192.168.1.102"
android:textSize="@dimen/dp_34" />
<Button
android:id="@+id/btnSetAutopilotIP"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="设置IP"
android:textSize="@dimen/dp_34" />
<Button
android:id="@+id/btnRecordPackage"

View File

@@ -63,73 +63,73 @@ dependencies {
implementation rootProject.ext.dependencies.mogoami
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.moduleservice
api rootProject.ext.dependencies.mogoaicloudservicesdk
api rootProject.ext.dependencies.mogocommons
api rootProject.ext.dependencies.modulecommon
api rootProject.ext.dependencies.mogoservice
api rootProject.ext.dependencies.moduleV2x
api rootProject.ext.dependencies.moduleshare
api rootProject.ext.dependencies.tanluupload
api rootProject.ext.dependencies.mogomonitor
api rootProject.ext.dependencies.moduleextensions
api rootProject.ext.dependencies.modulemap
api rootProject.ext.dependencies.moduleADAS
api rootProject.ext.dependencies.modulepushbase
api rootProject.ext.dependencies.modulepush
api rootProject.ext.dependencies.callchat
api rootProject.ext.dependencies.callchatprovider
api rootProject.ext.dependencies.mapcustom
api rootProject.ext.dependencies.crashreportupgrade
// api rootProject.ext.dependencies.crashreportbugly
api rootProject.ext.dependencies.moduleservice
implementation rootProject.ext.dependencies.mogo_core_data
implementation rootProject.ext.dependencies.mogo_core_utils
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
api rootProject.ext.dependencies.mogo_core_data
api rootProject.ext.dependencies.mogo_core_utils
api rootProject.ext.dependencies.mogo_core_function_obu_mogo
api rootProject.ext.dependencies.mogo_core_function_smp
api rootProject.ext.dependencies.mogo_core_function_hmi
api rootProject.ext.dependencies.mogo_core_function_notice
api rootProject.ext.dependencies.mogo_core_function_autopilot
api rootProject.ext.dependencies.mogo_core_function_check
api rootProject.ext.dependencies.mogo_core_function_map
api rootProject.ext.dependencies.mogo_core_function_v2x
api rootProject.ext.dependencies.mogo_core_function_monitoring
implementation rootProject.ext.dependencies.modulemain
api rootProject.ext.dependencies.modulemain
} 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(':modules:mogo-module-service')
api project(':foudations:mogo-aicloud-services-sdk')
api project(':foudations:mogo-commons')
api project(':modules:mogo-module-common')
api project(':modules:mogo-module-service')
api project(':modules:mogo-module-v2x')
api project(':modules:mogo-module-share')
api project(':modules:tanlulib')
api project(':modules:mogo-module-monitor')
api project(':modules:mogo-module-extensions')
api project(':modules:mogo-module-map')
api project(':modules:mogo-module-adas')
api project(":modules:mogo-module-push-base")
api project(":modules:mogo-module-push")
api project(':modules:mogo-module-carchatting')
api project(':modules:mogo-module-carchattingprovider')
api project(':libraries:map-custom')
api project(':test:crashreport-upgrade')
// api project(':test:crashreport-bugly')
api project(':modules:mogo-module-service')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
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')
api project(':core:mogo-core-data')
api project(':core:mogo-core-utils')
api project(':core:function-impl:mogo-core-function-obu-mogo')
api project(':core:function-impl:mogo-core-function-smp')
api project(':core:function-impl:mogo-core-function-hmi')
api project(':core:function-impl:mogo-core-function-autopilot')
api project(':core:function-impl:mogo-core-function-check')
api project(':core:function-impl:mogo-core-function-map')
api project(':core:function-impl:mogo-core-function-notice')
api project(':core:function-impl:mogo-core-function-v2x')
api project(':core:function-impl:mogo-core-function-monitoring')
implementation project(":modules:mogo-module-main")
api project(":modules:mogo-module-main")
}
}

View File

@@ -312,7 +312,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
// 自动驾驶系统检测模块
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_CHECK, "CheckProvider"));
// 推送模块
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, PushUIConstants.NAME));
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI"));
// ADAS模块慢慢被 域控制器模块 替换掉)
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_ADAS, "AdasProvider"));
// 全局语音唤醒

View File

@@ -13,9 +13,11 @@ import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider;
public interface IMoGoAutopilotProvider extends IMoGoFunctionServerProvider {
/**
* 连接自动驾驶域控制器
* 重新连接自动驾驶域控制器指定IP地址
*
* @param autoPilotIp 指定与控制器IP
*/
void connectAutoPilot();
void resetIpAddress(String autoPilotIp);
/**
* 开启自动驾驶

View File

@@ -4,7 +4,6 @@ import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
/**
*@author xiaoyuzhou
@@ -16,10 +15,19 @@ object CallerAutoPilotManager {
private val providerApi: IMoGoAutopilotProvider
get() = CallerBase.getApiInstance(
IMoGoAutopilotProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
IMoGoAutopilotProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
)
/**
* 连接自动驾驶域控制器
*
* @param autoPilotIp 指定与控制器IP
*/
fun resetIpAddress(autoPilotIp: String) {
providerApi.resetIpAddress(autoPilotIp)
}
/**
* 开启自动驾驶
*

View File

@@ -74,7 +74,7 @@ public class CustomMapApiBuilder implements IMogoMapApiBuilder {
Log.d(TAG, "setDebugMode==true");
MapParams mapParams = MapParams.Companion.init();
mapParams.setDebugMode(true)
mapParams.setDebugMode(false)
//.setDataFileSource(1) //todo 1-使用本地地图数据0-使用在线地图数据
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_2D)

View File

@@ -37,7 +37,6 @@
:modules:mogo-module-v2x
:modules:mogo-module-main
:modules:mogo-module-push-base
:modules:mogo-module-push-noop
:modules:mogo-module-push
:modules:tanlulib
:modules:mogo-module-monitor

View File

@@ -1,14 +0,0 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx

View File

@@ -1,4 +0,0 @@
# 基于 socketserver 实现的push推送
---
目前,仅 launcher 实现推送,独立 app 不用

View File

@@ -1,60 +0,0 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'com.alibaba.arouter'
}
android {
compileSdkVersion rootProject.ext.android.compileSdkVersion
buildToolsVersion rootProject.ext.android.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.android.minSdkVersion
targetSdkVersion rootProject.ext.android.targetSdkVersion
versionCode Integer.valueOf(VERSION_CODE)
versionName getValueFromRootProperties("${project.name.replace("-", "_").toUpperCase()}_VERSION")
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// 小智语音,免唤醒词等服务
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
if( Boolean.valueOf(USE_MAVEN_PACKAGE) ){
implementation rootProject.ext.dependencies.modulepushbase
implementation rootProject.ext.dependencies.mogoserviceapi
} else {
implementation project(":modules:mogo-module-push-base")
implementation project(':services:mogo-service-api')
}
}
apply from: new File(rootProject.rootDir, "gradle/upload.gradle").toString()

View File

@@ -1,3 +0,0 @@
GROUP=com.mogo.module
POM_ARTIFACT_ID=module-push-noop
VERSION_CODE=1

View File

@@ -1,21 +0,0 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View File

@@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mogo.module.push.noop"></manifest>

View File

@@ -1,80 +0,0 @@
package com.mogo.module.push.noop;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.map.listener.IMogoMapListener;
import com.mogo.map.location.IMogoLocationListener;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.navi.IMogoNaviListener;
import com.mogo.module.push.base.PushUIConstants;
import com.mogo.service.module.IMogoModuleLifecycle;
import com.mogo.service.module.IMogoModuleProvider;
@Route(path = PushUIConstants.PATH)
public class PushModuleProvider implements IMogoModuleProvider {
@Override
public Fragment createFragment(Context context, Bundle data) {
return null;
}
@Override
public View createView(Context context) {
return null;
}
@NonNull
@Override
public String getModuleName() {
return "";
}
@Override
public IMogoModuleLifecycle getCardLifecycle() {
return null;
}
@Override
public IMogoMapListener getMapListener() {
return null;
}
@Override
public int getType() {
return 0;
}
@Override
public IMogoNaviListener getNaviListener() {
return null;
}
@Override
public IMogoLocationListener getLocationListener() {
return null;
}
@Override
public IMogoMarkerClickListener getMarkerClickListener() {
return null;
}
@Override
public String getAppPackage() {
return " ";
}
@Override
public String getAppName() {
return " ";
}
@Override
public void init(final Context context) {
}
}

View File

@@ -66,7 +66,6 @@ include ':modules:mogo-module-extensions'
include ':modules:mogo-module-v2x'
include ':modules:mogo-module-push'
include ':modules:mogo-module-push-base'
include ':modules:mogo-module-push-noop'
include ':modules:mogo-module-carchatting'
include ':modules:mogo-module-carchattingprovider'
include ':modules:mogo-module-chat'

View File

@@ -201,6 +201,7 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
.setFrontResBin(TTS_FRONT_RES)//设置前端合成资源路径.assets路径或sd卡路径均可
.setDictDb(TTS_DICT_RES)//设置合成字典资源路径.assets路径或sd卡路径均可
.setBackResBinArray(mBackResBinArray)//设置后端合成音色资源如果只需设置一个则array只需要传一个成员值就可以init前设置setBackResBin接口无效
.setUseCache(false)
.build();
mEngine.init(config, new AILocalTTSListenerImpl());//初始化合成引擎