Merge branch 'dev_robotaxi-d-app-module_2130_221116_2.13.0' into mutidev_robotaxi-d-app-module_2130_221116_2.13.0_multi_display

This commit is contained in:
donghongyu
2022-12-07 16:30:42 +08:00
6 changed files with 88 additions and 25 deletions

View File

@@ -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 ->

View File

@@ -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();
}

View File

@@ -49,13 +49,17 @@
<TextView
android:id="@+id/tvBubbleReportType"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tvBubbleReportTime"
app:layout_constraintLeft_toLeftOf="@id/tvBubbleReportTime"
app:layout_constraintRight_toRightOf="@id/tvBubbleReceiveTime"
android:layout_marginTop="5px"
android:textColor="#B3FFFFFF"
android:textSize="28px"
android:maxLines="1"
android:ellipsize="end"
android:gravity="start"
/>
<TextView

View File

@@ -129,6 +129,30 @@
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
/>
<ToggleButton
android:id="@+id/tbObuWeaknessTrafficSop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
app:layout_constraintTop_toBottomOf="@id/tbObu"
android:textOff="关闭路侧弱势群体预警"
android:textOn="打开路侧弱势群体预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbCloudWeaknessTrafficSop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:padding="@dimen/dp_20"
android:background="@drawable/radio_button_normal_background_right"
app:layout_constraintTop_toBottomOf="@id/tbObuWeaknessTrafficSop"
android:textOff="开启云端弱势群体预警"
android:textOn="关闭云端弱势群体预警"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbIPCReport"
android:layout_width="match_parent"
@@ -140,7 +164,7 @@
android:textOff="开启异常上报提示"
android:textOn="关闭异常上报提示"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObu"
app:layout_constraintTop_toBottomOf="@id/tbCloudWeaknessTrafficSop"
/>
<TextView

View File

@@ -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";

View File

@@ -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<SpatLight>) {
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 =