diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml index e641d09ce5..63dc07bcfc 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml +++ b/core/function-impl/mogo-core-function-datacenter/src/main/AndroidManifest.xml @@ -3,13 +3,7 @@ package="com.mogo.eagle.core.function.datacenter"> - - - - - - @@ -18,13 +12,6 @@ - - - - - - - diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt index c66bdb3f4c..4c43812fbe 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/location/MoGoLocationDispatcher.kt @@ -223,14 +223,14 @@ object MoGoLocationDispatcher : /** * OBU定位回调监听 */ - override fun onObuLocationWGS84(data: MogoObuHvBasicsData) { + override fun onObuLocationWGS84(data: MessagePad.GnssInfo) { // 更新GNSS 信息 - lastOBULocation.longitude = data.vehBasicsMsg.longitude - lastOBULocation.latitude = data.vehBasicsMsg.latitude - lastOBULocation.heading = data.vehBasicsMsg.heading - lastOBULocation.gnssSpeed = data.vehBasicsMsg.speed.toFloat() - lastOBULocation.altitude = data.vehBasicsMsg.elevation - lastOBULocation.satelliteTime = data.vehBasicsMsg.secMark + lastOBULocation.longitude = data.longitude + lastOBULocation.latitude = data.latitude + lastOBULocation.heading = data.heading + lastOBULocation.gnssSpeed = data.gnssSpeed.toFloat() + lastOBULocation.altitude = data.altitude + lastOBULocation.satelliteTime = (data.satelliteTime * 1000).toLong() lastOBULocation.lastReceiveTime = TimeUtils.getNowMills() // 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等 diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index 39f0cd00a1..f76929ab06 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -256,24 +256,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener when (status) { // 添加 MogoObuConstants.STATUS.ADD -> { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent, null, direction - ) - + saveObuToDcData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) // 更新数据,是否需要 // TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)?.let { // CallerMapUIServiceManager.getMarkerService() @@ -342,25 +326,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener when (rsmWarningData.warningMsg.warningDataList[0].status) { MogoObuConstants.STATUS.ADD -> { // 添加 - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - v2xType, - alertContent, - ttsContent, - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent, - null, - direction - ) + saveObuToDcData(v2xType, alertContent, ttsContent) + showWarning(v2xType, alertContent, ttsContent, direction) // 更新数据 TODO // TrafficDataConvertUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let { @@ -459,27 +426,19 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 else -> WarningDirectionEnum.ALERT_WARNING_ALL } @@ -552,24 +511,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener "${M_OBU}${TAG}", "MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent " ) - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } @@ -605,23 +548,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ) val maxSpeed = currentLight.suggestMaxSpeed * 3.6 if (maxSpeed > 0) { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.TELEMATIC - } - ) - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } } @@ -666,4 +594,35 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } } + /** + * 保存obu通过工控机传输的数据到消息盒子 + */ + private fun saveObuToDcData(type: String, content: String, tts: String) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + type, + content, + tts + ) + ).apply { + sourceType = DataSourceType.TELEMATIC + } + ) + } + + /** + * 消息盒子对应消息的语音播报 + */ + private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) { + CallerHmiManager.warningV2X( + type, + content, + tts, + null, + direction + ) + } + } 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 448913e959..cade324693 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 @@ -29,7 +29,6 @@ import com.mogo.support.obu.constants.MogoObuComType import com.mogo.support.obu.constants.MogoObuConstants import com.mogo.support.obu.constants.MogoObuTopicId import com.mogo.support.obu.model.* -import com.mogo.support.obu.model.advance.SpatLight import com.mogo.support.obu.option.MogoObuCom import com.mogo.support.obu.option.MogoObuOptions import com.zhidao.support.obu.ObuManager @@ -72,7 +71,7 @@ class MogoPrivateObuNewManager private constructor() { .registerTopic(MogoObuTopicId.MAP_MATCH) .build() - //每次连接的时候如果连接连接了,先断开 + //每次连接的时候如果连接连接了,先断开,防止ip改变等导致的连接失败 if (ObuManager.getInstance().connectStatus == 1) { try { ObuManager.getInstance().disconnect() @@ -80,7 +79,6 @@ class MogoPrivateObuNewManager private constructor() { e.printStackTrace() } } - ObuManager.getInstance().connect(options) } @@ -92,7 +90,6 @@ class MogoPrivateObuNewManager private constructor() { ObuManager.getInstance().disconnect() } - private val mogoObuListener: OnObuListener = object : OnObuListener { /** * 连接状态的改变 @@ -111,15 +108,15 @@ class MogoPrivateObuNewManager private constructor() { * HV车辆基础信息 gnssInfo */ override fun onGnssInfo(gnssInfo: MessagePad.GnssInfo?) { - if (gnssInfo != null ) { + if (gnssInfo != null) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onGnssInfo lon = ${gnssInfo.longitude} --- lat = ${gnssInfo.latitude} ---speed = ${gnssInfo.gnssSpeed} ---heading = ${gnssInfo.heading} --acceleration = ${gnssInfo.acceleration} --yawRate = ${gnssInfo.yawRate}" ) // 使用与渠道配置一样的gps提供者提供的数据,app/productFlavors/fPadLenovo.gradle GPS_PROVIDER 0-Android系统,1-工控机,2-OBU if (2 == FunctionBuildConfig.gpsProvider) { - // 同步给MAP地图 TODO -// CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) + // 同步给MAP地图 + CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) // 同步更新经纬度和系统时间至 AutoPilotStatusListener CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon( System.currentTimeMillis() / 1000.0, @@ -244,9 +241,6 @@ class MogoPrivateObuNewManager private constructor() { //车内标牌 MogoObuConstants.RSI_SCENE_TYPE.IVS.toString() -> { when (data.warningMsgList[0].signSerialNum) { -// MogoObuConstants.RTS.RTI_TYPE_INTERSECTION -> { //十字路口 -// appId = EventTypeEnumNew.TYPE_ID_NTERSECTION.poiType -// } MogoObuConstants.RTS.RTI_TYPE_SHAPR_TURNS -> { //急转弯 appId = EventTypeEnumNew.TYPE_ID_SHAPR_TURNS.poiType } @@ -296,11 +290,6 @@ class MogoPrivateObuNewManager private constructor() { // appId = // EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType // } - -// MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转 -// appId = -// EventTypeEnumNew.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType -// } MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒 appId = EventTypeEnumNew.TYPE_USECASE_ID_BUS_WARNING.poiType } @@ -371,24 +360,8 @@ class MogoPrivateObuNewManager private constructor() { if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - CallerHmiManager.warningV2X( - appId, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - null, direction - ) + saveObuData(appId, alertContent, ttsContent) + showWarning(appId, alertContent, ttsContent, direction) // 更新数据 TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let { @@ -472,19 +445,6 @@ class MogoPrivateObuNewManager private constructor() { } MogoObuConstants.STATUS.UPDATE -> { // 更新 - //处理删除逻辑, -// if (rsmPtcIdMap.containsKey(data.participant.ptcId.toString())) { -// var oldTime = rsmPtcIdMap[data.participant.ptcId.toString()] -// var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000 -// if (timeDiff > 3) { //超过3秒,删除对应弱势交通元素 -// CallerMapUIServiceManager.getMarkerService() -// ?.removeCvxRvInfoIndInfo(data.participant.ptcId.toString()) -// } -// rsmPtcIdMap.remove(data.participant.ptcId.toString()) -// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() -// } else { -// rsmPtcIdMap[data.participant.ptcId.toString()] = System.currentTimeMillis() -// } } MogoObuConstants.STATUS.DELETE -> { // 删除 @@ -522,25 +482,8 @@ class MogoPrivateObuNewManager private constructor() { if (alertContent.isEmpty() || ttsContent.isEmpty()) { return } - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - v2xType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - - CallerHmiManager.warningV2X( - v2xType, - alertContent, - ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 - null, direction - ) + saveObuData(v2xType, alertContent, ttsContent) + showWarning(v2xType, alertContent, ttsContent, direction) } MogoObuConstants.STATUS.UPDATE -> {// 更新 @@ -593,9 +536,8 @@ class MogoPrivateObuNewManager private constructor() { } } } - } - } - } + } + } /** * 获取消息的方位 车辆相关 @@ -605,27 +547,19 @@ class MogoPrivateObuNewManager private constructor() { return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_BOTTOM //正后方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_RIGHT -> WarningDirectionEnum.ALERT_WARNING_RIGHT //正右方 - MogoObuConstants.VEH_TARGET_POSITION.INTERSECTION_LEFT -> WarningDirectionEnum.ALERT_WARNING_LEFT //正左方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_LEFT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAR_LEFT -> WarningDirectionEnum.ALERT_WARNING_TOP_LEFT //左前方 - MogoObuConstants.VEH_TARGET_POSITION.AHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.AHEAD_FAR_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_FAT_RIGHT -> WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT //右前方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_LEFT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_LEFT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT //左后方 - MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_RIGHT, MogoObuConstants.VEH_TARGET_POSITION.BEHEAD_FAR_RIGHT, -> WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT //右后方 - MogoObuConstants.VEH_TARGET_POSITION.UNCLASSIFIED -> WarningDirectionEnum.ALERT_WARNING_NON //未知 else -> WarningDirectionEnum.ALERT_WARNING_ALL } @@ -633,10 +567,9 @@ class MogoPrivateObuNewManager private constructor() { /** * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 - * * @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截 - * - * @see com.mogo.module.common.enums.EventTypeEnum + * @see com.mogo.module.common.enums.EventTypeEnumNew + * EventTypeEnumNew在定义的id为了防止重复,和原始数据是不一样的,有对应关系 */ private fun handleSdkObu( appId: String, @@ -766,9 +699,9 @@ class MogoPrivateObuNewManager private constructor() { } // 这里处理固定的提示信息,包括了<紧急车辆提醒> - else -> { //TODO - // ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) - // alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) + else -> { + // ttsContent = EventTypeEnumNew.getWarningTts(appId.toString()) + // alertContent = EventTypeEnumNew.getWarningContent(appId.toString()) } } @@ -782,18 +715,7 @@ class MogoPrivateObuNewManager private constructor() { ) if (level == 2 || level == 3) { //不显示弹框,其它保留 - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - appId, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) + saveObuData(appId, alertContent, ttsContent) CallerHmiManager.warningV2X( appId, alertContent, @@ -837,7 +759,11 @@ class MogoPrivateObuNewManager private constructor() { /** * 处理红绿灯 */ - private fun handlerTrafficLight(appId: Int, status: Int, lights: MutableList) { + private fun handlerTrafficLight( + appId: Int, + status: Int, + lights: MutableList + ) { CallerLogger.d( "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" @@ -845,8 +771,7 @@ class MogoPrivateObuNewManager private constructor() { when (status) { // 添加 MogoObuConstants.STATUS.ADD, - MogoObuConstants.STATUS.UPDATE - -> { + MogoObuConstants.STATUS.UPDATE -> { if (lights != null && lights.isNotEmpty()) { changeTrafficLightStatus(appId, lights) } @@ -857,9 +782,6 @@ class MogoPrivateObuNewManager private constructor() { CallerTrafficLightListenerManager.disableTrafficLight() isShowGreenWave = false isShowRunRedLight = false - // lightCountDownRed = 1 - // lightCountDownGreen = 1 - // lightCountDownYellow = 1 } } } @@ -867,7 +789,6 @@ class MogoPrivateObuNewManager private constructor() { private var isShowGreenWave = false private var isShowRunRedLight = false - /** * 修改红绿灯 */ @@ -893,31 +814,13 @@ class MogoPrivateObuNewManager private constructor() { if (!isShowRunRedLight) { isShowRunRedLight = true CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "changeTrafficLightStatus 闯红灯 --------> " - ) + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "changeTrafficLightStatus 闯红灯 --------> ") ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } @@ -935,33 +838,16 @@ class MogoPrivateObuNewManager private constructor() { ttsContent = String.format( EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeedTts - ) + adviceSpeedTts) alertContent = String.format( EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeed - ) + adviceSpeed) val maxSpeed = currentLight.suggestMaxSpeed if (maxSpeed > 0) { - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.V2X, - V2XMsg( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent - ) - ).apply { - sourceType = DataSourceType.OBU - } - ) - CallerHmiManager.warningV2X( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContent, - ttsContent// 只有第一次才tts,防止更新的时候不断的提醒 - ) + saveObuData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent) + showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } } @@ -1004,4 +890,39 @@ class MogoPrivateObuNewManager private constructor() { ) } } - } + } + + /** + * 保存obu直连数据到消息盒子 + */ + private fun saveObuData(type: String, content: String, tts: String) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.V2X, + V2XMsg( + type, + content, + tts + ) + ).apply { + sourceType = DataSourceType.OBU + } + ) + } + + /** + * 消息盒子对应消息的语音播报 + */ + private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) { + CallerHmiManager.warningV2X( + type, + content, + tts, + null, + direction + ) + } + +} + + 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 index 2ca1b43239..17e01071e0 100644 --- 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 @@ -1,15 +1,17 @@ package com.mogo.eagle.core.function.datacenter.obu.adapter import com.mogo.eagle.core.function.call.obu.* -import com.mogo.support.obu.OnMogoObuListener +import com.mogo.support.obu.ObuScene import com.mogo.support.obu.constants.Define.ConnectStatus import com.mogo.support.obu.model.* +import com.zhidao.support.obu.OnObuListener +import mogo.telematics.pad.MessagePad /** * 适配 OBU 回调监听分发,这里不做业务,只做数据包装及分发处理 * @author dong hong yu */ -object MoGoObuListenerImpl : OnMogoObuListener() { +object MoGoObuListenerImpl : OnObuListener { /** * 连接状态 @@ -36,8 +38,10 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuHvBasics(data: MogoObuHvBasicsData) { - CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(data) + override fun onGnssInfo(gnssInfo: MessagePad.GnssInfo?) { + if (gnssInfo != null) { + CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(gnssInfo) + } } /** @@ -46,8 +50,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRvWarning(data: MogoObuRvWarningData) { - CallerObuWarningRvListenerManager.invokeObuRvWarning(data) + override fun onObuRvWarning(rvWarningData: ObuScene.RvWarningData?) { } /** @@ -56,8 +59,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) { - + override fun onObuSpatWarning(spatWarningData: ObuScene.SpatWarningData?) { } /** @@ -66,8 +68,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { - + override fun onObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData?) { } /** @@ -76,7 +77,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData) { + override fun onObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData?) { } /** @@ -85,6 +86,8 @@ object MoGoObuListenerImpl : OnMogoObuListener() { * @param data 数据 * @since 1.0.0 */ - override fun onMogoObuMapMath(data: MogoObuMapMathData) { + override fun onObuMapMath(mapMatchData: ObuScene.MapMatchData?) { + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt deleted file mode 100644 index d79a247af1..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuRsuTestTriggerReceiver.kt +++ /dev/null @@ -1,120 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.obu.receiver - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager -//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -//import com.zhidao.support.obu.constants.ObuConstants -//import com.zhidao.support.obu.model.CvxIvpThreatIndInfo -//import com.zhidao.support.obu.model.CvxPtcThreatIndInfo -//import com.zhidao.support.obu.model.CvxRtiThreatIndInfo -//import com.zhidao.support.obu.model.CvxSlwThreatIndInfo -//import com.zhidao.support.obu.model.advance.* - -/** - * @author lixiaopeng - * @date 2021/8/18 - * - * OBU 测试使用 - * 红绿灯 - */ -class ObuRsuTestTriggerReceiver : BroadcastReceiver() { - private var mContext: Context? = null - - companion object { - private const val TAG = "ObuRsuTestTriggerReceiver" - } - - override fun onReceive(context: Context, intent: Intent) { - mContext = context - -// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0) -// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0) -// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3) -// val indicator = intent.getIntExtra(MogoObuConst.BROADCAST_LIGHT_LEVEL_EXTRA_KEY, 0) -// val pctType = intent.getIntExtra(MogoObuConst.BROADCAST_PTC_INFO_EXTRA_KEY, 0) -// val rtiType = intent.getIntExtra(MogoObuConst.BROADCAST_RTI_TYPE_EXTRA_KEY, 0) -// -// CallerLogger.d( -// "$M_OBU$TAG", "obuStatus:$obuStatus phase:$indicator obuType:$obuType obuLevel:$obuLevel" -// ) -// -// when (obuType) { -// ObuConstants.USE_CASE_ID.IVP -> { //构建红绿灯数据 -// val cvxIvpThreatIndInfo = CvxIvpThreatIndInfo(1, 1, 1L) -// -// val ivpThreat = IvpThreat(1, obuType, null, 1000, obuLevel, 100) -// -// cvxIvpThreatIndInfo.threat_info = ivpThreat -// -// val lightList = listOf( -// Light(1, 0x0, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x1, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x2, 1000, 3000, 6000, 3000, 100, 1000), -// Light(1, 0x3, 1000, 3000, 6000, 3000, 100, 1000) -// ) -// val ivpThreatExt = IvpThreatExt(1, 1000, 1000, 0, indicator, lightList) -// cvxIvpThreatIndInfo.ext_info = ivpThreatExt -// cvxIvpThreatIndInfo.status = obuStatus -// cvxIvpThreatIndInfo.link_id = "1" -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxIvpThreatIndInfo(cvxIvpThreatIndInfo) -// } -// -// ObuConstants.USE_CASE_ID.SLW -> { //限速预警 -// val cvxSlwThreatIndInfo = CvxSlwThreatIndInfo(1, 1, 1L) -// val slwThreatExt = SlwThreatExt(1, 2, 6000, 2000) -// -// cvxSlwThreatIndInfo.ext_info = slwThreatExt -// cvxSlwThreatIndInfo.status = obuStatus -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxSlwThreatIndInfo(cvxSlwThreatIndInfo) -// } -// -// //弱势交通参与者碰撞预警,行人/摩托车碰撞预警 -// ObuConstants.USE_CASE_ID.VRUCW -> { -// val cvxPtcIndInfo = CvxPtcThreatIndInfo(1, 1, 1) -// val position = Position(1, 399739429, 1164115207, 20) -// cvxPtcIndInfo.ptc_pos = position -// cvxPtcIndInfo.ptc_id = "111" -// cvxPtcIndInfo.ptc_type = pctType -// cvxPtcIndInfo.status = obuStatus -// -// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100) -// cvxPtcIndInfo.threat_info = v2vThreat -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxPtcThreatIndInfo(cvxPtcIndInfo) -// } -// -// //道路危险情况, 车内标牌, 前方拥堵提醒 -// ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, ObuConstants.USE_CASE_ID.TJW -> { -// val cvxRtiThreatIndInfo = CvxRtiThreatIndInfo(1, 1, 1L) -// val dateTime = DateTime(1, 1, 1, 1, 1, 1, 1, 1) -// val rtiThread = RtiThreat(1, obuType, dateTime, 100000, obuLevel, 100) -// val extInfo = RtiThreatExt(1, rtiType, 0x02, 100000, 100000) -// val position = Position(1, 399739429, 1164115207, 20) -// -// // 位置围栏 -// val zonesInfo = listOf( -// ZoneInfo(1, 2000, 2000, listOf(position)) -// ) -// -// cvxRtiThreatIndInfo.rti_id = "123123" -// cvxRtiThreatIndInfo.zones_info = zonesInfo -// cvxRtiThreatIndInfo.threat_info = rtiThread -// cvxRtiThreatIndInfo.ext_info = extInfo -// cvxRtiThreatIndInfo.status = obuStatus -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxRtiThreatIndInfo(cvxRtiThreatIndInfo) -// } -// } - } - -} diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt index 8a6eb1f7c0..4e9dc56327 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestNewObuReceiver.kt @@ -14,7 +14,7 @@ import com.mogo.support.obu.model.advance.WarningData * @author lixiaopeng * @date 2022/9/8 10:50 上午 * - * 自研OBU 模拟场景 + * 自研OBU 模拟场景 HV */ class ObuTestNewObuReceiver : BroadcastReceiver() { private var mContext: Context? = null @@ -49,6 +49,8 @@ class ObuTestNewObuReceiver : BroadcastReceiver() { // val cvxHvInfoIndInfo = MogoRvWarningData(0, vehBasicsMsg, warningMsg) +// val gnssInfo = MessagePad.GnssInfo() + // MogoPrivateObuNewManager.INSTANCE // .getMogoObuListener() // .onGnssInfo(cvxHvInfoIndInfo) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt deleted file mode 100644 index 052107741e..0000000000 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/receiver/ObuTestTriggerReceiver.kt +++ /dev/null @@ -1,89 +0,0 @@ -package com.mogo.eagle.core.function.datacenter.obu.receiver - -import android.content.BroadcastReceiver -import android.content.Context -import android.content.Intent -//import com.mogo.eagle.core.function.obu.mogo.MogoObuConst -//import com.mogo.eagle.core.function.datacenter.obu.MogoPrivateObuManager -//import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger -//import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU -//import com.zhidao.support.obu.constants.ObuConstants -//import com.zhidao.support.obu.model.CvxV2vThreatIndInfo -//import com.zhidao.support.obu.model.advance.MovingObjectInfo -//import com.zhidao.support.obu.model.advance.Position -//import com.zhidao.support.obu.model.advance.V2vThreat -//import com.zhidao.support.obu.model.advance.V2vThreatExt -//import kotlin.random.Random - -/** - * @author xiaoyuzhou - * @date 2021/8/11 10:50 上午 - * - * OBU 测试使用 - */ -class ObuTestTriggerReceiver : BroadcastReceiver() { - private var mContext: Context? = null - - companion object { - private const val TAG = "ObuTestTriggerReceiver" - } - - override fun onReceive(context: Context, intent: Intent) { -// mContext = context -// /** -// * OBU 场景类型 -// * @see com.zhidao.support.obu.constants.ObuConstants.USE_CASE_ID -// */ -// val obuType = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_TYPE_EXTRA_KEY, 0) -// val obuStatus = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_STATES_EXTRA_KEY, 0) -// val obuLevel = intent.getIntExtra(MogoObuConst.BROADCAST_OBU_LEVEL_EXTRA_KEY, 3) -// val obuDirection = -// intent.getIntExtra(MogoObuConst.BROADCAST_OBU_EVENT_DIRECTION_EXTRA_KEY, 0x11) -// CallerLogger.d( -// "$M_OBU$TAG", "obuType:$obuType obuStatus:$obuStatus obuDirection$obuDirection" -// ) -// -// when (obuType) { -// ObuConstants.USE_CASE_ID.EBW, ObuConstants.USE_CASE_ID.FCW, ObuConstants.USE_CASE_ID.ICW, -// ObuConstants.USE_CASE_ID.CLW, ObuConstants.USE_CASE_ID.DNPW, ObuConstants.USE_CASE_ID.AVW, -// ObuConstants.USE_CASE_ID.BSW, ObuConstants.USE_CASE_ID.LCW, ObuConstants.USE_CASE_ID.EVW, ObuConstants.USE_CASE_ID.VRUCW, -// ObuConstants.USE_CASE_ID.SLW, ObuConstants.USE_CASE_ID.LTA, ObuConstants.USE_CASE_ID.HLW, ObuConstants.USE_CASE_ID.IVS, -// ObuConstants.USE_CASE_ID.TJW, ObuConstants.USE_CASE_ID.IVP, ObuConstants.USE_CASE_ID.COC -> { -// -// // 构建测试数据 -// val cvxV2vThreatIndInfo = CvxV2vThreatIndInfo(1, 1, 1L) -// -// val v2vThreat = V2vThreat(1, obuType, null, 1000, obuLevel, 100) -// cvxV2vThreatIndInfo.threat_info = v2vThreat -// -// val v2vThreatExt = -// V2vThreatExt( -// 1, 1, obuDirection, 1, 1 -// ) -// cvxV2vThreatIndInfo.ext_info = v2vThreatExt -// cvxV2vThreatIndInfo.status = obuStatus -// cvxV2vThreatIndInfo.vehicle_id = "123321" -// -// -// // 设置位置 -// val randomLocation = Random.nextInt(100, 2000) -// -// val position = Position( -// 0, (399739429 + randomLocation).toLong(), -// (1164115207 + randomLocation).toLong(), 20 -// ) -// val movingObjectInfo = MovingObjectInfo( -// 0, -// position, -// 1800 +randomLocation, -// 6000 +randomLocation -// ) -// cvxV2vThreatIndInfo.basic_info = movingObjectInfo -// -// MogoPrivateObuManager.INSTANCE.getMogoObuListener() -// .onCvxV2vThreatIndInfo(cvxV2vThreatIndInfo) -// } -// } - } - -} \ 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/vehicle/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt index 67c43f6f1f..66a1a68404 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt @@ -2,7 +2,9 @@ package com.mogo.eagle.core.function.hmi.ui.vehicle import android.content.Context import android.util.AttributeSet +import android.util.TypedValue.COMPLEX_UNIT_PX import android.view.LayoutInflater +import android.view.ViewGroup import androidx.appcompat.content.res.AppCompatResources import androidx.constraintlayout.widget.ConstraintLayout import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo @@ -23,6 +25,8 @@ import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.zhjt.service_biz.BizConfig import kotlinx.android.synthetic.main.view_pnc_actions.view.* +import me.jessyan.autosize.AutoSize +import me.jessyan.autosize.utils.AutoSizeUtils import mogo.telematics.pad.MessagePad class PncActionsView @JvmOverloads constructor( @@ -41,12 +45,24 @@ class PncActionsView @JvmOverloads constructor( private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null + private val bgResources: Int + private val topMargin: Int + private val txtSize: Int + init { LayoutInflater.from(context).inflate(R.layout.view_pnc_actions, this, true) + val a = context.obtainStyledAttributes(attrs, R.styleable.PncActionsView, defStyleAttr, 0) + bgResources = a.getResourceId(R.styleable.PncActionsView_background_resource, R.drawable.pnc_actions_bg) + topMargin = a.getResourceId(R.styleable.PncActionsView_pnc_top_margin,resources.getDimension(R.dimen.dp_30).toInt()) + txtSize = a.getResourceId(R.styleable.PncActionsView_pnc_size,resources.getDimension(R.dimen.dp_34).toInt()) + a.recycle() } override fun onAttachedToWindow() { super.onAttachedToWindow() + (tvHmiPncActions.layoutParams as MarginLayoutParams).topMargin = topMargin + tvHmiPncActions.setTextSize(COMPLEX_UNIT_PX,txtSize.toFloat()) + CallerAutoPilotStatusListenerManager.addListener(TAG, this) CallerPlanningActionsListenerManager.addListener(TAG, this) CallerTrafficLightListenerManager.addListener(TAG, this) @@ -78,14 +94,21 @@ class PncActionsView @JvmOverloads constructor( var actions: String? = null planningActionMsg.actionMsg?.let { it -> try { - actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number) - } catch (e:Exception){ + actions = PncActionsHelper.getAction( + it.drivingState.number, + it.drivingAction.number + ) + } catch (e: Exception) { e.printStackTrace() } //如果是存在云端红绿灯数据条件下,设置云端数据 - if (PncActionsHelper.isWaitingTrafficlight(it.drivingState.number, it.drivingAction.number) + if (PncActionsHelper.isWaitingTrafficlight( + it.drivingState.number, + it.drivingAction.number + ) && mTrafficLightResult != null - && getWaitTrafficLightTime().isNotBlank()) { + && getWaitTrafficLightTime().isNotBlank() + ) { actions += ",预计${getWaitTrafficLightTime()}秒后通过" } else { mTrafficLightResult = null @@ -96,7 +119,8 @@ class PncActionsView @JvmOverloads constructor( this.background = null tvHmiPncActions.text = "" } else { - this.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg) + this.background = + AppCompatResources.getDrawable(context, bgResources) tvHmiPncActions.text = actions } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml index 81747337ad..7314ec144c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_pnc_actions.xml @@ -9,10 +9,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" - android:paddingStart="@dimen/dp_68" - android:paddingEnd="@dimen/dp_68" android:textColor="#FFFFFF" - android:textSize="@dimen/dp_34" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml index 638b1ca53c..2b18f99042 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml @@ -73,4 +73,10 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt index 52216f9c14..d07c857bf1 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/angle/MoGoVisualAngleChangeProvider.kt @@ -28,11 +28,8 @@ import java.util.concurrent.atomic.* @Route(path = MogoServicePaths.PATH_VISUAL_ANGLE) class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider { - override val functionName: String - get() = "VisualAngleChange" - companion object { - const val TAG = "VisualAngleChange" + private const val TAG = "VisualAngleChange" } private val triggerLocation = AtomicReference() @@ -147,11 +144,6 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider { return CoroutineScope(Handler(Looper.getMainLooper()).asCoroutineDispatcher("change-visual-angle") + SupervisorJob()) } - - override fun onDestroy() { - CallerMapRoadListenerManager.unRegisterRoadListener("VisualAngleChange") - } - @Volatile private var mLevel:Boolean = false diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index cf2c47b420..9b1859c223 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -116,6 +116,7 @@ class HttpDnsStartUp : AndroidStartup() { // clientConfig.socketTechUrl // 设置是否是直播推流的主播 clientConfig.isAnchor = true + clientConfig.loopCheckDelay = (60 * 60 * 2 * 1000).toLong() //todo arrow when (DebugConfig.getCarMachineType()) { DebugConfig.CAR_MACHINE_TYPE_LENOVO -> clientConfig.thirdPartyAppKey = "pfieouqg" else -> clientConfig.thirdPartyAppKey = "wbvpzgar" diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt index a4c1ec1712..a91757137d 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/map/angle/IMoGoVisualAngleChangeProvider.kt @@ -1,8 +1,8 @@ package com.mogo.eagle.core.function.api.map.angle -import com.mogo.eagle.core.function.api.base.* +import com.alibaba.android.arouter.facade.template.IProvider -interface IMoGoVisualAngleChangeProvider: IMoGoFunctionServerProvider { +interface IMoGoVisualAngleChangeProvider: IProvider { fun updateLongSightLevel(level: Boolean) 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 index 16c5fd57b3..8c4eeac160 100644 --- 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 @@ -1,6 +1,6 @@ package com.mogo.eagle.core.function.api.obu -import com.mogo.support.obu.model.MogoObuHvBasicsData +import mogo.telematics.pad.MessagePad /** * OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系 @@ -15,6 +15,6 @@ interface IMoGoObuLocationWGS84Listener { * @param data 数据 * @since 1.0.0 */ - fun onObuLocationWGS84(data: MogoObuHvBasicsData) + fun onObuLocationWGS84(data: MessagePad.GnssInfo) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuLocationWGS84ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuLocationWGS84ListenerManager.kt index 8b1370b34b..ac9b5179ed 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuLocationWGS84ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/obu/CallerObuLocationWGS84ListenerManager.kt @@ -3,13 +3,14 @@ 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 /** * OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系 */ object CallerObuLocationWGS84ListenerManager : CallerBase() { - fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) { + fun invokeObuLocationWGS84(data: MessagePad.GnssInfo) { M_LISTENERS.forEach { val tag = it.key val listener = it.value