diff --git a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt index e691962e86..ec5ad32669 100644 --- a/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt +++ b/core/function-impl/mogo-core-function-check/src/main/java/com/mogo/eagle/core/function/report/IPCReportManager.kt @@ -51,41 +51,52 @@ class IPCReportManager : IMoGoAutopilotStatusListener { */ override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) { guardianInfo?.let{ - //Error 弹窗并有提示音 if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE) || it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED) - || it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){ - if(ipcErrorReportList.size>19){ - ipcErrorReportList.removeLast() - } + || it.resultList.contains(RESULT_REMOTEPILOT_DISABLE) + || it.resultList.contains(RESULT_AUTOPILOT_INFERIOR) + || it.resultList.contains(RESULT_SHOW_WARNING) + || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){ val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), it.src,it.level,it.msg,it.code,it.resultList,it.actionsList) CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity)) - ipcErrorReportList.add(0, reportEntity) - //当前不处于美化模式时,展示监控节点上报 - if(!FunctionBuildConfig.isDemoMode){ - if(FunctionBuildConfig.isReportWarning){ - CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,1) - } - } - } - //Warning 不弹窗也不会有提示音 - else if(it.resultList.contains(RESULT_AUTOPILOT_INFERIOR) - || it.resultList.contains(RESULT_SHOW_WARNING) - || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){ - if(ipcWarningReportList.size>19){ - ipcWarningReportList.removeLast() - } - ipcWarningReportList.add(0, - ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), - it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)) - //当前不处于美化模式时,展示监控节点上报 - if(!FunctionBuildConfig.isDemoMode){ - if(FunctionBuildConfig.isReportWarning){ - CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,2) - } - } } + +// //Error 弹窗并有提示音 +// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE) +// || it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED) +// || it.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){ +// if(ipcErrorReportList.size>19){ +// ipcErrorReportList.removeLast() +// } +// val reportEntity = ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), +// it.src,it.level,it.msg,it.code,it.resultList,it.actionsList) +//// CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity)) +// ipcErrorReportList.add(0, reportEntity) +// //当前不处于美化模式时,展示监控节点上报 +// if(!FunctionBuildConfig.isDemoMode){ +// if(FunctionBuildConfig.isReportWarning){ +// CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,1) +// } +// } +// } +// //Warning 不弹窗也不会有提示音 +// else if(it.resultList.contains(RESULT_AUTOPILOT_INFERIOR) +// || it.resultList.contains(RESULT_SHOW_WARNING) +// || it.resultList.contains(RESULT_REMOTEPILOT_INFERIOR)){ +// if(ipcWarningReportList.size>19){ +// ipcWarningReportList.removeLast() +// } +// ipcWarningReportList.add(0, +// ReportEntity(TimeUtils.millis2String(System.currentTimeMillis()), +// it.src,it.level,it.msg,it.code,it.resultList,it.actionsList)) +// //当前不处于美化模式时,展示监控节点上报 +// if(!FunctionBuildConfig.isDemoMode){ +// if(FunctionBuildConfig.isReportWarning){ +// CallerHmiManager.showIPCReportWindow(ipcErrorReportList,ipcWarningReportList,2) +// } +// } +// } } } 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 119b51b41e..5ba5156aad 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 @@ -94,8 +94,8 @@ class DevaToolsProvider : IDevaToolsProvider { BadCaseManager.initAiCollect(view) } - override fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) { - BadCaseManager.onReceiveBadCaseRecord(record,activity) + override fun onReceiveBadCaseRecord(recordKey: Long,fileName: String,activity: Activity) { + BadCaseManager.onReceiveBadCaseRecord(recordKey, fileName, activity) } override fun showFeedbackWindow(ctx: Context) { 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 1b65d8c4ce..77f3c3672d 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 @@ -168,13 +168,13 @@ internal object BadCaseManager : LifecycleEventObserver { } } - fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) { + fun onReceiveBadCaseRecord(recordKey: Long,fileName: String,activity: Activity) { CallerLogger.d("$M_DEVA$TAG", "收到录包结果回调${record}") CallerLogger.d("$M_DEVA$TAG", "开始创建被动录包弹窗,window num=${BadCaseConfig.windowNum}") - CallerLogger.d("$M_DEVA$TAG","key=${record.key};filename${record.filename}") + CallerLogger.d("$M_DEVA$TAG","key=${recordKey};filename${fileName}") ThreadUtils.runOnUiThread { val passiveBadCaseWindow = PassiveBadCaseWindow(activity) - passiveBadCaseWindow.setRecord(record.key.toString(),record.filename) + passiveBadCaseWindow.setRecord(recordKey.toString(),fileName) passiveBadCaseWindow.setClickListener(object: PassiveBadCaseWindow.ClickListener{ override fun closeWindow() { passiveBadCaseWindow.hideFloatWindow() diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt index ff83556e2b..f97420f379 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/PassiveBadCaseWindow.kt @@ -307,7 +307,7 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene SizeUtils.dp2px(10f), SizeUtils.dp2px(10f), SizeUtils.dp2px(10f)) - checkBox.textSize = AutoSizeUtils.dp2px(mActivity,34f).toFloat() + checkBox.textSize = AutoSizeUtils.dp2px(mActivity,18f).toFloat() checkBox.text = it.reason checkBox.isChecked = it.isChecked checkBox.setOnCheckedChangeListener(this@PassiveBadCaseWindow) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index 5844a486fa..736f671801 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -296,6 +296,17 @@ class MoGoHmiFragment : MvpFragment(), } } } + + cbMsgBox.setOnCheckedChangeListener { _, isChecked -> + if(isChecked){ + viewDriverMsgBoxList.visibility = View.VISIBLE + viewDriverMsgBoxBubble.visibility = View.GONE + }else{ + viewDriverMsgBoxList.visibility = View.GONE + viewDriverMsgBoxBubble.visibility = View.VISIBLE + } + } + } @OptIn(ExperimentalCoroutinesApi::class) @@ -323,14 +334,6 @@ class MoGoHmiFragment : MvpFragment(), override fun onAutopilotRecordResult(recordPanel: RecordPanelOuterClass.RecordPanel) { CallerLogger.d("$M_HMI$TAG", "recordKey=${recordPanel.key},stat=${recordPanel.stat}") - CallerMsgBoxManager.saveMsgBox( - MsgBoxBean( - MsgBoxType.RECORD, RecordBagMsg( - recordPanel.key, recordPanel.stat, recordPanel.id, - recordPanel.type, recordPanel.filename, recordPanel.note - ) - ) - ) if (BadCaseConfig.recordKeyList.contains(recordPanel.key)) { if (recordPanel.stat == 100 || recordPanel.stat == 101) { //成功结束录制 @@ -369,7 +372,14 @@ class MoGoHmiFragment : MvpFragment(), if (!FunctionBuildConfig.isDemoMode && (recordPanel.stat == 100 || recordPanel.stat == 101) && recordPanel.type != 2) { //只在司机屏生效,乘客屏不生效 if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - activity?.let { CallerDevaToolsManager.onReceiveBadCaseRecord(recordPanel, it) } + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.RECORD, RecordBagMsg( + recordPanel.key, recordPanel.stat, recordPanel.id, + recordPanel.type, recordPanel.filename, recordPanel.note + ) + ) + ) } } if (!FunctionBuildConfig.isDemoMode && recordPanel.type == 2 && ( diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt new file mode 100644 index 0000000000..e0b3932da4 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxBubbleView.kt @@ -0,0 +1,74 @@ +package com.mogo.eagle.core.function.hmi.ui.msgbox + +import android.content.Context +import android.util.AttributeSet +import android.util.Log +import android.view.LayoutInflater +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.recyclerview.widget.LinearLayoutManager +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.MsgCategory +import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxBubbleAdapter +import kotlinx.android.synthetic.main.layout_driver_msg_box_bubble.view.* + +/** + * @author XuXinChao + * @description 司机端消息盒子气泡视图 + * @since: 2022/11/25 + */ +class DriverMsgBoxBubbleView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr), IMsgBoxListener { + + init { + LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_bubble, this, true) + initView() + } + + var driverMsgBoxBubbleAdapter: DriverMsgBoxBubbleAdapter ?=null + + private val TAG = "DriverMsgBoxBubbleView" + + private fun initView() { + val linearLayoutManager = LinearLayoutManager(context) + linearLayoutManager.orientation = LinearLayoutManager.VERTICAL + linearLayoutManager.stackFromEnd = true + linearLayoutManager.reverseLayout = true + driverMsgBoxBubbleAdapter = DriverMsgBoxBubbleAdapter() + rvBubbleList.adapter = driverMsgBoxBubbleAdapter + rvBubbleList.layoutManager = linearLayoutManager + } + + override fun onDataChanged(category: MsgCategory, msgBoxList: MsgBoxBean) { + + } + + override fun onAttachedToWindow() { + super.onAttachedToWindow() + CallerMsgBoxListenerManager.addListener(TAG,this) + } + + override fun onDetachedFromWindow() { + super.onDetachedFromWindow() + CallerMsgBoxListenerManager.removeListener(TAG) + } + +// fun setData(){ +// val list :ArrayList = ArrayList() +// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) +// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) +// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"测试")) +// list.add(one) +// list.add(two) +// list.add(three) +// driverMsgBoxBubbleAdapter?.setData(list) +// } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt new file mode 100644 index 0000000000..fb593778d9 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/DriverMsgBoxListView.kt @@ -0,0 +1,154 @@ +package com.mogo.eagle.core.function.hmi.ui.msgbox + +import android.app.Activity +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.recyclerview.widget.LinearLayoutManager +import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.data.msgbox.RecordBagMsg +import com.mogo.eagle.core.data.notice.NoticeNormalData +import com.mogo.eagle.core.data.report.ReportEntity +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.function.hmi.ui.msgbox.adapter.DriverMsgBoxListAdapter +import kotlinx.android.synthetic.main.layout_driver_msg_box_list.view.* + +/** + * @author XuXinChao + * @description 司机端消息盒子打开列表视图 + * @since: 2022/11/25 + */ +class DriverMsgBoxListView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr){ + + init { + LayoutInflater.from(context).inflate(R.layout.layout_driver_msg_box_list, this, true) + initView() + } + + private fun initView() { + val driverMsgBoxListAdapter= DriverMsgBoxListAdapter(context as Activity) + rvMsgBoxList.adapter = driverMsgBoxListAdapter + rvMsgBoxList.layoutManager = LinearLayoutManager(context) + + //通知 + tvMsgNotice.setOnClickListener { + tvMsgNotice.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) + viewNoticeDivider.visibility = View.VISIBLE + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.GONE + //获取通知消息列表 + val noticeList: List? = CallerMsgBoxManager.getCachedNotifyData() + +// val nList: ArrayList = ArrayList() +// val one = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知1",2)) +// val two = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知2",2)) +// val three = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知3",2)) +// val four = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知4",2)) +// val five = MsgBoxBean(MsgBoxType.OPERATION, OperationMsg(System.currentTimeMillis(),"通知5",2)) +// val normalData = NoticeNormalData() +// normalData.content = "测试数据" +// val six = MsgBoxBean(MsgBoxType.NOTICE, normalData) +// +// nList.add(one) +// nList.add(two) +// nList.add(three) +// nList.add(four) +// nList.add(five) +// nList.add(six) +// driverMsgBoxListAdapter.setData(nList) + } + //车辆系统信息 + tvMsgIpcReport.setOnClickListener { + tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(resources.getColor(R.color.msg_box_title_color)) + tvMsgBadCase.setTextColor(resources.getColor(R.color.color_FFFFFF)) + viewNoticeDivider.visibility = View.GONE + viewIpcReportDivider.visibility = View.VISIBLE + viewBadCaseDivider.visibility = View.GONE + + //获取车辆系统信息列表 + val ipcReportList: List? = CallerMsgBoxManager.getCachedSysInfoData() + +// val ipcList: ArrayList = ArrayList() +// val resultList:ArrayList = ArrayList() +// resultList.add("RESULT_AUTOPILOT_DISABLE") +// val result:ArrayList = ArrayList() +// result.add("RESULT_AUTOPILOT_INFERIOR") +// val one = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败1","code", +// resultList,resultList) +// val beanOne = MsgBoxBean(MsgBoxType.REPORT,one) +// beanOne.timestamp = System.currentTimeMillis() +// val two = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败2","code", +// resultList,resultList) +// val beanTwo = MsgBoxBean(MsgBoxType.REPORT,two) +// beanTwo.timestamp = System.currentTimeMillis() +// val three = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败3","code", +// resultList,resultList) +// val beanThree = MsgBoxBean(MsgBoxType.REPORT,three) +// beanThree.timestamp = System.currentTimeMillis() +// val four = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败4","code", +// resultList,resultList) +// val beanFour = MsgBoxBean(MsgBoxType.REPORT,four) +// beanFour.timestamp = System.currentTimeMillis() +// val five = ReportEntity(System.currentTimeMillis().toString(),"","","自动驾驶失败5","code", +// result,result) +// val beanFive = MsgBoxBean(MsgBoxType.REPORT,five) +// beanFive.timestamp = System.currentTimeMillis() +// ipcList.add(beanOne) +// ipcList.add(beanTwo) +// ipcList.add(beanThree) +// ipcList.add(beanFour) +// ipcList.add(beanFive) +// driverMsgBoxListAdapter.setData(ipcList) + } + //录包 + tvMsgBadCase.setOnClickListener { + tvMsgNotice.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgIpcReport.setTextColor(resources.getColor(R.color.color_FFFFFF)) + tvMsgBadCase.setTextColor(resources.getColor(R.color.msg_box_title_color)) + viewNoticeDivider.visibility = View.GONE + viewIpcReportDivider.visibility = View.GONE + viewBadCaseDivider.visibility = View.VISIBLE + + //获取录包信息列表 +// val badCaseList: List? = CallerMsgBoxManager.getCachedRecordBagData() +// badCaseList?.let { +// driverMsgBoxListAdapter.setData(it) +// } + +// val list : ArrayList = ArrayList() +// val one = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"","")) +// one.timestamp = System.currentTimeMillis() +// val two = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"","")) +// two.timestamp = System.currentTimeMillis() +// val three = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"","")) +// three.timestamp = System.currentTimeMillis() +// val four = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"","")) +// four.timestamp = System.currentTimeMillis() +// val five = MsgBoxBean(MsgBoxType.RECORD, RecordBagMsg(3457774,1,235,2,"","")) +// five.timestamp = System.currentTimeMillis() +// +// list.add(one) +// list.add(two) +// list.add(three) +// list.add(four) +// list.add(five) +// driverMsgBoxListAdapter.setData(list) + } + + } + + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..9fb3bd89d2 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -0,0 +1,116 @@ +package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter + +import android.os.CountDownTimer +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.recyclerview.widget.RecyclerView +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.data.report.ReportEntity +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.util.TimeUtils +import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat + +/** + * @author XuXinChao + * @description 司机端消息盒子气泡视图RecyclerView适配器 + * @since: 2022/11/25 + */ +class DriverMsgBoxBubbleAdapter : RecyclerView.Adapter(){ + + private var data: ArrayList ?= null + + private val operation: Int = 1 + private val notice: Int = 2 + private val v2x: Int = 3 + private val obu: Int = 4 + private val report: Int = 5 + private val record: Int = 6 + private val traffic: Int = 7 + + var countDownTimer: CountDownTimer?=null + + fun setData(data: ArrayList){ + this.data = data + notifyDataSetChanged() + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { + if(viewType == operation){ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_operation,parent,false) + return BubbleOperationHolder(view) + }else{ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_report,parent,false) + return BubbleReportHolder(view) + } + } + + override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + if(holder is BubbleOperationHolder){ + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvBubbleOperationTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBubbleOperationContent.text = operationMsg.content + } + }else if(holder is BubbleReportHolder){ + data?.let { + val reportEntity = it[position].bean as ReportEntity + holder.tvBubbleReportTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvBubbleReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + var resultStr = "类型:" + for (result in reportEntity.resultList){ + resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + } + holder.tvBubbleReportType.text = resultStr + } + } + + val msgBoxBean: MsgBoxBean = data!![position] + countDownTimer =object: CountDownTimer(CallerMsgBoxManager.getDismissTime(),1000){ + override fun onTick(p0: Long) { + + } + + override fun onFinish() { + data?.remove(msgBoxBean) + notifyDataSetChanged() +// notifyItemRemoved(index) +// notifyItemRangeChanged(index,recordTypeEntity.size-index) + } + + } + countDownTimer?.start() + + } + + override fun getItemCount() = data?.size ?: 0 + + override fun getItemViewType(position: Int): Int { + if(data!![position].type == MsgBoxType.OPERATION){ + return operation + }else{ + return report + } + } + + //车辆系统信息 + class BubbleReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvBubbleReportTime: TextView = itemView.findViewById(R.id.tvBubbleReportTime) + var tvBubbleReportType: TextView = itemView.findViewById(R.id.tvBubbleReportType) + var tvBubbleReceiveTime: TextView = itemView.findViewById(R.id.tvBubbleReceiveTime) + } + + //运营平台 + class BubbleOperationHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvBubbleOperationTime: TextView = itemView.findViewById(R.id.tvBubbleOperationTime) + var tvBubbleOperationContent: TextView = itemView.findViewById(R.id.tvBubbleOperationContent) + } + + + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..10068108a7 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -0,0 +1,230 @@ +package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter + +import android.annotation.SuppressLint +import android.app.Activity +import android.util.Log +import android.view.LayoutInflater +import android.view.MenuItem +import android.view.View +import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView +import androidx.core.view.isVisible +import androidx.recyclerview.widget.RecyclerView +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.OperationMsg +import com.mogo.eagle.core.data.msgbox.RecordBagMsg +import com.mogo.eagle.core.data.notice.NoticeNormalData +import com.mogo.eagle.core.data.report.ReportEntity +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.hmi.R +import com.mogo.eagle.core.utilcode.util.ResourceUtils.getDrawable +import com.mogo.eagle.core.utilcode.util.TimeUtils +import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat +import com.mogo.eagle.core.widget.RoundConstraintLayout + +/** + * @author XuXinChao + * @description 司机端消息盒子列表视图RecyclerView适配器 + * @since: 2022/11/25 + */ +class DriverMsgBoxListAdapter(private val activity: Activity) : RecyclerView.Adapter(){ + + private var data: List ?= null + + private val operation: Int = 1 + private val notice: Int = 2 + private val v2x: Int = 3 + private val obu: Int = 4 + private val report: Int = 5 + private val record: Int = 6 + private val traffic: Int = 7 + + //Error + val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE" + val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED" + val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE" + + fun setData(data: List){ + this.data = data + notifyDataSetChanged() + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { + if(viewType == record){ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_bad_case,parent,false) + return BadCaseHolder(view) + }else if(viewType == report){ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_ipc_report,parent,false) + return MsgBoxIpcReportHolder(view) + }else if(viewType == operation){ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_operation,parent,false) + return MsgBoxOperation(view) + }else{ + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_box_notice,parent,false) + return MsgBoxNotice(view) + } + } + + @SuppressLint("SetTextI18n") + override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { + if(holder is BadCaseHolder){ + data?.let { + holder.tvBagReceiveTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvBagRecordTime.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + val recordBagMsg = (it[position].bean as RecordBagMsg) + holder.tvRecordCheck.setOnClickListener { + //打开被动录包弹窗 + CallerDevaToolsManager.onReceiveBadCaseRecord(recordBagMsg.key,recordBagMsg.fileName,activity) + } + } + }else if(holder is MsgBoxIpcReportHolder){ + data?.let { it -> + holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + val reportEntity = (it[position].bean as ReportEntity) + if(reportEntity.resultList.contains(RESULT_AUTOPILOT_DISABLE) + || reportEntity.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED) + || reportEntity.resultList.contains(RESULT_REMOTEPILOT_DISABLE)){ + //Error + holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_error_normal)) + holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_error_open)) + holder.tvReportLevelNormal.text = "Error" + holder.tvReportLevelOpen.text = "Error" + }else{ + //Warning + holder.ivReportImageNormal.setImageDrawable(getDrawable(R.drawable.icon_report_warning_normal)) + holder.ivReportImageOpen.setImageDrawable(getDrawable(R.drawable.icon_report_warning_open)) + holder.tvReportLevelNormal.text = "Warning" + holder.tvReportLevelOpen.text = "Warning" + } + holder.tvReportTimeNormal.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + holder.tvReportTimeOpen.text = "时间:${TimeUtils.millis2String(it[position].timestamp)}" + var resultStr = "类型:" + for (result in reportEntity.resultList){ + resultStr = "${resultStr}${CallerAutoPilotManager.getReportResultDesc(result)}" + } + holder.tvReportTypeNormal.text = resultStr + holder.tvReportTypeOpen.text = resultStr + holder.tvReportReasonOpen.text = "原因:${reportEntity.msg}" + holder.tvStatusSelect.setOnClickListener { + if(holder.tvReportLevelNormal.isVisible){ + holder.ivReportImageNormal.visibility = View.GONE + holder.tvReportLevelNormal.visibility = View.GONE + holder.tvReportTimeNormal.visibility = View.GONE + holder.tvReportTypeNormal.visibility = View.GONE + + holder.ivReportImageOpen.visibility = View.VISIBLE + holder.tvReportLevelOpen.visibility = View.VISIBLE + holder.tvReportTimeOpen.visibility = View.VISIBLE + holder.tvReportTypeOpen.visibility = View.VISIBLE + holder.tvReportReasonOpen.visibility = View.VISIBLE + }else{ + holder.ivReportImageNormal.visibility = View.VISIBLE + holder.tvReportLevelNormal.visibility = View.VISIBLE + holder.tvReportTimeNormal.visibility = View.VISIBLE + holder.tvReportTypeNormal.visibility = View.VISIBLE + + holder.ivReportImageOpen.visibility = View.GONE + holder.tvReportLevelOpen.visibility = View.GONE + holder.tvReportTimeOpen.visibility = View.GONE + holder.tvReportTypeOpen.visibility = View.GONE + holder.tvReportReasonOpen.visibility = View.GONE + } + } + } + }else if(holder is MsgBoxOperation){ + data?.let { + val operationMsg = it[position].bean as OperationMsg + holder.tvOperationContentNormal.text = operationMsg.content + holder.tvOperationContentOpen.text = operationMsg.content + holder.tvOperationTime.text = TimeUtils.millis2String(operationMsg.timestamp,getHourMinFormat()) + holder.tvOperationStatusSelect.setOnClickListener { + if(holder.ivOperationImageNormal.isVisible){ + holder.ivOperationImageNormal.visibility = View.GONE + holder.tvOperationTitleNormal.visibility = View.GONE + holder.tvOperationContentNormal.visibility = View.GONE + + holder.ivOperationImageOpen.visibility = View.VISIBLE + holder.tvOperationTitleOpen.visibility = View.VISIBLE + holder.tvOperationContentOpen.visibility = View.VISIBLE + }else{ + holder.ivOperationImageNormal.visibility = View.VISIBLE + holder.tvOperationTitleNormal.visibility = View.VISIBLE + holder.tvOperationContentNormal.visibility = View.VISIBLE + + holder.ivOperationImageOpen.visibility = View.GONE + holder.tvOperationTitleOpen.visibility = View.GONE + holder.tvOperationContentOpen.visibility = View.GONE + } + } + } + }else if(holder is MsgBoxNotice){ + data?.let { + val noticeNormalData = it[position].bean as NoticeNormalData + holder.tvNoticeTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + holder.tvNoticeContent.text = noticeNormalData.content + } + } + } + + override fun getItemCount() = data?.size ?: 0 + + + override fun getItemViewType(position: Int): Int { + return when(data!![position].type){ + MsgBoxType.OPERATION -> operation + MsgBoxType.NOTICE -> notice + MsgBoxType.V2X -> v2x + MsgBoxType.OBU -> obu + MsgBoxType.REPORT -> report + MsgBoxType.RECORD -> record + MsgBoxType.TRAFFIC -> traffic + } + } + + //录包实体 + class BadCaseHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var tvBagRecordTime: TextView= itemView.findViewById(R.id.tvBagRecordTime) + var tvBagReceiveTime: TextView = itemView.findViewById(R.id.tvBagReceiveTime) + var tvRecordCheck: TextView = itemView.findViewById(R.id.tvRecordCheck) + } + + //车辆系统信息 + class MsgBoxIpcReportHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivReportImageNormal: ImageView = itemView.findViewById(R.id.ivReportImageNormal) + var tvReportLevelNormal: TextView = itemView.findViewById(R.id.tvReportLevelNormal) + var tvReportTimeNormal: TextView = itemView.findViewById(R.id.tvReportTimeNormal) + var tvReportTypeNormal: TextView = itemView.findViewById(R.id.tvReportTypeNormal) + var tvStatusSelect: TextView = itemView.findViewById(R.id.tvStatusSelect) + var ivReportImageOpen: ImageView = itemView.findViewById(R.id.ivReportImageOpen) + var tvReportLevelOpen: TextView = itemView.findViewById(R.id.tvReportLevelOpen) + var tvReportTimeOpen: TextView = itemView.findViewById(R.id.tvReportTimeOpen) + var tvReportTypeOpen: TextView = itemView.findViewById(R.id.tvReportTypeOpen) + var tvReportReasonOpen: TextView = itemView.findViewById(R.id.tvReportReasonOpen) + } + + //运营平台 + class MsgBoxOperation(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivOperationImageNormal: ImageView = itemView.findViewById(R.id.ivOperationImageNormal) + var tvOperationTitleNormal: TextView = itemView.findViewById(R.id.tvOperationTitleNormal) + var tvOperationContentNormal: TextView = itemView.findViewById(R.id.tvOperationContentNormal) + var tvOperationStatusSelect: TextView = itemView.findViewById(R.id.tvOperationStatusSelect) + var tvOperationTime: TextView = itemView.findViewById(R.id.tvOperationTime) + var ivOperationImageOpen: ImageView = itemView.findViewById(R.id.ivOperationImageOpen) + var tvOperationTitleOpen: TextView = itemView.findViewById(R.id.tvOperationTitleOpen) + var tvOperationContentOpen: TextView = itemView.findViewById(R.id.tvOperationContentOpen) + } + + //Notice + class MsgBoxNotice(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivNoticeImage: ImageView = itemView.findViewById(R.id.ivNoticeImage) + var tvNoticeTime: TextView = itemView.findViewById(R.id.tvNoticeTime) + var tvNoticeContent: TextView = itemView.findViewById(R.id.tvNoticeContent) + } + + + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bad_case.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bad_case.png new file mode 100644 index 0000000000..ac98617e0f Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_bad_case.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_close.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_close.png new file mode 100644 index 0000000000..b1ad6d51de Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_close.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_open.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_open.png new file mode 100644 index 0000000000..dd70cfc907 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_open.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation.png new file mode 100644 index 0000000000..1da53e85da Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_msg_box_operation.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_normal.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_normal.png new file mode 100644 index 0000000000..acd794e519 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_normal.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_open.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_open.png new file mode 100644 index 0000000000..75cbf7793b Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_error_open.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_normal.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_normal.png new file mode 100644 index 0000000000..b896c6d085 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_normal.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_open.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_open.png new file mode 100644 index 0000000000..31288be011 Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_report_warning_open.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_msg_box_divider.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_msg_box_divider.xml new file mode 100644 index 0000000000..96fc4dc99d --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_msg_box_divider.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/selector_msg_box.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/selector_msg_box.xml new file mode 100644 index 0000000000..dca4cc1eed --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/selector_msg_box.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml index f1eef9611d..566b59fc2e 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml @@ -167,7 +167,6 @@ android:layout_height="120dp" android:layout_marginTop="30dp" android:layout_marginEnd="40dp" - android:background="@drawable/bg_waring_limiting_velocity" android:elevation="@dimen/dp_10" android:gravity="center" @@ -181,6 +180,48 @@ app:layout_goneMarginTop="40dp" tools:visibility="gone" /> + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml new file mode 100644 index 0000000000..a8eae24883 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_ipc_report.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml new file mode 100644 index 0000000000..6bd7c2fc06 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_notice.xml @@ -0,0 +1,52 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml new file mode 100644 index 0000000000..ff8a6fadab --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_operation.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml new file mode 100644 index 0000000000..cf5281b473 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_operation.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..1737bbf3af --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_report.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml new file mode 100644 index 0000000000..967b30a914 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_bubble.xml @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml new file mode 100644 index 0000000000..45b131202c --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_driver_msg_box_list.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 5d7d219244..a77286ff33 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 @@ -123,8 +123,8 @@ android:padding="@dimen/dp_20" android:background="@drawable/radio_button_normal_background_right" android:textColor="#000" - android:textOff="关闭OBU" - android:textOn="开启OBU" + android:textOff="开启OBU" + android:textOn="关闭OBU" android:textSize="@dimen/dp_24" app:layout_constraintTop_toBottomOf="@id/tbRainMode" /> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml index 673fe26115..333b277f12 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml @@ -10,6 +10,8 @@ #3B4577 #256BFF + #FF1BB7FF + #6200EE #3700B3 #03DAC5 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 872f4f8b9b..f5eb6bac20 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 @@ -92,7 +92,7 @@ interface IDevaToolsProvider : IProvider { /** * 当工控机回调时调用 */ - fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) + fun onReceiveBadCaseRecord(recordKey: Long,fileName: String,activity: Activity) /** * 展示录包配置 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 b09062156c..68e64f9cdb 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 @@ -123,8 +123,8 @@ object CallerDevaToolsManager { /** * 收到工控机回调时触发 */ - fun onReceiveBadCaseRecord(record: RecordPanelOuterClass.RecordPanel,activity: Activity) { - devaToolsProviderApi?.onReceiveBadCaseRecord(record,activity) + fun onReceiveBadCaseRecord(recordKey: Long,fileName: String,activity: Activity) { + devaToolsProviderApi?.onReceiveBadCaseRecord(recordKey, fileName, activity) } /** diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java index 12bb0d36c3..1de99c382e 100644 --- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java +++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/util/TimeUtils.java @@ -43,6 +43,10 @@ public final class TimeUtils { return getSafeDateFormat("HH:mm:ss"); } + public static SimpleDateFormat getHourMinFormat(){ + return getSafeDateFormat("HH:mm"); + } + @SuppressLint("SimpleDateFormat") public static SimpleDateFormat getSafeDateFormat(String pattern) { Map sdfMap = SDF_THREAD_LOCAL.get();