From 5b566723618be8cb8f000a2105fce9daa9799eac Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Wed, 7 Dec 2022 11:30:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[2.13.0]=20=E6=B7=BB=E5=8A=A0=E8=BF=90?= =?UTF-8?q?=E8=90=A5=E9=9D=A2=E6=9D=BF=E5=BC=B1=E5=8A=BF=E4=BA=A4=E9=80=9A?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=EF=BC=8C=E4=B9=8B=E5=89=8D=E5=9C=A8=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../function/hmi/ui/setting/SOPSettingView.kt | 23 ++++++++++++++++ .../src/main/res/layout/view_sop_setting.xml | 26 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 8917b830bb..ffb624e90f 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -19,6 +19,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.util.ToastUtils import com.mogo.eagle.core.function.business.routeoverlay.RouteStrategy import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView +import kotlinx.android.synthetic.main.view_debug_setting.view.* import kotlinx.android.synthetic.main.view_sop_setting.view.* import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect @@ -71,6 +72,28 @@ class SOPSettingView @JvmOverloads constructor( } } + /** + * obu弱势交通控制 + */ + tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> + if (!isChecked) { //默认开启 + CallerHmiManager.setObuWeaknessTraffic(true) + } else { + CallerHmiManager.setObuWeaknessTraffic(false) + } + } + + /** + * 云端弱势交通控制 + */ + tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked -> + if (isChecked) { //默认关闭 + CallerHmiManager.setCloudWeaknessTraffic(true) + } else { + CallerHmiManager.setCloudWeaknessTraffic(false) + } + } + //红绿灯标识 tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView tbTrafficLight.setOnCheckedChangeListener { _, isChecked -> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index a77286ff33..5546db154c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -129,6 +129,30 @@ app:layout_constraintTop_toBottomOf="@id/tbRainMode" /> + + + + Date: Wed, 7 Dec 2022 13:59:51 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[2.13.0]fix=E6=B6=88=E6=81=AF=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E6=B0=94=E6=B3=A1=E7=8A=B6=E6=80=81=E4=B8=8B=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=BD=A6=E8=BE=86=E7=B3=BB=E7=BB=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5=E8=B6=85=E8=BF=87=E4=B8=80?= =?UTF-8?q?=E8=A1=8C=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/res/layout/item_msg_bubble_report.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml index 0b83bbd4c6..ac166a81cf 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml @@ -49,13 +49,17 @@ Date: Wed, 7 Dec 2022 14:25:57 +0800 Subject: [PATCH 3/4] =?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 = From c78509d484cf0e9c325aff492d11385f235716f7 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Wed, 7 Dec 2022 15:22:12 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[2.13.0][Fix]=E8=A7=A3=E5=86=B3=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9B=92=E5=AD=90=E8=BF=87=E6=9C=9F=E7=9A=84=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=B6=88=E6=81=AF=E6=9C=AA=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/main/MainMoGoApplication.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java index 7e5c962fbd..889febb1a4 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainMoGoApplication.java @@ -43,6 +43,7 @@ import com.zhjt.mogo_core_function_devatools.monitor.db.CpuInfo; import com.zhjt.mogo_core_function_devatools.monitor.db.MemInfo; import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb; +import java.io.File; import java.lang.reflect.Field; import java.text.SimpleDateFormat; import java.util.Date; @@ -101,15 +102,25 @@ public abstract class MainMoGoApplication extends AbsMogoApplication { new Thread(() -> { String lastLaunchTimeStr = SPUtils.getInstance().getString("last_launch", ""); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Date currDate = new Date(System.currentTimeMillis()); + String currTimeStr = format.format(currDate); if (lastLaunchTimeStr != null && !lastLaunchTimeStr.isEmpty()) { - Date currDate = new Date(System.currentTimeMillis()); - String currTimeStr = format.format(currDate); boolean isSameDay = currTimeStr.equals(lastLaunchTimeStr); // 超过一天需要清除消息盒子中的数据,并把时间戳存入SP if (!isSameDay) { - this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); + File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME); + if (file != null && file.exists()) { + this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); + } SPUtils.getInstance().put("last_launch", currTimeStr); } + } else { + // 首次使用App或中途仅删除sp文件 + File file = this.getDatabasePath(MsgBoxDb.INTERNAL_DB_NAME); + if (file != null && file.exists()) { + this.deleteDatabase(MsgBoxDb.INTERNAL_DB_NAME); + } + SPUtils.getInstance().put("last_launch", currTimeStr); } }).start(); }