diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/obu/V2xObuEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/obu/V2xObuEventManager.kt index a1153493fe..130cf0ef7a 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/obu/V2xObuEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/obu/V2xObuEventManager.kt @@ -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, diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index c752f5b45f..7f9651f0da 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -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) } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index 0c64d6a0b1..a4b0d19ddb 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -1037,8 +1037,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { ) } - private val ttsMap = mutableMapOf() - /** * 消息盒子对应消息的语音播报 */ @@ -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, diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt index c3dfb3780d..dfdec5e541 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt @@ -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) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/BadCaseManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/BadCaseManager.kt index 62501383b7..54de5f1730 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/BadCaseManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/BadCaseManager.kt @@ -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 */ diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt index 9daa99f962..ba157a1abd 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt @@ -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 } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt index 406fdd97ee..735db45a88 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt @@ -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() + /** * 不展示顶部弹窗,其它保留 */ @@ -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) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 8592c0bcb3..948d93eaec 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -33,6 +33,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private var data: ArrayList ?= 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) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index 95ea8caef9..b020fd0ee7 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -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) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ToolsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ToolsView.kt index a81a76c890..a765f0434a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ToolsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/ToolsView.kt @@ -55,7 +55,8 @@ class ToolsView private constructor() { } override fun showBadCaseManagerView() { - ToastUtils.showShort("代码合并中") + dismissToolsFloatView() + CallerDevaToolsManager.showBadCaseManagerView(it) } }) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt index de83239e19..a631acac8e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/LimitingVelocityView.kt @@ -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 = "" } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png new file mode 100644 index 0000000000..d1363d1a96 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_return.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png new file mode 100644 index 0000000000..1ba1c633ec Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation_stop.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml new file mode 100644 index 0000000000..dd210d1341 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_return.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml new file mode 100644 index 0000000000..bae20dc545 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation_stop.xml @@ -0,0 +1,54 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml new file mode 100644 index 0000000000..224dc865f1 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_return.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml new file mode 100644 index 0000000000..e6b647840f --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation_stop.xml @@ -0,0 +1,52 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java index 5f7b50180e..a4faef0d56 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/CircleQueue.java @@ -24,18 +24,10 @@ public class CircleQueue { objQueue.add(obj); } - public void deleteObj(ObjQueue obj) { - objQueue.remove(obj); - } - public List getLastThreeFrame() { return objQueue.subList(objQueue.size() - 3, objQueue.size()); } - public List getLastFiveFrame() { - return objQueue.subList(objQueue.size() - 5, objQueue.size()); - } - public List 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{" + diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java index 907f04ce8d..b4d2daa6c6 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackManager.java @@ -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 trafficDataUuid = new HashMap<>(); + private final ConcurrentHashMap 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(); } } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java index 0a1d3829b7..55ef457a88 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackObj.java @@ -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 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 + '}'; } diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt index 489cce927c..d530f02c48 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/TrackerSourceColorHelper.kt @@ -64,7 +64,7 @@ object TrackerSourceColorHelper { //僵尸车 if(data.addAttribute == AdditionalAttribute.ATTR_ZOMBIE){ - color = "#8F9AADFF" + color = "#AE7887FF" } // pnc预警 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt index 2d7a5c69a4..81f546cb3d 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/identify/WarningHelper.kt @@ -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() diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt index 5f7cca0772..0de776cdd9 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/IDevaToolsProvider.kt @@ -105,6 +105,11 @@ interface IDevaToolsProvider : IProvider { */ fun showFeedbackWindow(ctx: Context) + /** + * 展示录包管理页面 + */ + fun showBadCaseManagerView(context: Context) + /** * 下载指定包 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt index 6c9cab0897..91f1d0e9e8 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerDevaToolsManager.kt @@ -141,6 +141,13 @@ object CallerDevaToolsManager { devaToolsProviderApi?.showFeedbackWindow(ctx) } + /** + * 展示录包管理页面 + */ + fun showBadCaseManagerView(context: Context){ + devaToolsProviderApi?.showBadCaseManagerView(context) + } + /** * 下载指定包 */ diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java index 07ba7245d8..5fad00ad88 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/IMogoMap.java @@ -46,6 +46,11 @@ public interface IMogoMap { */ IMogoMarker addMarker(String tag, MogoMarkerOptions options); + /** + * 清除所有marker + */ + void clearAllMarkers(); + /** * 批量更新锚点位置 * diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java index 8e7e2db59f..f4c23bb89b 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java @@ -38,6 +38,11 @@ public interface IMogoMarkerManager { */ List addMarkers(String tag, ArrayList options, boolean moveToCenter); + /** + * 清除所有marker + */ + void clearAllMarker(); + /** * 批量更新锚点位置 * diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java index d471356be8..a517eca07a 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/AMapWrapper.java @@ -3,10 +3,10 @@ package com.mogo.map; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Point; +import android.util.Log; import android.util.Pair; import com.mogo.eagle.core.data.config.FunctionBuildConfig; -import com.mogo.eagle.core.data.map.MogoLatLng; import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger; import com.mogo.map.center.CenterLine; import com.mogo.map.marker.AMapInfoWindowAdapter; @@ -108,6 +108,13 @@ public class AMapWrapper implements IMogoMap { return mogoMarker; } + @Override + public void clearAllMarkers() { + if (sAMap != null) { + sAMap.clearAllMarkers(); + } + } + @SuppressLint("NewApi") @Override public void updateBatchMarkerPosition(HashMap optionsArrayList) { @@ -119,6 +126,9 @@ public class AMapWrapper implements IMogoMap { MarkerSimpleData markerOptions = ObjectUtils.fromTrafficData(trackedObject); if (markerOptions != null) { markerOptionsArrayList.add(markerOptions); + if(markerOptions.id == 65061){ + Log.i("emArrow","time :" + markerOptions.time + " , lat : " + markerOptions.lat + " , lon : " + markerOptions.lon); + } } }); long time = markerOptionsArrayList.get(0).getTime(); diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java index ceb1a65a6b..db9333517e 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java @@ -71,6 +71,15 @@ public class MogoMarkerManager implements IMogoMarkerManager { } } + @Override + public void clearAllMarker() { + try{ + MogoMap.getInstance().getMogoMap().clearAllMarkers(); + }catch (Exception e){ + e.printStackTrace(); + } + } + @Override public void updateBatchMarkerPosition(HashMap optionsArrayList) { try {