From 3211ef5956a0136442bbee45c0cd11b01985cb1c Mon Sep 17 00:00:00 2001 From: donghongyu Date: Wed, 1 Feb 2023 14:06:58 +0800 Subject: [PATCH] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E6=8B=86=E5=88=86Obu=E6=95=B0=E6=8D=AE=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E6=8E=A5=E5=8F=A3=EF=BC=8C=E7=AD=89=E5=BE=85=E5=87=A4?= =?UTF-8?q?=E5=9D=A4pb=E6=8F=90=E4=BA=A4=E5=90=8E=E5=9C=A8=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=95=B0=E6=8D=AE=E8=B0=83=E7=94=A8=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- .../datacenter/obu/MoGoObuProvider.kt | 10 +- .../obu/MogoPrivateObuNewManager.kt | 48 ++++------ .../obu/adapter/MoGoObuListenerImpl.kt | 83 ++++++++++++++++ .../hmi/ui/setting/DebugSettingView.kt | 95 +++++++++---------- .../function/hmi/ui/setting/SOPSettingView.kt | 12 +-- .../collect/MoGoMapDataCollectProvider.kt | 3 - .../business/identify/IdentifyFactory.kt | 4 +- .../mogo/eagle/core/data/obu/ObuStatusInfo.kt | 9 +- core/mogo-core-function-api/build.gradle | 2 + .../map/listener/IGaoDeMapLocationListener.kt | 18 ++++ .../map/listener/IMoGoMapLocationListener.kt | 17 ---- .../api/obu/IMoGoObuConnectListener.kt | 18 ++++ .../api/obu/IMoGoObuLocationWGS84Listener.kt | 20 ++++ .../api/obu/IMoGoObuStatusListener.kt | 7 -- .../api/obu/IMoGoObuTrafficLightListener.kt | 3 +- .../api/obu/IMoGoObuWarningMapListener.kt | 20 ++++ .../api/obu/IMoGoObuWarningRsiListener.kt | 20 ++++ .../api/obu/IMoGoObuWarningRsmListener.kt | 20 ++++ .../api/obu/IMoGoObuWarningRvListener.kt | 20 ++++ .../api/obu/IMoGoObuWarningSpatListener.kt | 20 ++++ core/mogo-core-function-call/build.gradle | 4 +- .../map/CallerMapLocationListenerManager.kt | 6 +- ...erOBUManager.kt => CallerObuApiManager.kt} | 11 +-- .../obu/CallerObuConnectListenerManager.kt | 59 ++++++++++++ .../call/obu/CallerObuListenerManager.kt | 80 ---------------- .../CallerObuTrafficLightListenerManager.kt | 13 +-- .../obu/CallerObuWarningListenerManager.kt | 36 +++++++ .../obu/CallerObuWarningMapListenerManager.kt | 20 ++++ .../obu/CallerObuWarningRsiListenerManager.kt | 20 ++++ .../obu/CallerObuWarningRsmListenerManager.kt | 20 ++++ .../obu/CallerObuWarningRvListenerManager.kt | 20 ++++ .../CallerObuWarningSpatListenerManager.kt | 20 ++++ .../mogo/map/location/GDLocationClient.java | 4 + 33 files changed, 540 insertions(+), 222 deletions(-) create mode 100644 core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt delete mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuConnectListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningMapListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsiListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsmListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRvListener.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningSpatListener.kt rename core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/{CallerOBUManager.kt => CallerObuApiManager.kt} (84%) create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuConnectListenerManager.kt delete mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningMapListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsiListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsmListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRvListenerManager.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningSpatListenerManager.kt diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt index b8c85a0b37..6d0d5ba1d6 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt @@ -37,9 +37,8 @@ class MoGoObuProvider : IMoGoObuProvider { MogoObuDcCombineManager.INSTANCE.init(context) CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress()) //bus乘客版本obu功能去掉 - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger( - FunctionBuildConfig.appIdentityMode - ) + if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) + && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) ) { //不处理 } else { @@ -73,9 +72,8 @@ class MoGoObuProvider : IMoGoObuProvider { * 通过控制面板设置ip,进行传递 */ override fun connect(ipAddress: String) { - if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger( - FunctionBuildConfig.appIdentityMode - ) + if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) + && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) ) { //不处理 } else { diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 503a372c83..c667c4bb86 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -15,13 +15,12 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager -import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager +import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.support.obu.MogoObuManager import com.mogo.support.obu.OnMogoObuListener @@ -48,9 +47,7 @@ class MogoPrivateObuNewManager private constructor() { } } - private var mContext: Context? = null - private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo() - + private var mObuStatusInfo = CallerObuConnectListenerManager.getObuStatusInfo() fun connectObu(context: Context, obuIpAddress: String, padIpAddress: String) { MogoObuManager.getInstance().registerMogoObuListener(mogoObuListener) @@ -102,14 +99,10 @@ class MogoPrivateObuNewManager private constructor() { mObuStatusInfo.obuStatus = false mObuStatusInfo.obuHvStatus = false mObuStatusInfo.obuRvStatus = false - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } + CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo) } else if (connectStatus == 1) { //连接成功 mObuStatusInfo.obuStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) - mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } + CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo) } } @@ -118,7 +111,7 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) { mObuStatusInfo.obuHvStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) + CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo) if (p0 != null && p0.vehBasicsMsg != null) { CallerLogger.d( @@ -169,7 +162,7 @@ class MogoPrivateObuNewManager private constructor() { super.onMogoObuRvWarning(data) // if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关 mObuStatusInfo.obuRvStatus = true - CallerObuListenerManager.invokeListener(mObuStatusInfo) + CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo) if (!data.warningMsg.warningData.isNullOrEmpty()) { // 更新数据,远车数据,之前要匹配uuid TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let { @@ -192,9 +185,7 @@ class MogoPrivateObuNewManager private constructor() { appId = data.warningMsg.warningData[0].warningType.toString() status = data.warningMsg.warningData[0].status //拼凑数据 - if (appId != null) { - handleSdkObu(appId, direction, status, level, data) - } + handleSdkObu(appId, direction, status, level, data) } } @@ -215,15 +206,11 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { super.onMogoObuSpatWarning(data) - if (data != null) { -// if (HmiBuildConfig.isShowObuV2iView) { - handlerTrafficLight( - data.warningType, - data.status, - data.lights - ) -// } - } + handlerTrafficLight( + data.warningType, + data.status, + data.lights + ) } /** @@ -232,7 +219,7 @@ class MogoPrivateObuNewManager private constructor() { override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { super.onMogoObuRsiWarning(data) // if (HmiBuildConfig.isShowObuV2iView) { - if (data != null && data.warningMsg != null && data.warningMsg.size > 0) { + if (data.warningMsg != null && data.warningMsg.size > 0) { var alertContent = "" var ttsContent = "" var appId = data.warningMsg[0].sceneType.toString() @@ -411,7 +398,7 @@ class MogoPrivateObuNewManager private constructor() { //显示警告红边 // CallerHmiManager.showWarning(direction) //不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框 - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { + if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } CallerMsgBoxManager.saveMsgBox( @@ -571,7 +558,7 @@ class MogoPrivateObuNewManager private constructor() { ?.updateITrafficThreatLevelInfo(it) } - if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) { + if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } //显示警告红边 @@ -650,7 +637,10 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.STATUS.DELETE -> { // 删除 UiThreadHandler.post { - CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1,DataSourceType.OBU) + CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange( + -1, + DataSourceType.OBU + ) } } } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt new file mode 100644 index 0000000000..7b26638fd2 --- /dev/null +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/adapter/MoGoObuListenerImpl.kt @@ -0,0 +1,83 @@ +package com.mogo.eagle.core.function.datacenter.obu.adapter + +import com.mogo.support.obu.OnMogoObuListener +import com.mogo.support.obu.constants.Define.ConnectStatus +import com.mogo.support.obu.model.* + +/** + * 适配 OBU 回调监听分发,这里不做业务,只做数据包装及分发处理 + * @author dong hong yu + */ +object MoGoObuListenerImpl : OnMogoObuListener() { + + /** + * 连接状态 + * + * @param connectStatus 连接状态 + * @since 1.0.0 + */ + override fun onConnectStatus(@ConnectStatus connectStatus: Int) { + + } + + + /** + * HV车辆基础信息 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuHvBasics(data: MogoObuHvBasicsData) { + + } + + /** + * V2V预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuRvWarning(data: MogoObuRvWarningData) { + + } + + /** + * 红绿灯预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { + + } + + /** + * RSI预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { + + } + + /** + * RSM预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData) { + + } + + /** + * 地图匹配结果 + * + * @param data 数据 + * @since 1.0.0 + */ + override fun onMogoObuMapMath(data: MogoObuMapMathData) { + + } +} \ No newline at end of file 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 14e6d0cee2..4effeef6d8 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 @@ -38,14 +38,12 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.scene.SceneModule import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.gnss.AccelerationEntity -import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.obu.ObuStatusInfo import com.mogo.eagle.core.data.report.ReportEntity import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListener import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener -import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener -import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener +import com.mogo.eagle.core.function.api.obu.IMoGoObuConnectListener import com.mogo.eagle.core.function.business.routeoverlay.* import com.mogo.eagle.core.function.call.autopilot.* import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager @@ -55,8 +53,8 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.map.CallerHDMapManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.map.CallerSmpManager -import com.mogo.eagle.core.function.call.obu.CallerOBUManager -import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager +import com.mogo.eagle.core.function.call.obu.CallerObuApiManager +import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager import com.mogo.eagle.core.function.hmi.R @@ -100,22 +98,21 @@ internal class DebugSettingView @JvmOverloads constructor( attrs: AttributeSet? = null, defStyleAttr: Int = 0 ) : ConstraintLayout(context, attrs, defStyleAttr), - IMoGoObuStatusListener, - IMoGoAutopilotStatusListener, - IMoGoChassisLocationWGS84Listener, - IMoGoMapLocationListener, - IMoGoAutopilotIdentifyListener, - IMoGoPlanningRottingListener, - IMoGoPlanningTrajectoryListener, - IMoGoDevaToolsFuncConfigListener, - IMoGoChassisLamplightListener, - IMoGoDevaToolsListener, - IMoGoChassisAccStateListener, - IMoGoChassisSteeringStateListener, - IMoGoChassisGearStateListener, - IMoGoChassisBrakeStateListener, - IMoGoChassisThrottleStateListener, - IMoGoSweeperFutianCleanSystemListener{ + IMoGoObuConnectListener, + IMoGoAutopilotStatusListener, + IMoGoChassisLocationWGS84Listener, + IMoGoAutopilotIdentifyListener, + IMoGoPlanningRottingListener, + IMoGoPlanningTrajectoryListener, + IMoGoDevaToolsFuncConfigListener, + IMoGoChassisLamplightListener, + IMoGoDevaToolsListener, + IMoGoChassisAccStateListener, + IMoGoChassisSteeringStateListener, + IMoGoChassisGearStateListener, + IMoGoChassisBrakeStateListener, + IMoGoChassisThrottleStateListener, + IMoGoSweeperFutianCleanSystemListener { private val TAG = "DebugSettingView" @@ -189,7 +186,7 @@ internal class DebugSettingView @JvmOverloads constructor( override fun onAttachedToWindow() { super.onAttachedToWindow() // 添加 OBU状态 监听 - CallerObuListenerManager.addListener(TAG, this) + CallerObuConnectListenerManager.addListener(TAG, this) // 添加 ADAS状态 监听 CallerAutoPilotStatusListenerManager.addListener(TAG, this) // 添加 ADAS车辆状态&定位 监听 @@ -230,7 +227,7 @@ internal class DebugSettingView @JvmOverloads constructor( override fun onDetachedFromWindow() { super.onDetachedFromWindow() // 移除 OBU状态 监听 - CallerObuListenerManager.removeListener(TAG) + CallerObuConnectListenerManager.removeListener(TAG) // 移除 ADAS状态 监听 CallerAutoPilotStatusListenerManager.removeListener(TAG) // 移除 ADAS车辆状态&定位 监听 @@ -254,7 +251,10 @@ internal class DebugSettingView @JvmOverloads constructor( CallerChassisLamplightListenerManager.removeListener(TAG) // 移除 业务配置监听 - CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener( FuncBizConfig.FOUNDATION, TAG) + CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener( + FuncBizConfig.FOUNDATION, + TAG + ) if (logInfoView != null) { logInfoView!!.onEnterBackground() @@ -552,7 +552,7 @@ internal class DebugSettingView @JvmOverloads constructor( setLogCheckedChangeListener() //OBU配置信息 - tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString() + tvObuInfo.text = CallerObuConnectListenerManager.getObuStatusInfoJsonString() //工控机配置信息 tvAutopilotInfo.text = @@ -572,14 +572,14 @@ internal class DebugSettingView @JvmOverloads constructor( btnSetObuIP.setOnClickListener { val obuIP = etObuIP.text.toString() if (StringUtils.isValidIPAddress(obuIP)) { - CallerOBUManager.resetObuIpAddress(obuIP) + CallerObuApiManager.resetObuIpAddress(obuIP) } else { ToastUtils.showShort("请输入正确的IP地址") } } btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor - btnDrawFusion.setOnCheckedChangeListener{_, isChecked -> + btnDrawFusion.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isFusionColor = isChecked } @@ -589,7 +589,11 @@ internal class DebugSettingView @JvmOverloads constructor( // 演示模式 tbIsDemoMode.setOnCheckedChangeListener { _, _ -> FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode - CallerHmiManager.updateStatusBarLeftView(FunctionBuildConfig.isDemoMode, "demoMode", DemoModeView(context)) + CallerHmiManager.updateStatusBarLeftView( + FunctionBuildConfig.isDemoMode, + "demoMode", + DemoModeView(context) + ) CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode) if (!FunctionBuildConfig.isDemoMode) { //关闭美化模式时,通知工控机 @@ -1691,9 +1695,9 @@ internal class DebugSettingView @JvmOverloads constructor( mTrajectoryInfoSize = 0 mRouteInfoSize = 0 - if(FunctionBuildConfig.isDemoMode){ + if (FunctionBuildConfig.isDemoMode) { tbIsDemoMode.text = "关闭美化模式" - }else{ + } else { tbIsDemoMode.text = "开启美化模式" } @@ -1702,7 +1706,7 @@ internal class DebugSettingView @JvmOverloads constructor( /** * OBU状态回调 */ - override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) { + override fun onConnectStatus(obuStatusInfo: ObuStatusInfo) { lifecycleOwner.lifecycleScope.launch { tvObuInfo.text = GsonUtils.toJson(obuStatusInfo) @@ -1782,7 +1786,7 @@ internal class DebugSettingView @JvmOverloads constructor( when (type) { BIZ_BEAUTY_MODE -> { tbIsDemoMode.isClickable = !lock - val (left,top,right,bottom) = tbIsDemoMode.currentPadding() + val (left, top, right, bottom) = tbIsDemoMode.currentPadding() if (lock) { tbIsDemoMode.background = resources.getDrawable(R.drawable.radio_button_lock_background) @@ -1790,11 +1794,11 @@ internal class DebugSettingView @JvmOverloads constructor( tbIsDemoMode.background = resources.getDrawable(R.drawable.radio_button_normal_background_right) } - tbIsDemoMode.setPadding(left,top,right,bottom) + tbIsDemoMode.setPadding(left, top, right, bottom) } BIZ_RAIN_MODE -> { tbIsRainMode.isClickable = !lock - val (left,top,right,bottom) = tbIsRainMode.currentPadding() + val (left, top, right, bottom) = tbIsRainMode.currentPadding() if (lock) { tbIsRainMode.background = resources.getDrawable(R.drawable.radio_button_lock_background) @@ -1802,21 +1806,21 @@ internal class DebugSettingView @JvmOverloads constructor( tbIsRainMode.background = resources.getDrawable(R.drawable.radio_button_normal_background_right) } - tbIsRainMode.setPadding(left,top,right,bottom) + tbIsRainMode.setPadding(left, top, right, bottom) } BIZ_WARNING_UPLOAD -> { tbReportWarning.isClickable = !lock - val (left,top,right,bottom) = tbReportWarning.currentPadding() + val (left, top, right, bottom) = tbReportWarning.currentPadding() if (lock) { tbReportWarning.background = resources.getDrawable(R.drawable.radio_button_lock_background) } else { tbReportWarning.background = null } - tbReportWarning.setPadding(left,top,right,bottom) + tbReportWarning.setPadding(left, top, right, bottom) } BIZ_BAG_RECORD -> { - val (left,top,right,bottom) = btnRecordBag.currentPadding() + val (left, top, right, bottom) = btnRecordBag.currentPadding() if (lock) { btnRecordBag.isClickable = false btnRecordBag.background = @@ -1826,10 +1830,10 @@ internal class DebugSettingView @JvmOverloads constructor( btnRecordBag.requestFocus() btnRecordBag.background = null } - btnRecordBag.setPadding(left,top,right,bottom) + btnRecordBag.setPadding(left, top, right, bottom) } BIZ_FULL_LOG -> { - val (left,top,right,bottom) = tbLogCatch.currentPadding() + val (left, top, right, bottom) = tbLogCatch.currentPadding() if (lock) { tbLogCatch.isClickable = false tbLogCatch.background = @@ -1839,7 +1843,7 @@ internal class DebugSettingView @JvmOverloads constructor( tbLogCatch.requestFocus() tbLogCatch.background = null } - tbLogCatch.setPadding(left,top,right,bottom) + tbLogCatch.setPadding(left, top, right, bottom) } } } @@ -1954,15 +1958,6 @@ internal class DebugSettingView @JvmOverloads constructor( } } - override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) { - } - - /** - * 时延显示 - */ - override fun onObuV2iDelayTime(delayTime: Long) { - - } /** * 车辆转向灯 数据 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 0ae1263047..75a9ec91bd 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 @@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.hmi.ui.setting import android.content.Context import android.util.AttributeSet -import android.util.Log import android.view.LayoutInflater import android.view.View import androidx.constraintlayout.widget.ConstraintLayout @@ -14,7 +13,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager -import com.mogo.eagle.core.function.call.obu.CallerOBUManager +import com.mogo.eagle.core.function.call.obu.CallerObuApiManager import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.kotlin.currentPadding import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @@ -23,7 +22,6 @@ import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView import com.mogo.eagle.core.utilcode.util.UiThreadHandler -import kotlinx.android.synthetic.main.view_debug_setting.view.* import kotlinx.android.synthetic.main.view_sop_setting.view.* import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect import java.util.* @@ -187,17 +185,17 @@ internal class SOPSettingView @JvmOverloads constructor( } //OBU控制总开关 - tbObu.isChecked = CallerOBUManager.isConnected() + tbObu.isChecked = CallerObuApiManager.isConnected() tbObu.setOnCheckedChangeListener { _, isChecked -> if (!isChecked) { if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) { - CallerOBUManager.resetObuIpAddress("192.168.1.199") + CallerObuApiManager.resetObuIpAddress("192.168.1.199") } else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { - CallerOBUManager.resetObuIpAddress("192.168.8.199") + CallerObuApiManager.resetObuIpAddress("192.168.8.199") } } else { //断开链接 - CallerOBUManager.disConnectObu() + CallerObuApiManager.disConnectObu() } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt index 83e51481df..c4e6e8a277 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/collect/MoGoMapDataCollectProvider.kt @@ -9,12 +9,9 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MogoServicePaths import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP -import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.function.api.autopilot.* import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider -import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener import com.mogo.eagle.core.function.call.autopilot.* -import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager import com.zhidaoauto.map.operational.open.GatherApi diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt index 78e56df4f0..9eee2c09c1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/IdentifyFactory.kt @@ -5,7 +5,7 @@ import android.os.Message import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.traffic.TrafficData import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener -import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager +import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler import mogo.telematics.pad.MessagePad import mogo.telematics.pad.MessagePad.TrackedObject @@ -30,7 +30,7 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener { } else { DriverIdentify.originDataDrawer } - CallerObuListenerManager.addListener(TAG, this) + CallerObuWarningListenerManager.addListener(TAG, this) } private const val MSG_DATA_TRACK = 0 diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt index b0206c4d42..f6161490e3 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/obu/ObuStatusInfo.kt @@ -1,14 +1,19 @@ package com.mogo.eagle.core.data.obu /** + * OBU 相关的状态信息数据 * @author xiaoyuzhou * @date 2021/9/30 5:38 下午 - * OBU 相关的状态信息数据 */ class ObuStatusInfo { - // 当前链接的IP地址, 默认地址 192.168.1.199 + /** + * 当前链接的IP地址, 默认地址 192.168.1.199 + */ var connectIP: String = "192.168.1.199" + /** + * OBU SDK 版本 + */ var obuSdkVersion = "" /** diff --git a/core/mogo-core-function-api/build.gradle b/core/mogo-core-function-api/build.gradle index e9b128373c..d1e326c4c5 100644 --- a/core/mogo-core-function-api/build.gradle +++ b/core/mogo-core-function-api/build.gradle @@ -47,6 +47,8 @@ dependencies { kapt rootProject.ext.dependencies.aroutercompiler implementation rootProject.ext.dependencies.coroutinescore implementation rootProject.ext.dependencies.coroutinesandroid + implementation rootProject.ext.dependencies.mogoobu + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_data implementation project(path: ':libraries:mogo-adas') diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt new file mode 100644 index 0000000000..872df234ce --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IGaoDeMapLocationListener.kt @@ -0,0 +1,18 @@ +package com.mogo.eagle.core.function.api.map.listener + +import com.mogo.eagle.core.data.map.MogoLocation + +/** + * 封装高德地图通过设备GPS获取到的位置信息,频率1s一次,坐标系为CJC20 + * 这里的数据仅用于非高精度业务 + * @author xiaoyuzhou + * @date 2021/11/1 7:17 下午 + */ +interface IGaoDeMapLocationListener { + /** + * 定位发生改变 + * + * @param location 新定位点 + */ + fun onLocationChanged(location: MogoLocation, from: Int, isGps: Boolean) +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt deleted file mode 100644 index 368f4191af..0000000000 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/listener/IMoGoMapLocationListener.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.mogo.eagle.core.function.api.map.listener - -import com.mogo.eagle.core.data.map.MogoLocation - -/** - * @author xiaoyuzhou - * @date 2021/11/1 7:17 下午 - * 地图定位回调 - */ -interface IMoGoMapLocationListener { - /** - * 定位发生改变 - * - * @param location 新定位点 - */ - fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) -} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuConnectListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuConnectListener.kt new file mode 100644 index 0000000000..a1cd814bda --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuConnectListener.kt @@ -0,0 +1,18 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.eagle.core.data.obu.ObuStatusInfo + +/** + * OBU 连接状态监听回调 + * @author xiaoyuzhou + * @date 2021/9/30 5:53 下午 + */ +interface IMoGoObuConnectListener { + + /** + * 检查OBU连链接信息 + * @param obuStatusInfo OBU 状态信息 + */ + fun onConnectStatus(obuStatusInfo: ObuStatusInfo) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt new file mode 100644 index 0000000000..c98d8f8982 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuLocationWGS84Listener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuHvBasicsData + +/** + * OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系 + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuLocationWGS84Listener { + + /** + * HV车辆基础信息 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onObuLocationWGS84(data: MogoObuHvBasicsData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt index 7e39f9e31c..27446d7979 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuStatusListener.kt @@ -9,13 +9,6 @@ import com.mogo.eagle.core.data.traffic.TrafficData * OBU 状态监听回调 */ interface IMoGoObuStatusListener { - /** - * 检查OBU连链接信息 - * @param obuStatusInfo OBU 状态信息 - */ - fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo){ - - } /** * v2i时延 diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt index 1b4be4e95c..fa902d6702 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuTrafficLightListener.kt @@ -1,10 +1,9 @@ package com.mogo.eagle.core.function.api.obu - /** + * OBU 灯态信息 * @author lixiaopeng * @date 2022/1/30 10:28 下午 - * OBU 灯态信息 */ interface IMoGoObuTrafficLightListener { /** diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningMapListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningMapListener.kt new file mode 100644 index 0000000000..cef3c96e27 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningMapListener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuMapMathData + +/** + * OBU 地图匹配结果, + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuWarningMapListener { + + /** + * 地图匹配结果 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onMoGoObuMapMath(data: MogoObuMapMathData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsiListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsiListener.kt new file mode 100644 index 0000000000..cd0bc01735 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsiListener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuRsiWarningData + +/** + * OBU RSI预警信息, + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuWarningRsiListener { + + /** + * RSI预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onMoGoObuRsiWarning(data: MogoObuRsiWarningData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsmListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsmListener.kt new file mode 100644 index 0000000000..f4cf1f6be2 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRsmListener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuRsmWarningData + +/** + * OBU RSM预警信息,弱势交通参与者预警信息 + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuWarningRsmListener { + + /** + * RSM预警信息,弱势交通参与者预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onMoGoObuRsmWarning(data: MogoObuRsmWarningData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRvListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRvListener.kt new file mode 100644 index 0000000000..59dd274b8d --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningRvListener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuRvWarningData + +/** + * OBU V2V预警信息, + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuWarningRvListener { + + /** + * OBU V2V预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onMoGoObuRvWarning(data: MogoObuRvWarningData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningSpatListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningSpatListener.kt new file mode 100644 index 0000000000..dfd99d2079 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/obu/IMoGoObuWarningSpatListener.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.api.obu + +import com.mogo.support.obu.model.MogoObuSpatWarningData + +/** + * OBU 红绿灯预警信息, + * @author donghongyu + * @date 2023-02-01 + */ +interface IMoGoObuWarningSpatListener { + + /** + * OBU 红绿灯预警信息 + * + * @param data 数据 + * @since 1.0.0 + */ + fun onMoGoObuSpatWarning(data: MogoObuSpatWarningData) + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/build.gradle b/core/mogo-core-function-call/build.gradle index 22a7f5270f..51aef62a5c 100644 --- a/core/mogo-core-function-call/build.gradle +++ b/core/mogo-core-function-call/build.gradle @@ -49,9 +49,11 @@ dependencies { // MoGo 数据埋点工具 implementation rootProject.ext.dependencies.analytics - compileOnly rootProject.ext.dependencies.mogocustommap + implementation rootProject.ext.dependencies.mogoobu + + if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { implementation rootProject.ext.dependencies.mogo_core_data implementation rootProject.ext.dependencies.mogo_core_utils diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt index 08ab9ff67f..1b6cad9637 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/map/CallerMapLocationListenerManager.kt @@ -1,14 +1,12 @@ package com.mogo.eagle.core.function.call.map import com.mogo.eagle.core.data.map.MogoLocation -import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener import com.mogo.eagle.core.function.call.base.CallerBase -import java.util.concurrent.ConcurrentHashMap /** - * @author xiaoyuzhou + * 高德地图 位置改变 监听管理 + * @author dongghongyu * @date 2021/9/30 5:48 下午 - * 地图 位置改变 监听管理 */ object CallerMapLocationListenerManager : CallerBase() { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerOBUManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt similarity index 84% rename from core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerOBUManager.kt rename to core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt index 3dd265e6c8..0bc8fae569 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerOBUManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuApiManager.kt @@ -5,18 +5,17 @@ import com.mogo.eagle.core.function.api.obu.IMoGoObuProvider import com.mogo.eagle.core.function.call.base.CallerBase /** - *@author xiaoyuzhou - *@date 2021/10/11 8:30 下午 * 自研OBU管理 + * @author xiaoyuzhou + * @date 2021/10/11 8:30 下午 */ -object CallerOBUManager { +object CallerObuApiManager { private val providerApi: IMoGoObuProvider get() = CallerBase.getApiInstance( IMoGoObuProvider::class.java, MogoServicePaths.PATH_V2X_OBU_MOGO ) - /** * 重新设置OBU链接IP * @@ -29,7 +28,7 @@ object CallerOBUManager { /** * 断开OBU连接 */ - fun disConnectObu(){ + fun disConnectObu() { providerApi.disConnect() } @@ -37,7 +36,7 @@ object CallerOBUManager { * 获取OBU连接状态 * @return boolean 连接状态 */ - fun isConnected(): Boolean{ + fun isConnected(): Boolean { return providerApi.isConnected() } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuConnectListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuConnectListenerManager.kt new file mode 100644 index 0000000000..ab739efdf1 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuConnectListenerManager.kt @@ -0,0 +1,59 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.data.obu.ObuStatusInfo +import com.mogo.eagle.core.function.api.obu.IMoGoObuConnectListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.eagle.core.utilcode.util.GsonUtils + +/** + * OBU 监听管理 + * @author xiaoyuzhou + * @date 2021/9/30 5:48 下午 + */ +object CallerObuConnectListenerManager : CallerBase() { + + /** + * 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态 + */ + private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo() + + /** + * 查询 OBU状态 + */ + fun getObuStatusInfo(): ObuStatusInfo { + return mObuStatusInfo + } + + /** + * 查询 OBU状态 + */ + fun getObuStatusInfoJsonString(): String { + return GsonUtils.toJson(mObuStatusInfo) + } + + override fun doSomeAfterAddListener(tag: String, listener: IMoGoObuConnectListener) { + listener.onConnectStatus(mObuStatusInfo) + } + + /** + * 触发 OBU状态 监听 + */ + fun invokeObuConnectListener() { + invokeObuConnectListener(mObuStatusInfo) + } + + /** + * 触发 OBU状态 监听 + * @param obuStatusInfo 当前OBU连接状态信息 + */ + fun invokeObuConnectListener(obuStatusInfo: ObuStatusInfo) { + mObuStatusInfo = obuStatusInfo + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onConnectStatus(mObuStatusInfo) + } + } + + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt deleted file mode 100644 index c13c01f3cd..0000000000 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuListenerManager.kt +++ /dev/null @@ -1,80 +0,0 @@ -package com.mogo.eagle.core.function.call.obu - -import com.mogo.eagle.core.data.obu.ObuStatusInfo -import com.mogo.eagle.core.data.traffic.TrafficData -import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener -import com.mogo.eagle.core.function.call.base.CallerBase -import com.mogo.eagle.core.utilcode.util.GsonUtils - -/** - * @author xiaoyuzhou - * @date 2021/9/30 5:48 下午 - * OBU 监听管理 - */ -object CallerObuListenerManager : CallerBase() { - - // 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态 - private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo() - - /** - * 查询 OBU状态 - */ - fun getObuStatusInfo(): ObuStatusInfo { - return mObuStatusInfo - } - - /** - * 查询 OBU状态 - */ - fun getObuStatusInfoJsonString(): String { - return GsonUtils.toJson(mObuStatusInfo) - } - - override fun doSomeAfterAddListener(tag: String, listener: IMoGoObuStatusListener) { - listener.onObuStatusResponse(mObuStatusInfo) - } - - - /** - * 触发 OBU状态 监听 - */ - fun invokeListener() { - invokeListener(mObuStatusInfo) - } - - /** - * 触发 OBU状态 监听 - * @param obuStatusInfo 选中状态 - */ - fun invokeListener(obuStatusInfo: ObuStatusInfo) { - mObuStatusInfo = obuStatusInfo - M_LISTENERS.forEach { - val tag = it.key - val listener = it.value - listener.onObuStatusResponse(mObuStatusInfo) - } - } - - fun invokeDelayTime(delayTime: Long) { - M_LISTENERS.forEach { - val tag = it.key - val listener = it.value - listener.onObuV2iDelayTime(delayTime) - } - } - - fun invokeTrackerWarningInfo(trafficData: TrafficData){ - M_LISTENERS.forEach { - val listener = it.value - listener.updateTrackerWarningInfo(trafficData) - } - } - - fun removeTrackerWarningInfo(trafficData: TrafficData){ - M_LISTENERS.forEach { - val listener = it.value - listener.removeTrackerWarningInfo(trafficData) - } - } - -} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt index e881947ad9..972feeeeb7 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuTrafficLightListenerManager.kt @@ -2,20 +2,21 @@ package com.mogo.eagle.core.function.call.obu import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener import com.mogo.eagle.core.function.call.base.CallerBase -import java.util.concurrent.ConcurrentHashMap - +/** + * OBU 红绿灯数据监听管理 + */ object CallerObuTrafficLightListenerManager : CallerBase() { - private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap = - ConcurrentHashMap() - var mLight: Int = 0 + override fun doSomeAfterAddListener(tag: String, listener: IMoGoObuTrafficLightListener) { + listener.onObuTrafficLight(mLight) + } fun invokeObuTrafficLight(light: Int) { this.mLight = light - M_OBU_TRAFFIC_LIGHT_LISTENER.forEach { + M_LISTENERS.forEach { val tag = it.key val listener = it.value listener.onObuTrafficLight(light) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningListenerManager.kt new file mode 100644 index 0000000000..228bb7fb73 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningListenerManager.kt @@ -0,0 +1,36 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.data.traffic.TrafficData +import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener +import com.mogo.eagle.core.function.call.base.CallerBase + +/** + * OBU 监听管理 + * @author xiaoyuzhou + * @date 2021/9/30 5:48 下午 + */ +object CallerObuWarningListenerManager : CallerBase() { + + fun invokeDelayTime(delayTime: Long) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onObuV2iDelayTime(delayTime) + } + } + + fun invokeTrackerWarningInfo(trafficData: TrafficData) { + M_LISTENERS.forEach { + val listener = it.value + listener.updateTrackerWarningInfo(trafficData) + } + } + + fun removeTrackerWarningInfo(trafficData: TrafficData) { + M_LISTENERS.forEach { + val listener = it.value + listener.removeTrackerWarningInfo(trafficData) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningMapListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningMapListenerManager.kt new file mode 100644 index 0000000000..408965c57e --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningMapListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningMapListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.support.obu.model.MogoObuMapMathData + +/** + * OBU 地图匹配结果,车道线、红绿灯、建议最大车速、建议最小车速 + */ +object CallerObuWarningMapListenerManager : CallerBase() { + + fun invokeObuMapMath(data: MogoObuMapMathData) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoObuMapMath(data) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsiListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsiListenerManager.kt new file mode 100644 index 0000000000..e8ad4f4dc2 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsiListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.support.obu.model.MogoObuRsiWarningData + +/** + * OBU 交通事件预警 + */ +object CallerObuWarningRsiListenerManager : CallerBase() { + + fun invokeObuRsiWarning(data: MogoObuRsiWarningData) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoObuRsiWarning(data) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsmListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsmListenerManager.kt new file mode 100644 index 0000000000..38c8549d2b --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRsmListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsmListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.support.obu.model.MogoObuRsmWarningData + +/** + * OBU RSM预警信息,弱势交通参与者预警信息 + */ +object CallerObuWarningRsmListenerManager : CallerBase() { + + fun invokeObuRsmWarning(data: MogoObuRsmWarningData) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoObuRsmWarning(data) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRvListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRvListenerManager.kt new file mode 100644 index 0000000000..659d11a338 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningRvListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRvListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.support.obu.model.MogoObuRvWarningData + +/** + * OBU V2V预警信息,车与车间的预警,左右超车、前方车刹车、车辆事故 + */ +object CallerObuWarningRvListenerManager : CallerBase() { + + fun invokeObuRvWarning(data: MogoObuRvWarningData) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoObuRvWarning(data) + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningSpatListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningSpatListenerManager.kt new file mode 100644 index 0000000000..98d48a9834 --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuWarningSpatListenerManager.kt @@ -0,0 +1,20 @@ +package com.mogo.eagle.core.function.call.obu + +import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningSpatListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.mogo.support.obu.model.MogoObuSpatWarningData + +/** + * OBU 红绿灯信息 + */ +object CallerObuWarningSpatListenerManager : CallerBase() { + + fun invokeObuSpatWarning(data: MogoObuSpatWarningData) { + M_LISTENERS.forEach { + val tag = it.key + val listener = it.value + listener.onMoGoObuSpatWarning(data) + } + } + +} \ No newline at end of file diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java b/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java index d31f4e29ce..2dfa892d3d 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/location/GDLocationClient.java @@ -10,6 +10,10 @@ import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.constants.SharedPrefsConstants; import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr; +/** + * 封装高德地图通过设备GPS获取到的位置信息,频率1s一次,坐标系为CJC20 + * 这里的数据仅用于非高精度业务 + */ public class GDLocationClient implements AMapLocationListener, IMogoGDLocationClient { private volatile static GDLocationClient gdLocationClient;