Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0'

Dev arch opt 3.0

See merge request zhjt/AndroidApp/MoGoEagleEye!625
This commit is contained in:
wangmingjun
2023-02-27 12:52:01 +00:00
28 changed files with 469 additions and 82 deletions

View File

@@ -5,9 +5,12 @@ import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.obu.MogoObuConst
import com.mogo.eagle.core.function.api.obu.IMoGoObuSaveMessageListener
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.obu.CallerObuSaveMessageListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
/**
* 处理obu分发出来在消息盒子展示的消息
@@ -48,6 +51,7 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
obuDataMap[type] = System.currentTimeMillis()
}
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onMoGoObuSaveMessage type = $type ---content = $content ---tts = $tts ")
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,

View File

@@ -242,6 +242,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
when (status) {
// 添加
MogoObuConstants.STATUS.ADD -> {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(appId, alertContent, ttsContent)
showWarning(appId, alertContent, ttsContent, direction)
}
@@ -502,6 +505,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"${M_OBU}${TAG}",
"MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent "
)
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
}
@@ -539,6 +545,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
)
val maxSpeed = currentLight.suggestMaxSpeed * 3.6
if (maxSpeed > 0) {
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
return
}
saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent)
showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON)
}

View File

@@ -1037,8 +1037,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
)
}
private val ttsMap = mutableMapOf<String, Long>()
/**
* 消息盒子对应消息的语音播报
*/
@@ -1048,19 +1046,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
tts: String,
direction: WarningDirectionEnum
) {
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
if (ttsMap.containsKey(type)) {
var oldTime = ttsMap[type]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
ttsMap.remove(type)
ttsMap[type] = System.currentTimeMillis()
} else {
ttsMap[type] = System.currentTimeMillis()
}
CallerHmiManager.warningV2X(
type,
content,

View File

@@ -158,6 +158,10 @@ class DevaToolsProvider : IDevaToolsProvider {
BadCaseManager.showBadCaseConfigWindow(ctx)
}
override fun showBadCaseManagerView(context: Context) {
BadCaseManager.showBadCaseManagerWindow(context)
}
override fun downLoadPackage(downloadKey: String, downloadUrl: String) {
upgradeManager.downLoadPackage(mContext!!, downloadKey, downloadUrl)
}

View File

@@ -101,6 +101,22 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
}
}
/**
* 展示BadCase录包管理页面
*/
fun showBadCaseManagerWindow(context: Context){
val badCaseManagerView = BadCaseManagerView(context)
badCaseManagerView.setOnClickListener(object: BadCaseManagerView.ClickListener{
override fun onClose() {
hideFloat?.invoke()
hideFloat = null
}
})
context.enqueuePop(badCaseManagerView,AutoSizeUtils.dp2px(context,960f), WindowManager.LayoutParams.MATCH_PARENT, key = "BadCaseManagerView").also {
hideFloat = it
}
}
/**
* 主动采集BadCase
*/

View File

@@ -56,8 +56,6 @@ class BindingCarNetWorkManager private constructor() {
widevineIDWithMd5: String?,
screenType: Int
) {
// String macAddress1 = "48:b0:2d:4d:33:40";
// String sn = "X2020220417KA94QIN";
val request = BindingCarRequest(
macAddress,
widevineIDWithMd5,
@@ -152,12 +150,14 @@ class BindingCarNetWorkManager private constructor() {
}
private fun updateCarVrIconRes(brandId: String?) {
d(SceneConstant.M_BINDING + TAG, "CarModelChange : ${DebugConfig.isCarModelChange()}")
if(!DebugConfig.isCarModelChange()){
return
}
if (brandId == null || brandId.isEmpty()) {
return
}
d(SceneConstant.M_BINDING + TAG, "getDefaultId() : ${getDefaultId()} ---- brandId = $brandId")
if (getDefaultId() == brandId) {
return
}

View File

@@ -39,6 +39,7 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.service_biz.BizConfig
@@ -87,6 +88,8 @@ class MoGoHmiProvider : IMoGoHmiProvider {
)
}
private val ttsMap = mutableMapOf<String, Long>()
/**
* 不展示顶部弹窗,其它保留
*/
@@ -99,6 +102,19 @@ class MoGoHmiProvider : IMoGoHmiProvider {
direction: WarningDirectionEnum,
expireTime: Long
) {
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
if (ttsMap.containsKey(v2xType)) {
var oldTime = ttsMap[v2xType]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
ttsMap.remove(v2xType)
ttsMap[v2xType] = System.currentTimeMillis()
} else {
ttsMap[v2xType] = System.currentTimeMillis()
}
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "warningV2X v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ")
val playTTS = !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
context?.let {
val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType)

View File

@@ -33,6 +33,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
private var data: ArrayList<MsgBoxBean> ?= null
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 4
@@ -55,6 +57,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false)
return BubbleOperationHolder(view)
}
operationReturn -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_bubble_operation_return, parent, false)
return BubbleOperationReturnHolder(view)
}
operationStop -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_bubble_operation_stop, parent, false)
return BubbleOperationStopHolder(view)
}
report -> {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false)
return BubbleReportHolder(view)
@@ -87,6 +99,23 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
}
}
}
//运营平台还车通知
is BubbleOperationReturnHolder -> {
data?.let {
val operationReturnMsg = it[position].bean as OperationMsg
holder.tvOperationReturnContent.text = operationReturnMsg.content
holder.tvOperationReturnTime.text =
TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat())
}
}
//运营平台靠边停车
is BubbleOperationStopHolder -> {
data?.let {
val operationStopMsg = it[position].bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
}
}
is BubbleReportHolder -> {
data?.let {
val msgBoxBean = it[position]
@@ -187,7 +216,16 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
override fun getItemViewType(position: Int): Int {
return if(data!![position].type == MsgBoxType.OPERATION){
operation
if((data!![position].bean as OperationMsg).type == 0){
//运营平台还车通知
operationReturn
}else if((data!![position].bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
//普通运营平台
operation
}
}else if(data!![position].type == MsgBoxType.REPORT){
report
}else if(data!![position].type == MsgBoxType.NOTICE){
@@ -214,6 +252,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A
var clBubbleOperationLayout: RoundCanClickConstraintLayout = itemView.findViewById(R.id.clBubbleOperationLayout)
}
//运营平台还车通知
class BubbleOperationReturnHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime)
var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent)
}
//运营平台靠边停车通知
class BubbleOperationStopHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
}
//Notice
class BubbleNoticeHolder(itemView: View): RecyclerView.ViewHolder(itemView){
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -35,6 +35,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
private var reportBean: MsgBoxBean ?= null
private val operation: Int = 1
private val operationReturn: Int = 10
private val operationStop: Int = 11
private val notice: Int = 2
private val v2x: Int = 3
private val report: Int = 5
@@ -72,6 +74,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
.inflate(R.layout.item_msg_box_operation, parent, false)
return MsgBoxOperation(view)
}
operationReturn -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_operation_return, parent, false)
return MsgBoxOperationReturn(view)
}
operationStop -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_operation_stop, parent, false)
return MsgBoxOperationStop(view)
}
notice -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_msg_box_notice, parent, false)
@@ -244,6 +256,23 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
}
}
}
//运营平台还车通知
is MsgBoxOperationReturn -> {
data?.let {
val operationReturnMsg = it[position].bean as OperationMsg
holder.tvOperationReturnContent.text = operationReturnMsg.content
holder.tvOperationReturnTime.text =
TimeUtils.millis2String(operationReturnMsg.timestamp, getHourMinFormat())
}
}
//运营平台靠边停车
is MsgBoxOperationStop -> {
data?.let {
val operationStopMsg = it[position].bean as OperationMsg
holder.tvOperationStopTime.text =
TimeUtils.millis2String(operationStopMsg.timestamp, getHourMinFormat())
}
}
is MsgBoxNotice -> {
data?.let {
val noticeFrCloudMsg = it[position].bean as NoticeFrCloudMsg
@@ -314,7 +343,16 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
override fun getItemViewType(position: Int): Int {
return if (data!![position].type == MsgBoxType.OPERATION) {
operation
if((data!![position].bean as OperationMsg).type == 0){
//运营平台还车通知
operationReturn
}else if((data!![position].bean as OperationMsg).type == 1){
//运营平台靠边停车
operationStop
}else{
//普通运营平台
operation
}
} else if (data!![position].type == MsgBoxType.NOTICE) {
notice
} else if (data!![position].type == MsgBoxType.V2X && data!![position].sourceType == DataSourceType.SUMMARY) {
@@ -365,6 +403,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) :
var tvOperationContentOpen: TextView = itemView.findViewById(R.id.tvOperationContentOpen)
}
//运营平台还车通知
class MsgBoxOperationReturn(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationReturnTime: TextView = itemView.findViewById(R.id.tvOperationReturnTime)
var tvOperationReturnContent: TextView = itemView.findViewById(R.id.tvOperationReturnContent)
}
//运营平台靠边停车通知
class MsgBoxOperationStop(itemView: View) : RecyclerView.ViewHolder(itemView){
var tvOperationStopTime: TextView = itemView.findViewById(R.id.tvOperationStopTime)
}
//Notice
class MsgBoxNotice(itemView: View) : RecyclerView.ViewHolder(itemView) {
var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage)

View File

@@ -55,7 +55,8 @@ class ToolsView private constructor() {
}
override fun showBadCaseManagerView() {
ToastUtils.showShort("代码合并中")
dismissToolsFloatView()
CallerDevaToolsManager.showBadCaseManagerView(it)
}
})
}

View File

@@ -42,10 +42,10 @@ class LimitingVelocityView constructor(
if (limitingVelocity > 0) {
visibility = View.VISIBLE
tvLimitingVelocity.text = "$limitingVelocity"
tvLimitingSource.text = DataSourceType.getName(sourceType)
tvLimitingSource?.text = DataSourceType.getName(sourceType)
} else {
visibility = View.GONE
tvLimitingSource.text = ""
tvLimitingSource?.text = ""
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationReturnImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_return"
/>
<TextView
android:id="@+id/tvOperationReturnTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还车通知"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
app:layout_constraintLeft_toRightOf="@id/ivOperationReturnImage"
android:layout_marginStart="23dp"
/>
<TextView
android:id="@+id/tvOperationReturnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
android:textColor="#80FFFFFF"
android:textSize="24dp"
android:layout_marginEnd="25dp"
/>
<TextView
android:id="@+id/tvOperationReturnContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvOperationReturnTitle"
app:layout_constraintRight_toRightOf="@id/tvOperationReturnTime"
app:layout_constraintBottom_toBottomOf="@id/ivOperationReturnImage"
android:textColor="#B3FFFFFF"
android:textSize="28dp"
android:gravity="start"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationStopImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvOperationStopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationStopContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="@id/tvOperationStopTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
android:text="靠边停车"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clV2XLayout"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationReturnImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_return"
/>
<TextView
android:id="@+id/tvOperationReturnTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="还车通知"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
app:layout_constraintLeft_toRightOf="@id/ivOperationReturnImage"
android:layout_marginStart="23dp"
/>
<TextView
android:id="@+id/tvOperationReturnTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/ivOperationReturnImage"
android:textColor="#80FFFFFF"
android:textSize="24dp"
android:layout_marginEnd="25dp"
/>
<TextView
android:id="@+id/tvOperationReturnContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="@id/tvOperationReturnTitle"
app:layout_constraintRight_toRightOf="@id/tvOperationReturnTime"
app:layout_constraintBottom_toBottomOf="@id/ivOperationReturnImage"
android:textColor="#B3FFFFFF"
android:textSize="28dp"
android:gravity="start"
android:maxLines="1"
android:ellipsize="end"
/>
</com.mogo.eagle.core.widget.RoundConstraintLayout>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="804dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#53000000"
app:roundLayoutRadius="24dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:layout_marginBottom="7dp">
<ImageView
android:id="@+id/ivOperationStopImage"
android:layout_width="110dp"
android:layout_height="110dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:layout_marginStart="25dp"
android:src="@drawable/icon_msg_box_operation_stop"
/>
<TextView
android:id="@+id/tvOperationStopTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginEnd="25dp"
android:textColor="#80FFFFFF"
android:textSize="24dp"
/>
<TextView
android:id="@+id/tvOperationStopContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintLeft_toRightOf="@id/ivOperationStopImage"
app:layout_constraintRight_toRightOf="@id/tvOperationStopTime"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginStart="25dp"
android:textColor="#FFFFFFFF"
android:textSize="32dp"
android:maxLines="1"
android:ellipsize="end"
android:text="靠边停车"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -24,18 +24,10 @@ public class CircleQueue {
objQueue.add(obj);
}
public void deleteObj(ObjQueue obj) {
objQueue.remove(obj);
}
public List<ObjQueue> getLastThreeFrame() {
return objQueue.subList(objQueue.size() - 3, objQueue.size());
}
public List<ObjQueue> getLastFiveFrame() {
return objQueue.subList(objQueue.size() - 5, objQueue.size());
}
public List<ObjQueue> getPreFrame() {
return objQueue.subList(0, objQueue.size());
}
@@ -44,6 +36,10 @@ public class CircleQueue {
return objQueue.lastElement();
}
public void clear(){
objQueue.clear();
}
@Override
public String toString() {
return "CircleQueue{" +

View File

@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.business.identify;
import android.annotation.SuppressLint;
import android.os.Build;
import android.util.Log;
import androidx.annotation.RequiresApi;
@@ -50,7 +51,7 @@ public class TrackManager {
* 记录每次实际绘制的交通元素UUID
*/
@SuppressLint("NewApi")
private final HashMap<String, Long> trafficDataUuid = new HashMap<>();
private final ConcurrentHashMap<String, Long> trafficDataUuid = new ConcurrentHashMap<>();
/**
* 过滤后的数据集合
@@ -101,7 +102,7 @@ public class TrackManager {
trackObj = cacheTrack;
MessagePad.TrackedObject cache = cacheTrack.getCache();
if (cache != null) {
//相对静止物体并且非obu数据则不改变感知融合同位置物体,使用缓存数据做覆盖
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
if (cacheTrack.relativeStatic()) {
if (data.getColor() != null && !data.getColor().isEmpty()) {
cache = cache.toBuilder().setColor(data.getColor()).build();
@@ -112,10 +113,10 @@ public class TrackManager {
uuid = findSameValue;
trackObj.updateObj(data);
} else {
trackObj = new TrackObj(data);
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
} else {
trackObj = new TrackObj(data);
trackObj = new TrackObj(data,s2CellId,s2LatLng);
}
}
mFilterTrafficData.put(uuid, trackObj.getCache());
@@ -150,17 +151,23 @@ public class TrackManager {
}
public synchronized void removeKey(String key) {
mMarkersCaches.remove(key);
cellIdCaches.remove(key);
mMarkersCaches.remove(key);
WarningHelper.INSTANCE.remove(key);
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
.removeMarker(key);
}
@SuppressLint("NewApi")
public void clearAll() {
MogoMarkerManager.getInstance(AbsMogoApplication.getApp()).clearAllMarker();
cellIdCaches.clear();
trafficDataUuid.clear();
WarningHelper.INSTANCE.clear();
mMarkersCaches.forEach((uuid, trackObj) -> removeKey(uuid));
mMarkersCaches.forEach((uuid, trackObj) -> {
trackObj.clear();
});
mMarkersCaches.clear();
}
}

View File

@@ -5,8 +5,6 @@ import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_
import android.annotation.SuppressLint;
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
@@ -22,26 +20,18 @@ public class TrackObj {
private final CircleQueue circleQueue = new CircleQueue(6);
private S2CellId s2CellId; //s2 id权重
private S2LatLng s2LatLng; //s2 经纬度
private double recentlyTime; //用于缓存帧数判断暂定缓存1秒数据中间如果有物体未出现1秒后删除
private double roadAngle; //道路航向
private int[] typeArray = new int[3];
private int typeWeight; //类型权重
private double lat;
private double lon;
private double speedAverage;
public TrackObj(MessagePad.TrackedObject data) {
public TrackObj(MessagePad.TrackedObject data, S2CellId cellId, S2LatLng latLng) {
circleQueue.addQueue(new ObjQueue(data.getHeading(), data.getSpeed(), data.getLatitude(), data.getLongitude(), data.getType()));
recentlyTime = data.getSatelliteTime();
lat = data.getLatitude();
lon = data.getLongitude();
s2LatLng = S2LatLng.fromDegrees(data.getLatitude(), data.getLongitude());
s2CellId = S2CellId.fromLatLng(s2LatLng).parent(22); //需要验证22前后
CenterLine centerLine = CallerMapUIServiceManager.INSTANCE.getMapUIController().getCenterLineInfo(lon, lat, -1);
if (centerLine != null && centerLine.getAngle() != 0) {
roadAngle = centerLine.getAngle();
}
s2LatLng = latLng;
s2CellId = cellId; //需要验证22前后
}
private MessagePad.TrackedObject cacheData;
@@ -50,14 +40,12 @@ public class TrackObj {
public void updateObj(MessagePad.TrackedObject data) {
cacheData = data;
correct();
recentlyTime = data.getSatelliteTime();
circleQueue.addQueue(new ObjQueue(cacheData.getHeading(), cacheData.getSpeed(), data.getLatitude(), data.getLongitude(), data.getType()));
}
private void correct() {
calAverageSpeedAndType();
calLoc();
// calHeading();
}
@SuppressLint("NewApi")
@@ -80,8 +68,10 @@ public class TrackObj {
}
speedAverage = cal / objQueueList.size();
}
typeArray = Arrays.stream(typeArray).sorted().toArray();
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
if(typeArray.length > 0){
typeArray = Arrays.stream(typeArray).sorted().toArray();
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
}
// 重新给静止物体赋值速度
if (relativeStatic()) {
@@ -105,26 +95,6 @@ public class TrackObj {
}
}
private void calHeading() {
//更正数据,速度小于LIMIT_SPEED使用上一帧数据
// if (relativeStatic()) {
// if (roadAngle != 0.0) {
// CenterLine centerLine = CallerHDMapManager.INSTANCE.getCenterLineInfo(lon, lat, -1);
// if (centerLine != null && centerLine.getAngle() != 0) {
// cacheData = cacheData.toBuilder().setHeading(centerLine.getAngle()).build();
// } else {
// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build();
// }
// } else {
// cacheData = cacheData.toBuilder().setHeading(circleQueue.getLastFrame().getHeading()).build();
// }
// }
}
public double getRecentlyTime() {
return recentlyTime;
}
public long getCellIdPos() {
return s2CellId.pos();
}
@@ -167,12 +137,6 @@ public class TrackObj {
}
}
public boolean isFourWheelType() {
return typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE.getType()
&& typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_BICYCLE.getType()
&& typeWeight != TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO.getType();
}
private double[] getCenterPoint(List<ObjQueue> objQueueList) {
int total = objQueueList.size();
double X = 0, Y = 0, Z = 0;
@@ -202,12 +166,18 @@ public class TrackObj {
return d;
}
public void clear(){
circleQueue.clear();
s2CellId = null;
s2LatLng = null;
typeArray = null;
}
@Override
public String toString() {
return "TrackObj{" +
"circleQueue=" + circleQueue +
", s2CellId=" + s2CellId +
", recentlyTime=" + recentlyTime +
", cacheData=" + cacheData +
'}';
}

View File

@@ -64,7 +64,7 @@ object TrackerSourceColorHelper {
//僵尸车
if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){
color = "#8F9AADFF"
color = "#AE7887FF"
}
// pnc预警

View File

@@ -139,6 +139,12 @@ object WarningHelper {
}
}
fun remove(key:String){
pncWarningBeautyTrafficData.remove(key)
pncWarningOriginTrafficData.remove(key)
obuWarningTrafficData.remove(key)
}
fun clear() {
pncWarningBeautyTrafficData.clear()
pncWarningOriginTrafficData.clear()