From 804f4a22838eb7bea1a6f3380d6d66ebe1f33cab Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Wed, 7 Dec 2022 14:25:57 +0800 Subject: [PATCH] =?UTF-8?q?[2.13.0=20=E4=BF=AE=E6=94=B9obu=E6=97=A5?= =?UTF-8?q?=E5=BF=97]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/obu/mogo/MogoObuConst.java | 2 + .../obu/mogo/MogoPrivateObuNewManager.kt | 39 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java index d293a3124a..c4aa8f0906 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoObuConst.java @@ -12,6 +12,8 @@ public class MogoObuConst { */ public static final String TAG_MOGO_OBU = "MogoObu"; + public static final String TAG_MOGO_NEW_OBU = "MogoNewObu"; + // OBU 场景测试 // 场景类型 public static String BROADCAST_OBU_TYPE_EXTRA_KEY = "obuType"; diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt index 058d3ec7ad..349c1798fe 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt @@ -17,7 +17,6 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Defa 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.obu.mogo.MogoObuConst.TAG_MOGO_OBU import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtilsNew import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU @@ -93,7 +92,7 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onConnectStatus(connectStatus: Int) { if (connectStatus == 0) { //断开连接 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnectFail ------> ") + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnectFail ------> ") mObuStatusInfo.obuStatus = false mObuStatusInfo.obuHvStatus = false mObuStatusInfo.obuRvStatus = false @@ -102,7 +101,7 @@ class MogoPrivateObuNewManager private constructor() { mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) } mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) } } else if (connectStatus == 1) { //连接成功 - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "onConnected ------> ") + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnected ------> ") mObuStatusInfo.obuStatus = true CallerObuListenerManager.invokeListener(mObuStatusInfo) mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) } @@ -125,7 +124,7 @@ class MogoPrivateObuNewManager private constructor() { if (p0 != null && p0.vehBasicsMsg != null) { CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuHvBasics lon = ${p0.vehBasicsMsg.longitude} --- lat = ${p0.vehBasicsMsg.latitude} ---speed = ${p0.vehBasicsMsg.speed} ---heading = ${p0.vehBasicsMsg.heading} --acceleration = ${p0.vehBasicsMsg.accFourAxes.accLat} --yawRate = ${p0.vehBasicsMsg.accFourAxes.accYaw}" ) val data = JSONObject() @@ -179,7 +178,7 @@ class MogoPrivateObuNewManager private constructor() { CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(it) } - CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", data.toString()) + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) data.let { //预警信息,预警类型 threat_level 2、3 var status = data.status @@ -197,7 +196,7 @@ class MogoPrivateObuNewManager private constructor() { } CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRvWarning target_classification = ${ getMessageDirection(data.vehBasicsMsg.targetPosition) } --- direction = $direction --- appId = $appId ---level = $level -- status = $status" @@ -233,7 +232,7 @@ class MogoPrivateObuNewManager private constructor() { override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) { super.onMogoObuRsiWarning(data) CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsiWarning ------> $data" ) if (data != null && data.warningMsg != null && data.warningMsg.size > 0) { @@ -244,7 +243,7 @@ class MogoPrivateObuNewManager private constructor() { val level = data.warningMsg[0].warningLevel val direction = getMessageDirection(data.warningMsg[0].targetPosition) CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}" ) @@ -400,7 +399,7 @@ class MogoPrivateObuNewManager private constructor() { } CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}" ) when (status) { @@ -476,7 +475,7 @@ class MogoPrivateObuNewManager private constructor() { super.onMogoObuRsmWarning(data) if (HmiBuildConfig.isShowObuWeaknessTrafficView) { CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ------> ${data.toString()}" ) // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu @@ -501,7 +500,7 @@ class MogoPrivateObuNewManager private constructor() { val direction = getMessageDirection(data.participant.targetPosition) if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) { level = data.warningMsg.warningData[0].warningLevel //默认是1个 - CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status}" ) @@ -540,7 +539,7 @@ class MogoPrivateObuNewManager private constructor() { // 更新数据 TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let { - CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it") + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "add cvxPtcThreatIndInfo2TrafficData ---it---> $it") CallerMapUIServiceManager.getMarkerService() ?.updateITrafficThreatLevelInfo(it) } @@ -579,7 +578,7 @@ class MogoPrivateObuNewManager private constructor() { if(isShowObuLimitSpeedView) { //默认显示obu的限速 if (data != null) { CallerLogger.d( - "$M_OBU${TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}") when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 @@ -610,7 +609,7 @@ class MogoPrivateObuNewManager private constructor() { * 获取消息的方位 车辆相关 */ private fun getMessageDirection(targetClassification: Int): WarningDirectionEnum { -// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "预警红边:预警方向->$targetClassification") +// CallerLogger.d("$M_OBU${TAG_MOGO_NEW_OBU}", "预警红边:预警方向->$targetClassification") return when (targetClassification) { MogoObuConstants.VEH_TARGET_POSITION.AHEAD_IN_LANE, MogoObuConstants.VEH_TARGET_POSITION.ONCOMING_IN_LANE -> WarningDirectionEnum.ALERT_WARNING_TOP //正前方 @@ -656,7 +655,7 @@ class MogoPrivateObuNewManager private constructor() { ) { // 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的 CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status" ) @@ -735,7 +734,7 @@ class MogoPrivateObuNewManager private constructor() { MogoObuConstants.STATUS.ADD, MogoObuConstants.STATUS.UPDATE -> { CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" ) if (level == 2 || level == 3) { @@ -804,7 +803,7 @@ class MogoPrivateObuNewManager private constructor() { */ private fun handlerTrafficLight(appId: Int, status: Int, lights: List) { CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId" ) when (status) { @@ -839,7 +838,7 @@ class MogoPrivateObuNewManager private constructor() { //这里需要根据真实数据确定 index 取值方式 val currentLight = lights[0] CallerLogger.d( - "$M_OBU${TAG_MOGO_OBU}", + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "currentLight = $currentLight ---currentLight.phase = ${currentLight.phaseId} ---appId = $appId" ) // 闯红灯预警,绿波通行和闯红灯是互斥的 @@ -849,7 +848,7 @@ class MogoPrivateObuNewManager private constructor() { } 0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT TODO 需要约束一个红灯周期只显示一次 // CallerHmiManager.disableWarningV2X(0x2.toString()) -// CallerLogger.d("$M_OBU${TAG_MOGO_OBU}","changeTrafficLightStatus 闯红灯 --------> ") +// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ") // ttsContent = EventTypeEnumTrafficLight.getWarningTts(appId.toString()) // alertContent = EventTypeEnumTrafficLight.getWarningContent(appId.toString()) // CallerHmiManager.warningV2X( @@ -860,7 +859,7 @@ class MogoPrivateObuNewManager private constructor() { 0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION TODO 需要约束一个绿灯周期只显示一次 // CallerHmiManager.disableWarningV2X(0x1.toString()) // CallerLogger.d( -// "$M_OBU${TAG_MOGO_OBU}", +// "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", // "speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" // ) // val adviceSpeed =