[2.13.0-arch-opt] remove the check module and carcoder module
This commit is contained in:
@@ -17,6 +17,7 @@ import com.zhjt.mogo_core_function_devatools.funcconfig.FuncConfigImpl
|
||||
import com.zhjt.mogo_core_function_devatools.logcatch.MogoLogCatchManager
|
||||
import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.*
|
||||
import com.zhjt.mogo_core_function_devatools.trace.TraceManager.Companion.traceManager
|
||||
@@ -42,6 +43,8 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
traceManager.init(mContext!!)
|
||||
bizConfigCenter.init(mContext!!)
|
||||
FuncConfigImpl.init()
|
||||
//开启工控机监控节点上报服务
|
||||
IPCReportManager.INSTANCE.initServer()
|
||||
MogoLogCatchManager.init(mContext!!)
|
||||
MoFangManager.INSTANCE.init(mContext!!)
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.feedback.biz
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Feedback
|
||||
|
||||
|
||||
internal interface IFeedbackPresenter {
|
||||
|
||||
suspend fun loadFeedBacks(): List<Feedback>
|
||||
|
||||
suspend fun getBadCaseTaskId(): Int
|
||||
|
||||
suspend fun upload(params: Map<String, String>): UploadResult?
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.feedback.biz.bean
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||
|
||||
internal sealed class Feedback {
|
||||
|
||||
class BadCase(var remark: Remark, var reasons: List<Reason>): Feedback() {
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
other as BadCase
|
||||
if (reasons != other.reasons) return false
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return reasons.hashCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录文本编辑框的状态
|
||||
* @param text: 文件编辑框中输入的文字
|
||||
* @param cursorPos: 光标位置
|
||||
*/
|
||||
data class Remark(var text: CharSequence = "", var cursorPos: Int = 0)
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.feedback.biz.diff
|
||||
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Feedback
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Feedback.BadCase
|
||||
|
||||
internal class FeedbackDiffCallback<T: Feedback>(private val oldData: List<T>?, private val newData: List<T>?): DiffUtil.Callback() {
|
||||
|
||||
override fun getOldListSize(): Int {
|
||||
return oldData?.size ?: 0
|
||||
}
|
||||
|
||||
override fun getNewListSize(): Int = newData?.size ?: 0
|
||||
|
||||
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = oldData?.takeIf { it.size > oldItemPosition }?.equals(newData?.takeIf { it.size > newItemPosition }) ?: false
|
||||
|
||||
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
|
||||
val oldItem = oldData?.get(oldItemPosition)
|
||||
val newItem = newData?.get(newItemPosition)
|
||||
if (oldItem == null || newItem == null) {
|
||||
return false
|
||||
}
|
||||
return oldItem == newItem
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.feedback.biz.impl
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.BadCasePresenter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.UploadResult
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.IFeedbackPresenter
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Feedback
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Feedback.BadCase
|
||||
import com.zhjt.mogo_core_function_devatools.feedback.biz.bean.Remark
|
||||
|
||||
internal class FeedbackPresenter: IFeedbackPresenter {
|
||||
|
||||
private val badCase by lazy {
|
||||
BadCasePresenter()
|
||||
}
|
||||
|
||||
override suspend fun loadFeedBacks(): List<Feedback> = mutableListOf<Feedback>().also {
|
||||
//添加BadCase数据
|
||||
it += BadCase(Remark(), badCase.loadBadCases(false))
|
||||
}
|
||||
|
||||
override suspend fun getBadCaseTaskId(): Int {
|
||||
return badCase.getTaskId()
|
||||
}
|
||||
|
||||
override suspend fun upload(params: Map<String, String>): UploadResult? {
|
||||
return badCase.upload(params)
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.zhjt.mogo_core_function_devatools.feedback.callback
|
||||
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.repository.net.api.entity.BadCaseResponse.Reason
|
||||
|
||||
internal interface IFeedbackCallback {
|
||||
|
||||
/**
|
||||
* 点击关闭弹窗按钮时回调
|
||||
*/
|
||||
fun onClose(v: View)
|
||||
|
||||
/**
|
||||
* BadCase某一条目被点击了
|
||||
*/
|
||||
fun onBadCaseItemClicked(reason: Reason)
|
||||
|
||||
/**
|
||||
* 点击开始录制
|
||||
*/
|
||||
fun onStartBadCaseRecord(record: TextView)
|
||||
|
||||
/**
|
||||
* 点击停止录制
|
||||
*/
|
||||
fun onStopBadCaseRecord(record: TextView)
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.zhjt.mogo_core_function_devatools.report
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机监控节点信息上报管理
|
||||
* @since: 2022/5/12
|
||||
*/
|
||||
class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
|
||||
private var ipcErrorReportList = arrayListOf<ReportEntity>() //错误上报列表
|
||||
private var ipcWarningReportList = arrayListOf<ReportEntity>() //警告上报列表
|
||||
|
||||
companion object{
|
||||
const val TAG ="IPCReportManager"
|
||||
val INSTANCE: IPCReportManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
IPCReportManager()
|
||||
}
|
||||
//Warning
|
||||
const val RESULT_AUTOPILOT_INFERIOR = "RESULT_AUTOPILOT_INFERIOR"
|
||||
const val RESULT_SHOW_WARNING = "RESULT_SHOW_WARNING"
|
||||
const val RESULT_REMOTEPILOT_INFERIOR = "RESULT_REMOTEPILOT_INFERIOR"
|
||||
//Error
|
||||
const val RESULT_AUTOPILOT_DISABLE = "RESULT_AUTOPILOT_DISABLE"
|
||||
const val RESULT_AUTOPILOT_SYSTEM_UNSTARTED = "RESULT_AUTOPILOT_SYSTEM_UNSTARTED"
|
||||
const val RESULT_REMOTEPILOT_DISABLE = "RESULT_REMOTEPILOT_DISABLE"
|
||||
|
||||
}
|
||||
|
||||
fun initServer(){
|
||||
//乘客屏不显示监控信息弹窗,只在司机端提示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
// 添加 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
guardianInfo?.let{
|
||||
if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
|| it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|| 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))
|
||||
}
|
||||
|
||||
// //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)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
fun destroy(){
|
||||
//乘客屏不显示监控信息弹窗,只在司机端提示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
// 移除 ADAS状态 监听
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user