Merge branch 'dev_minibus-d_230425_3.2.0' into merge320tomaster
This commit is contained in:
@@ -261,6 +261,36 @@ object CallerAutoPilotControlManager {
|
||||
return providerApi?.sendDetouringSpeed(speed)
|
||||
}
|
||||
|
||||
/**
|
||||
* 弱网减速停车策略开关
|
||||
* isEnable = true 使用弱网减速停车策略
|
||||
* isEnable = false 关闭弱网减速停车策略
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendWeakNetSlowDown(isEnable: Boolean): Boolean? {
|
||||
return providerApi?.sendWeakNetSlowDown(isEnable)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部参数
|
||||
* 结果回调{@link OnAdasListener#onGetParamResp(MessagePad.Header, MessagePad.SetParamReq)}
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendGetAllParamReq(): Boolean? {
|
||||
return providerApi?.sendGetAllParamReq()
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数获取请求
|
||||
* 结果回调{@link OnAdasListener#onGetParamResp(MessagePad.Header, MessagePad.SetParamReq)}
|
||||
*
|
||||
* @param paramType 参数类型{@link com.zhidao.support.adas.high.common.Constants.PARAM_TYPE}
|
||||
* @return boolean
|
||||
*/
|
||||
fun sendGetParamReq(paramType: Int): Boolean? {
|
||||
return providerApi?.sendGetParamReq(paramType)
|
||||
}
|
||||
/**
|
||||
* 获取数据采集录制模式配置列表
|
||||
* @param reqType 0: all, 1:获取当前所有topic列表, 2:配置需要预加载的topic组合
|
||||
@@ -289,6 +319,14 @@ object CallerAutoPilotControlManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制V2N数据给车端PnC
|
||||
* @param switchCmd true为发给PnC,false为不发给PnC
|
||||
*/
|
||||
fun sendV2nToPncCmd(switchCmd: Boolean){
|
||||
providerApi?.sendV2nToPncCmd(switchCmd)
|
||||
}
|
||||
|
||||
/**
|
||||
* 向左变道
|
||||
*/
|
||||
|
||||
@@ -27,16 +27,12 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
|
||||
if(newValue == null){
|
||||
return@observable
|
||||
}
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotRouteLineId(newValue)
|
||||
}
|
||||
}
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotStatusListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
@Volatile
|
||||
private var autoPilotMessageCode: String = ""
|
||||
|
||||
@@ -184,7 +180,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
|
||||
*/
|
||||
fun updateAutopilotControlParameters(autopilotControlParameters: AutopilotControlParameters? = null) {
|
||||
mAutopilotStatusInfo.autopilotControlParameters = autopilotControlParameters
|
||||
lineId = autopilotControlParameters?.autoPilotLine?.lineId
|
||||
lineId = autopilotControlParameters?.autoPilotLine?.lineId?:0
|
||||
invokeAutoPilotStatus(mAutopilotStatusInfo)
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,11 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
|
||||
mCarConfigResp = carConfigResp
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotCarConfig(carConfigResp)
|
||||
try {
|
||||
listener.onAutopilotCarConfig(carConfigResp)
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.v2x.*
|
||||
import perception.TrafficLightOuterClass
|
||||
|
||||
/**
|
||||
@@ -60,4 +61,14 @@ object CallerAutopilotIdentifyListenerManager : CallerBase<IMoGoAutopilotIdentif
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 感知红绿灯
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotV2nCongestionEvent(header: MessagePad.Header, rsi: MogoV2X.RSI_PB) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotV2nCongestionEvent(header, rsi)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import mogo.v2x.MogoV2X
|
||||
|
||||
/**
|
||||
* 工控机发过来的V2X数据
|
||||
*/
|
||||
object CallerV2XListenerManager : CallerBase<IMoGoV2XListener>() {
|
||||
|
||||
@Volatile
|
||||
private var eventCountTmp: Int = -1
|
||||
private var constructTmp: MogoV2X.RSI_PB? = null
|
||||
private var triangleTmp: MogoV2X.RSI_PB? = null
|
||||
private var congestionTmp: MogoV2X.RSI_PB? = null
|
||||
private var parkingViolationTmp: MogoV2X.RSM_PB? = null
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoV2XListener) {
|
||||
if (eventCountTmp >= 0) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCountTmp, constructTmp, triangleTmp, congestionTmp, parkingViolationTmp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发主车路径全局事件
|
||||
*/
|
||||
fun dispatchV2nGlobalPathEvents(eventCount: Int, construct: MogoV2X.RSI_PB?, triangle: MogoV2X.RSI_PB?, congestion: MogoV2X.RSI_PB?, parkingViolation: MogoV2X.RSM_PB?) {
|
||||
eventCountTmp = eventCount
|
||||
constructTmp = construct
|
||||
triangleTmp = triangle
|
||||
congestionTmp = congestion
|
||||
parkingViolationTmp = parkingViolation
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) && FunctionBuildConfig.isNewV2NData) {
|
||||
listener.onV2nGlobalPathEvents(eventCount, construct, triangle, congestion, parkingViolation)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,25 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
|
||||
|
||||
@Volatile
|
||||
private var token: String? = null
|
||||
|
||||
@Volatile
|
||||
private var sn: String? = null
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoCloudListener) {
|
||||
super.doSomeAfterAddListener(tag, listener)
|
||||
if (!token.isNullOrEmpty() && !sn.isNullOrEmpty()) {
|
||||
listener.tokenGot(token!!, sn!!)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分发获取到的设备sn
|
||||
*/
|
||||
fun invokeCloudTokenGot(token: String, sn: String) {
|
||||
this.token = token
|
||||
this.sn = sn
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.tokenGot(token, sn)
|
||||
|
||||
@@ -14,6 +14,8 @@ 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.api.devatools.download.*
|
||||
import com.mogo.eagle.core.function.api.upgrade.*
|
||||
import com.mogo.eagle.core.function.api.devatools.strict.*
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -159,8 +161,8 @@ object CallerDevaToolsManager {
|
||||
/**
|
||||
* 下载指定包
|
||||
*/
|
||||
fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
devaToolsProviderApi?.downLoadPackage(downloadKey, downloadUrl)
|
||||
fun downLoadPackage(type: DownloadType, downloadKey: String, downloadUrl: String) {
|
||||
devaToolsProviderApi?.downLoadPackage(type, downloadKey, downloadUrl, )
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,5 +252,7 @@ object CallerDevaToolsManager {
|
||||
devaToolsProviderApi?.queryObuUpgrade(obuVersionName)
|
||||
}
|
||||
|
||||
fun upgradeProvider(): IMoGoUpgradeProvider? = devaToolsProviderApi?.upgradeProvider()
|
||||
|
||||
fun strict(): IStrictModeProvider? = devaToolsProviderApi?.strict()
|
||||
}
|
||||
@@ -27,10 +27,10 @@ object CallerDevaToolsUpgradeListenerManager : CallerBase<IMogoDevaToolsUpgrade
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeUpgradeFinish(url: String) {
|
||||
fun invokeUpgradeFinish(url: String, destLocalPath: String) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onFinished(url)
|
||||
listener.onFinished(url, destLocalPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.data.biz.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.deva.report.ReportEntity
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum.ALERT_WARNING_NON
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoHmiProvider
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
|
||||
@@ -38,17 +38,11 @@ object CallerHmiManager {
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
listenerIMoGo: IMoGoWarningStatusListener? = null,
|
||||
direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_NON,
|
||||
direction: WarningDirectionEnum = ALERT_WARNING_NON,
|
||||
expireTime: Long = 5000L,
|
||||
isFromObu: Boolean,
|
||||
) {
|
||||
hmiProviderApi?.warningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
listenerIMoGo,
|
||||
direction,
|
||||
expireTime
|
||||
)
|
||||
hmiProviderApi?.warningV2X(v2xType, alertContent, ttsContent, listenerIMoGo, direction, expireTime, isFromObu)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
|
||||
import com.mogo.eagle.core.function.api.map.marker.IMoGoIdentifyListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMogoRoma
|
||||
|
||||
object CallerMapIdentifyManager : CallerBase<IMoGoIdentifyListener>() {
|
||||
object CallerMapIdentifyManager {
|
||||
|
||||
private val identifyApi: IMoGoIdentifyListener
|
||||
get() = ARouter.getInstance().build(PATH_IDENTIFY)
|
||||
.navigation() as IMoGoIdentifyListener
|
||||
private val romaApi:IMogoRoma
|
||||
get() = ARouter.getInstance().build( MogoServicePaths.PATH_MAP_BIZ)
|
||||
.navigation() as IMogoRoma
|
||||
|
||||
fun getIdentifyObj(uuid: String): MessagePad.TrackedObject? {
|
||||
return identifyApi.getIdentifyObj(uuid)
|
||||
fun romaTrigger(romaStatus:Boolean, requestSuccess:((Boolean) -> Unit)? = null){
|
||||
romaApi.trigger(romaStatus, requestSuccess)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import com.mogo.eagle.core.function.api.map.roma.IMoGoRomaListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerMapRomaListener : CallerBase<IMoGoRomaListener>() {
|
||||
|
||||
private var roma = false
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: IMoGoRomaListener) {
|
||||
listener.romaStatus(roma)
|
||||
}
|
||||
|
||||
fun invokeMapRoma(romaStatus: Boolean) {
|
||||
roma = romaStatus
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.romaStatus(romaStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,10 @@ import android.content.Context
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
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
|
||||
import com.mogo.map.overlay.*
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController
|
||||
|
||||
object CallerMapUIServiceManager {
|
||||
@@ -24,14 +22,6 @@ object CallerMapUIServiceManager {
|
||||
return serviceProvider?.mapUIController
|
||||
}
|
||||
|
||||
fun getMarkerManager(context: Context): IMogoMarkerManager? {
|
||||
return serviceProvider?.getMarkerManager(context)
|
||||
}
|
||||
|
||||
fun getMarkerService(): IMogoMarkerService? {
|
||||
return serviceProvider?.markerService
|
||||
}
|
||||
|
||||
fun cacheHDDataByCity(listener: IHdCacheListener) {
|
||||
serviceProvider?.mapUIController?.cacheHDDataByCity(listener)
|
||||
}
|
||||
@@ -44,7 +34,7 @@ object CallerMapUIServiceManager {
|
||||
return serviceProvider?.mapUIController?.isCityDataCached ?: false
|
||||
}
|
||||
|
||||
fun getOverlayManager(): IMogoOverlayManager?{
|
||||
fun getOverlayManager(): IMoGoOverlayManager? {
|
||||
return serviceProvider?.overlayManager
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,13 @@ object CallerMsgBoxManager {
|
||||
providerApi?.saveMsg(bean)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除所有消息盒子中的数据
|
||||
*/
|
||||
fun delMsgTable(context: Context) {
|
||||
providerApi?.delMsgTable(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知消息:V2X、云公告、运营信息
|
||||
*/
|
||||
|
||||
@@ -61,4 +61,11 @@ object CallerObuApiManager {
|
||||
providerApi.deleteObuFile()
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置obu发送频率
|
||||
*/
|
||||
fun setHvInfoSendCycle(time: Int) {
|
||||
providerApi.setHvInfoSendCycle(time)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
*/
|
||||
object CallerObuInfoListenerManager : CallerBase<IMoGoObuInfoListener>() {
|
||||
|
||||
fun invokeGetObuInfo(obuInfoStr: String) {
|
||||
fun invokeGetObuInfo(obuInfoStr: String?) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onGetObuInfo(obuInfoStr)
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.mogo.eagle.core.function.call.obucombine
|
||||
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.obucombine.IMoGoObuDcCombineListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* obu和dc数据通道 回调监听
|
||||
*/
|
||||
object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>() {
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* v2i数据
|
||||
*/
|
||||
fun invokeObuDcData(obuWarningData: ObuWarningEvent.ObuWarningData?){
|
||||
M_DC_COMBINE_LISTENERS.forEach{
|
||||
val listener = it.value
|
||||
listener.onMoGoObuDcCombineData(obuWarningData)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.function.call.order
|
||||
|
||||
import com.mogo.eagle.core.function.api.order.IOrderListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @date 2023/4/20
|
||||
* 订单监听管理
|
||||
*/
|
||||
object CallerOrderListenerManager: CallerBase<IOrderListener>() {
|
||||
|
||||
fun invokeOrderStatus(inOrder: Boolean){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onUpdateOrderStatus(inOrder)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeOrderRemoval(){
|
||||
M_LISTENERS.forEach{
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onOrderRemoval()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.mogo.eagle.core.function.call.patch
|
||||
|
||||
import android.content.*
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.bindingcar.AppInfo.PatchInfo
|
||||
import com.mogo.eagle.core.function.api.patch.*
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.io.*
|
||||
import java.util.concurrent.CopyOnWriteArraySet
|
||||
|
||||
object CallerPatchManager {
|
||||
|
||||
private val patchInfo by lazy { CopyOnWriteArraySet<PatchInfo>() }
|
||||
|
||||
private val provider: IMoGoPatchProvider? by lazy {
|
||||
CallerBase.getApiInstance(IMoGoPatchProvider::class.java, MogoServicePaths.PATH_PATCH_UPGRADE)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context 上下文环境
|
||||
* @param expectOldApkMd5 服务端返回的旧apk文件的md5
|
||||
* @return true: 本地apk与服务端旧apk版本的md5文件一致; false: 本地apk与服务端旧apk版本md5不一致
|
||||
*/
|
||||
fun isPatchAccept(context: Context, expectOldApkMd5: String, patchSize: Long): Boolean {
|
||||
return provider?.isPatchAccept(context, expectOldApkMd5, patchSize) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context 上下文环境
|
||||
* @param patch 已下载文件的patch路径
|
||||
* @param newApk 合成后文件的文件路径
|
||||
* @return true: patch与旧apk文件合成成功; false: patch与旧apk文件合成失败
|
||||
*/
|
||||
fun applyPatch(context: Context, patch: File, newApk: File): Boolean {
|
||||
return provider?.applyPatch(context, patch, newApk) ?: false
|
||||
}
|
||||
|
||||
/**
|
||||
* @param context 上下文环境
|
||||
* @param mergedApk patch合成后的文件路径
|
||||
* @param expectNewApkMd5 期望合成后文件的md5值
|
||||
* @return true: md5校验成功; false: md5校验失败
|
||||
*/
|
||||
fun checkMd5ForMergedApk(context: Context, mergedApk: File, expectNewApkMd5: String): Boolean {
|
||||
return provider?.checkMd5ForMergedApk(context, mergedApk, expectNewApkMd5) ?: false
|
||||
}
|
||||
|
||||
fun addPatchInfo(info: PatchInfo) {
|
||||
patchInfo += info
|
||||
}
|
||||
|
||||
fun getPatchInfoByUrl(patchUrl: String): PatchInfo? = patchInfo.find { it.patchDownloadUrl == patchUrl }
|
||||
|
||||
fun removePatchInfoByUrl(patchUrl: String) {
|
||||
try {
|
||||
patchInfo.remove(patchInfo.find { it.patchDownloadUrl == patchUrl })
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,32 @@
|
||||
package com.mogo.eagle.core.function.call.telematic
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerTelematicListenerManager: CallerBase<IReceivedMsgListener>() {
|
||||
|
||||
private const val TAG = "CallerTelematicListenerManager"
|
||||
|
||||
fun invokeReceivedMsg(type: Int, byteArray: ByteArray) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onReceivedMsg(type, byteArray)
|
||||
try {
|
||||
listener.onReceivedMsg(type, byteArray)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "转发消息出现异常:${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun dispatchServerSn(sn: String?) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
try {
|
||||
listener.onReceivedServerSn(sn)
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "转发司机屏SN出现异常:${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ object CallerTelematicManager {
|
||||
|
||||
/**
|
||||
* 发送数据给所有客户端
|
||||
* type:保存在TelematicConstant中
|
||||
* type:保存在 TelematicConstant 中
|
||||
*/
|
||||
fun sendMsgToAllClients(type: Int, byteArray: ByteArray) {
|
||||
providerApi?.sendMsgToAllClients(type, byteArray)
|
||||
|
||||
@@ -17,7 +17,7 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
|
||||
}
|
||||
|
||||
fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
CallerTrafficLightListenerManager.trafficLightResult = trafficLightResult
|
||||
this.trafficLightResult = trafficLightResult
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onTrafficLightStatus(trafficLightResult)
|
||||
@@ -57,10 +57,11 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
|
||||
*/
|
||||
fun resetTrafficLightStatus(hideTrafficLight:Boolean = true) {
|
||||
trafficLightResult = null
|
||||
// 隐藏traffic light
|
||||
if(hideTrafficLight){
|
||||
disableTrafficLight()
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.resetTrafficLight(hideTrafficLight)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun showTrafficLight(checkLightId: TrafficLightEnum, lightSource: DataSourceType) {
|
||||
|
||||
Reference in New Issue
Block a user