Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/util/SweeperAnalyticsManager.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java
This commit is contained in:
donghongyu
2023-02-22 17:03:24 +08:00
393 changed files with 5513 additions and 3288 deletions

View File

@@ -1,65 +0,0 @@
package com.mogo.eagle.core.function.call.analytics
import android.content.Context
import androidx.annotation.Keep
import androidx.collection.ArrayMap
import com.elegant.analytics.Analytics
import com.elegant.analytics.AnalyticsConfig
import com.elegant.analytics.IAnalyticsParamsProvider
import com.elegant.analytics.UploadMode
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.util.AppUtils
/**
* 埋点&数据统计 管理
* @author donghongyu
*/
object AnalyticsManager {
@Keep
fun init(context: Context?, isDebug: Boolean) {
// 1 - debug 近实时上报积累一条埋点上报或者积累3秒上报一次。
// 2 - 本地缓存聚合上报积累30条埋点上报或者积累60秒上报一次。
AnalyticsConfig.getInstance(context).appKey = "0915430e5fdcbb553391f2a35cb8489f"
AnalyticsConfig.getInstance(context).uploadMode = if (isDebug) UploadMode.instant else UploadMode.cache
AnalyticsConfig.getInstance(context).setShouldLog(isDebug)
// 设置参数提供者
AnalyticsConfig.getInstance(context).paramsProvider = object : IAnalyticsParamsProvider {
// 静态参数
override fun staticParams(): Map<String, Any> {
return getAnalyticsCustomParams(isDebug)
}
//动态参数
override fun dynamicParams(): Map<String, Any>? {
return null
}
}
Analytics.getInstance().start(context)
}
/**
* 埋点
*
* @param event 事件名称
* @param properties 事件参数
*/
fun track(event: String?, properties: HashMap<String, Any>) {
Analytics.getInstance().track(event, properties)
}
/**
* 静态的统计参数
*/
fun getAnalyticsCustomParams(isDebug: Boolean): Map<String, Any> {
val map: MutableMap<String, Any> = ArrayMap()
map["debug"] = if (isDebug) 1 else 0
map["sn"] = MoGoAiCloudClientConfig.getInstance().sn
map["app_version"] = AppUtils.getAppVersionName()
map["app_identity_mode"] = FunctionBuildConfig.appIdentityMode
return map
}
}

View File

@@ -415,4 +415,43 @@ object CallerAutoPilotControlManager {
providerApi?.setIsDrawPointCloud(isDrawPointCloud)
}
fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1FrontDoorCmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1AirConditionerCmd(
switchCmd: Int,
modeCmd: Int,
windSpeedCmd: Int,
temperatureCmd: Int
): Boolean {
return providerApi?.sendRoboBusJinlvM1AirConditionerCmd(switchCmd, modeCmd, windSpeedCmd, temperatureCmd) ?: false
}
fun sendRoboBusJinlvM1HeaderCmd(switchCmd: Int, windSpeedCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1HeaderCmd(switchCmd, windSpeedCmd) ?: false
}
fun sendRoboBusJinlvM1MainLamp1Cmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1MainLamp1Cmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1MainLamp2Cmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1MainLamp2Cmd(switchCmd) ?: false
}
/**
* 车门控制
*/
fun sendRoboBusJinlvM1SmallLampCmd(switchCmd: Int): Boolean {
return providerApi?.sendRoboBusJinlvM1SmallLampCmd(switchCmd) ?: false
}
fun sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd: SpecialVehicleTaskCmdOuterClass.RoboBusJinlvM1Cmd): Boolean {
return providerApi?.sendRoboBusJinlvM1TaskCmd(roboBusJinlvM1Cmd) ?: false
}
fun sendPlanningCmd(cmd: Int): Boolean {
return providerApi?.sendPlanningCmd(cmd) ?: false
}
}

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhidao.support.adas.high.bean.AutopilotStatistics
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
object CallerAutopilotStatisticsListenerManager : CallerBase<IMoGoAutopilotStatisticsListener>() {

View File

@@ -4,7 +4,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆挂挡档位 回调监听
* 车辆刹车 回调监听
*/
object CallerChassisBrakeStateListenerManager : CallerBase<IMoGoChassisBrakeStateListener>() {

View File

@@ -5,12 +5,12 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆挂档位 回调监听
* 车辆挂档位 回调监听
*/
object CallerChassisGearStateListenerManager : CallerBase<IMoGoChassisGearStateListener>() {
/**
* 车辆挂档位
* 车辆挂档位
* @param gear 档位
*/
fun invokeAutopilotGearData(gear: Chassis.GearPosition) {

View File

@@ -6,7 +6,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
/**
@@ -16,7 +15,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
*/
object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocationGCJ02Listener>() {
val TAG = "CallerChassisLocationGCJ20ListenerManager"
private const val TAG = "CallerChassisLocationGCJ20ListenerManager"
@Volatile
private var mGnssInfo: MogoLocation? = null

View File

@@ -70,6 +70,16 @@ open class CallerBase<T : Any> {
return
}
M_LISTENERS.remove(tag)
if (!M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ.remove(tag)
if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(tag)) {
return
}
M_LISTENERS_HZ_LAST_SEND_TIME.remove(tag)
}
/**
@@ -83,6 +93,16 @@ open class CallerBase<T : Any> {
M_LISTENERS.forEach {
if (it.value == listener) {
M_LISTENERS.remove(it.key)
if (!M_LISTENERS_HZ.containsKey(it.key)) {
return
}
M_LISTENERS_HZ.remove(it.key)
if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(it.key)) {
return
}
M_LISTENERS_HZ_LAST_SEND_TIME.remove(it.key)
}
}
}

View File

@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.call.biz
import androidx.annotation.MainThread
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.v2x.V2XEvent
import com.mogo.eagle.core.function.api.v2x.IFuncBizProvider
import com.mogo.eagle.core.data.v2x.V2XEventData
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerFuncBizListenerManager: CallerBase<IFuncBizProvider>() {
@@ -24,10 +24,10 @@ object CallerFuncBizListenerManager: CallerBase<IFuncBizProvider>() {
}
@MainThread
fun invokeV2XEvents(v2xEvents: List<V2XEvent>?) {
fun invokeV2XEvents(v2XEventData: List<V2XEventData>?) {
M_LISTENERS.forEach {
val listener = it.value
listener.onV2XEvents(v2xEvents)
listener.onV2XEvents(v2XEventData)
}
}
}

View File

@@ -1,61 +1,26 @@
package com.mogo.eagle.core.function.call.cloud
import com.mogo.eagle.core.data.v2x.V2XEvent
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
import java.util.concurrent.ConcurrentHashMap
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerCloudListenerManager {
private val M_CLOUD_LISTENER: ConcurrentHashMap<String, IMoGoCloudListener> =
ConcurrentHashMap()
/**
* 添加监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
fun registerCloudListener(
tag: String,
listener: IMoGoCloudListener
) {
if (M_CLOUD_LISTENER.containsKey(tag)) {
return
}
M_CLOUD_LISTENER[tag] = listener
}
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
fun unRegisterCloudListener(tag: String) {
if (!M_CLOUD_LISTENER.containsKey(tag)) {
return
}
M_CLOUD_LISTENER.remove(tag)
}
/**
* 删除监听
* @param listener 要删除的监听对象
*/
fun unRegisterCloudListener(listener: IMoGoCloudListener) {
if (!M_CLOUD_LISTENER.containsValue(listener)) {
return
}
M_CLOUD_LISTENER.forEach {
if (it.value == listener) {
M_CLOUD_LISTENER.remove(it.key)
}
}
}
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
/**
* 分发获取到的设备sn
*/
fun invokeCloudTokenGot(token: String, sn: String) {
M_CLOUD_LISTENER.forEach {
M_LISTENERS.forEach {
val listener = it.value
listener.tokenGot(token, sn)
}
}
fun invokeSocketAck(event: V2XEvent) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAck(event)
}
}
}

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.api.devatools.apm.*
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -234,4 +235,6 @@ object CallerDevaToolsManager {
fun queryAppUpgrade(){
devaToolsProviderApi?.queryAppUpgrade()
}
fun apmEnvProvider(): IApmEnvProvider? = devaToolsProviderApi?.apmEnvProvider()
}

View File

@@ -30,5 +30,11 @@ object CallerHmiListenerManager : CallerBase<IMoGoCheckAutoPilotBtnListener>() {
}
}
fun invokeHDDataCacheStatus(isCached: Boolean) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.updateHDDataCacheStatus(isCached)
}
}
}

View File

@@ -211,5 +211,4 @@ object CallerHmiManager {
fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
hmiProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
}
}

View File

@@ -0,0 +1,24 @@
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.IGaoDeMapLocationListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 高德地图定位监听
*/
object CallerGaoDeMapLocationListenerManager : CallerBase<IGaoDeMapLocationListener>() {
/**
* 高德位置改变监听
*/
@Synchronized
fun invokeMoGoLocationChanged(location: MogoLocation) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoLocationChanged(location)
}
}
}

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.function.api.map.IMogoMapService
import com.mogo.eagle.core.function.api.map.marker.IMogoMarkerService
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.map.hdcache.IHdCacheListener
import com.mogo.map.location.IMogoGDLocationClient
import com.mogo.map.marker.IMogoMarkerManager
import com.mogo.map.overlay.IMogoOverlayManager
@@ -30,11 +31,23 @@ object CallerMapUIServiceManager {
return serviceProvider?.markerService
}
fun cacheHDDataByCity(listener: IHdCacheListener) {
serviceProvider?.mapUIController?.cacheHDDataByCity(listener)
}
fun isCityDataCached(): Boolean {
return serviceProvider?.mapUIController?.isCityDataCached ?: false
}
fun getOverlayManager(): IMogoOverlayManager?{
return serviceProvider?.overlayManager
}
fun getGDLocationServer(context: Context):IMogoGDLocationClient?{
fun getGDLocationServer(context: Context): IMogoGDLocationClient?{
return serviceProvider?.getGDLocationServer(context)
}
fun cancelDownloadCacheData() {
serviceProvider?.mapUIController?.cancelDownloadCacheData()
}
}

View File

@@ -1,78 +0,0 @@
package com.mogo.eagle.core.function.call.map
import android.os.Looper
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
/**
* @author xiaoyuzhou
* @date 2021/9/17 6:15 下午
* 小地图调用者管理这里对外及其他模块提供小地图功能的调用用啥写啥不要过度设计不允许直接将Provider暴露出去
*/
object CallerSmpManager : CallerBase<Any>() {
// private val mogoSmallMapProvider: IMogoSmallMapProvider
// get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
// .navigation() as IMogoSmallMapProvider
private val v2xProvider: IV2XEventProvider
get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE)
.navigation() as IV2XEventProvider
/**
* 绘制路径线
*/
@JvmStatic
fun drawablePolyline(coordinates: List<MogoLatLng?>?) {
// mogoSmallMapProvider.drawablePolyline(coordinates)
}
/**
* 清除路径线
*/
@JvmStatic
fun clearPolyline() {
// mogoSmallMapProvider.clearPolyline()
}
/**
* 显示面板
*/
@JvmStatic
fun showPanel() {
// mogoSmallMapProvider.showPanel()
}
/**
* 隐藏面板
*/
@JvmStatic
fun hidePanel() {
// mogoSmallMapProvider.hidePanel()
}
@JvmStatic
fun startQueryV2XEvents() {
if (Thread.currentThread() !== Looper.getMainLooper().thread) {
UiThreadHandler.post {
v2xProvider.queryWholeRoadEvents()
}
} else {
v2xProvider.queryWholeRoadEvents()
}
}
@JvmStatic
fun clearV2XMarkers() {
// if (Thread.currentThread() !== Looper.getMainLooper().thread) {
// UiThreadHandler.post {
// mogoOverViewMapProvider.clearV2XMarkers()
// }
// } else {
// mogoOverViewMapProvider.clearV2XMarkers()
// }
}
}

View File

@@ -0,0 +1,21 @@
package com.mogo.eagle.core.function.call.mofang
import com.mogo.eagle.core.function.api.mofang.IMoGoMoFangListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 魔方按键的处理
*/
object CallerMofangListenerManager : CallerBase<IMoGoMoFangListener>() {
fun invokeMofangHandle(keyCode: Int, action: Int): Boolean {
var isConsume = false
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
if (listener.onMofangHandle(keyCode, action))
isConsume = true
}
return isConsume
}
}

View File

@@ -1,10 +1,8 @@
package com.mogo.eagle.core.function.call.msgbox
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
import com.mogo.eagle.core.function.call.base.CallerBase
import java.util.concurrent.ConcurrentHashMap
/**
* @author XuXinChao

View File

@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.msgbox
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgCategory
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**

View File

@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.msgbox
import android.content.Context
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxProvider
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerMsgBoxManager {

View File

@@ -40,4 +40,11 @@ object CallerObuApiManager {
return providerApi.isConnected()
}
/**
* 设置obu sdk的 日志
*/
fun setObuLog(isSet: Boolean) {
providerApi.setObuLog(isSet)
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.model.MogoObuHvBasicsData
import mogo.telematics.pad.MessagePad
/**

View File

@@ -0,0 +1,23 @@
package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuWarningRsiListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.support.obu.ObuScene
/**
* OBU 保存到数据中心,展示在消息盒子的数据
*
*/
object CallerObuSaveMessageListenerManager : CallerBase<IMoGoObuSaveMessageListener>() {
fun invokeObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onMoGoObuSaveMessage(type, content, tts, sourceType)
}
}
}

View File

@@ -1,7 +1,5 @@
package com.mogo.eagle.core.function.call.obucombine
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.v2x.ObuWarningEvent
@@ -15,44 +13,6 @@ object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
ConcurrentHashMap()
/**
* 添加 obu和dc数据通道 监听
* @param tag 标记,用来注销监听使用
* @param listener 监听回调
*/
// fun addListener(
// @Nullable tag: String,
// @Nullable listener: IMoGoObuDcCombineListener
// ) {
// if (M_DC_COMBINE_LISTENERS.containsKey(tag)) {
// return
// }
// M_DC_COMBINE_LISTENERS[tag] = listener
// }
/**
* 删除监听
* @param tag 标记,用来注销监听使用
*/
// fun removeListener(@Nullable tag: String) {
// if (!M_DC_COMBINE_LISTENERS.containsKey(tag)) {
// return
// }
// M_DC_COMBINE_LISTENERS.remove(tag)
// }
/**
* 删除自动驾驶按钮选中监听
* @param listener 要删除的监听对象
*/
// fun removeListener(@Nullable listener: IMoGoObuDcCombineListener) {
// M_DC_COMBINE_LISTENERS.forEach {
// if (it.value == listener) {
// M_DC_COMBINE_LISTENERS.remove(it.key)
// }
// }
// }
/**
* v2i数据
*/

View File

@@ -1,7 +1,7 @@
package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**

View File

@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.v2x
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.enums.TrafficLightEnum
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {