[dev_arch_opt_3.0]

[Change]
[
1、拆分Obu数据回调接口,等待凤坤pb提交后在统一数据调用
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-02-01 14:06:58 +08:00
parent f0d9f701ed
commit 3211ef5956
33 changed files with 540 additions and 222 deletions

View File

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

View File

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

View File

@@ -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) {
}
}

View File

@@ -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) {
}
/**
* 车辆转向灯 数据

View File

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

View File

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

View File

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

View File

@@ -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 = ""
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,13 +9,6 @@ import com.mogo.eagle.core.data.traffic.TrafficData
* OBU 状态监听回调
*/
interface IMoGoObuStatusListener {
/**
* 检查OBU连链接信息
* @param obuStatusInfo OBU 状态信息
*/
fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo){
}
/**
* v2i时延

View File

@@ -1,10 +1,9 @@
package com.mogo.eagle.core.function.api.obu
/**
* OBU 灯态信息
* @author lixiaopeng
* @date 2022/1/30 1028 下午
* OBU 灯态信息
*/
interface IMoGoObuTrafficLightListener {
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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<IMoGoObuConnectListener>() {
/**
* 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
*/
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)
}
}
}

View File

@@ -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<IMoGoObuStatusListener>() {
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
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)
}
}
}

View File

@@ -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<IMoGoObuTrafficLightListener>() {
private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoObuTrafficLightListener> =
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)

View File

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

View File

@@ -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<IMoGoObuWarningMapListener>() {
fun invokeObuMapMath(data: MogoObuMapMathData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuMapMath(data)
}
}
}

View File

@@ -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<IMoGoObuWarningRsiListener>() {
fun invokeObuRsiWarning(data: MogoObuRsiWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRsiWarning(data)
}
}
}

View File

@@ -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<IMoGoObuWarningRsmListener>() {
fun invokeObuRsmWarning(data: MogoObuRsmWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRsmWarning(data)
}
}
}

View File

@@ -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<IMoGoObuWarningRvListener>() {
fun invokeObuRvWarning(data: MogoObuRvWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuRvWarning(data)
}
}
}

View File

@@ -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<IMoGoObuWarningSpatListener>() {
fun invokeObuSpatWarning(data: MogoObuSpatWarningData) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuSpatWarning(data)
}
}
}

View File

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