From 0f98d5b7f0c32a1a1a011839731cb1227c680cbe Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 1 Dec 2022 14:40:34 +0800 Subject: [PATCH] =?UTF-8?q?2.13.0=20=E6=B7=BB=E5=8A=A0obu=E7=9A=84?= =?UTF-8?q?=E9=99=90=E9=80=9F=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=8E=A7=E5=88=B6=E9=99=90=E9=80=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9D=A5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmi/ui/setting/DebugSettingView.kt | 8 +++ .../main/res/layout/view_debug_setting.xml | 11 ++++ .../impl/marker/drawer/TrafficMarkerDrawer.kt | 6 ++ .../obu/mogo/MogoPrivateObuNewManager.kt | 59 +++++++++++-------- .../v2x/speedlimit/SpeedLimitDataManager.java | 18 +++--- .../eagle/core/data/config/HmiBuildConfig.kt | 8 +++ 6 files changed, 79 insertions(+), 31 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 82504edac8..a061335ede 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -26,6 +26,7 @@ import com.mogo.commons.debug.DebugConfig import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.autopilot.* import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_BAG_RECORD @@ -1136,6 +1137,13 @@ class DebugSettingView @JvmOverloads constructor( } } + /** + * 限速数据,优先使用obu,默认打开 + */ + tbRoadLimitSpeed.setOnCheckedChangeListener { _, isChecked -> + HmiBuildConfig.isShowObuLimitSpeedView = !isChecked + } + /** * 实时加速度面板控制 */ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 6a2021f4bd..b8a2f334e9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -1379,6 +1379,17 @@ android:textOn="关闭云端弱势群体预警" android:textSize="@dimen/dp_24" /> + + ${data.status}" ) @@ -552,7 +554,9 @@ class MogoPrivateObuNewManager private constructor() { // CallerMapUIServiceManager.getMarkerService() // ?.updateITrafficInfo(it) // } + TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let { + CallerLogger.d("$M_OBU${TAG_MOGO_OBU}", "cvxPtcThreatIndInfo2TrafficData ---it---> $it") CallerMapUIServiceManager.getMarkerService() ?.updateITrafficThreatLevelInfo(it) } @@ -585,21 +589,28 @@ class MogoPrivateObuNewManager private constructor() { */ override fun onMogoObuMapMath(data: MogoObuMapMathData?) { super.onMogoObuMapMath(data) - if (data != null) { - CallerLogger.d( - "$M_OBU${TAG_MOGO_OBU}", - "onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}") - when (data.status) { - MogoObuConstants.STATUS.ADD -> { // 添加 - CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt()) - } + if(isShowObuLimitSpeedView) { //默认显示obu的限速 + if (data != null) { + CallerLogger.d( + "$M_OBU${TAG_MOGO_OBU}", + "onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}") + when (data.status) { + MogoObuConstants.STATUS.ADD -> { // 添加 + UiThreadHandler.post { + if(data.speedMaxLimit > 0) { + CallerHmiManager.showLimitingVelocity(Math.round((data.speedMaxLimit*3.6)).toInt()) + } + } + } - MogoObuConstants.STATUS.UPDATE -> { // 更新 + MogoObuConstants.STATUS.UPDATE -> { // 更新 + } - } - - MogoObuConstants.STATUS.DELETE -> { // 删除 - CallerHmiManager.disableLimitingVelocity() + MogoObuConstants.STATUS.DELETE -> { // 删除 + UiThreadHandler.post { + CallerHmiManager.disableLimitingVelocity() + } + } } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java index bb2fd2e7b8..15769c64cc 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/speedlimit/SpeedLimitDataManager.java @@ -1,9 +1,11 @@ package com.mogo.eagle.core.function.v2x.speedlimit; +import static com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView; import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.BIZ_SLW; import static com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.V2I; import android.location.Location; +import android.util.Log; import com.mogo.eagle.core.function.call.hmi.CallerHmiManager; import com.mogo.eagle.core.function.call.v2x.CallLimitingVelocityListenerManager; @@ -52,13 +54,15 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 { @BizConfig(biz = V2I,dependentBizNode = "",bizNode = BIZ_SLW) private void getSpeedLimit() { - int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing()); - UiThreadHandler.post(() -> { - if (speedLimit > 0) { - CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit); - CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); - } - }); + if (!isShowObuLimitSpeedView) { + int speedLimit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing()); + UiThreadHandler.post(() -> { + if (speedLimit > 0) { + CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimit); + CallLimitingVelocityListenerManager.INSTANCE.invokeOnLimitingVelocityChange(speedLimit); + } + }); + } } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt index a0ace656e0..b626dab4b5 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt @@ -92,4 +92,12 @@ object HmiBuildConfig { @JvmField @Volatile var isShowCloudWeaknessTrafficView = false + + /** + * 是否展示obu的限速 + */ + @JvmField + @Volatile + var isShowObuLimitSpeedView = true + } \ No newline at end of file