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/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 e9a90bfcc2..3ae36559da 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
@@ -45,6 +45,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;
@@ -103,15 +104,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();
}
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 @@
+
+
+
+
")
+ 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 =