[dev_arch_opt_3.0]fix调试面板,点击打开历史,APP崩溃
This commit is contained in:
@@ -30,6 +30,7 @@ import com.zhjt.mogo_core_function_devatools.mofang.MoFangManager.Companion.moFa
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.MonitorManager
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb
|
||||
import com.zhjt.mogo_core_function_devatools.monitor.db.MonitorDb.Companion.getDb
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.report.IPCReportManager.Companion.iPCReportManager
|
||||
import com.zhjt.mogo_core_function_devatools.scene.SceneManager.Companion.sceneManager
|
||||
import com.zhjt.mogo_core_function_devatools.status.StatusManager
|
||||
@@ -162,6 +163,10 @@ class DevaToolsProvider : IDevaToolsProvider {
|
||||
BadCaseManager.showBadCaseManagerWindow(context)
|
||||
}
|
||||
|
||||
override fun showReportListWindow(context: Context, isShow: Boolean) {
|
||||
iPCReportManager.showReportListWindow(context, isShow)
|
||||
}
|
||||
|
||||
override fun downLoadPackage(downloadKey: String, downloadUrl: String) {
|
||||
upgradeManager.downLoadPackage(mContext!!, downloadKey, downloadUrl)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.zhjt.mogo_core_function_devatools.report
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
@@ -37,6 +39,11 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
|
||||
}
|
||||
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
//工控机节点上报列表
|
||||
private val reportList = arrayListOf<ReportEntity>()
|
||||
|
||||
fun initServer(){
|
||||
//乘客屏不显示监控信息弹窗,只在司机端提示
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
@@ -45,6 +52,19 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
fun showReportListWindow(context: Context, isShow: Boolean){
|
||||
if(isShow){
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*工控机监控节点上报
|
||||
*/
|
||||
@@ -61,6 +81,18 @@ class IPCReportManager : IMoGoAutopilotStatusListener {
|
||||
CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.REPORT, reportEntity))
|
||||
}
|
||||
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
|
||||
// //Error 弹窗并有提示音
|
||||
// if(it.resultList.contains(RESULT_AUTOPILOT_DISABLE)
|
||||
// || it.resultList.contains(RESULT_AUTOPILOT_SYSTEM_UNSTARTED)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
package com.zhjt.mogo_core_function_devatools.report
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.PixelFormat
|
||||
@@ -7,9 +7,9 @@ import android.view.*
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import java.lang.reflect.Field
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.report.adapter.ReportListAdapter
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
@@ -51,7 +51,7 @@ class ReportListFloatWindow constructor(activity: Activity) : View.OnTouchListen
|
||||
it.alpha = 0.9f
|
||||
}
|
||||
reportListAdapter= ReportListAdapter(mActivity)
|
||||
rvReportList.layoutManager = WrapContentLinearLayoutManager(mActivity,
|
||||
rvReportList.layoutManager = LinearLayoutManager(mActivity,
|
||||
LinearLayoutManager.VERTICAL,false)
|
||||
rvReportList.adapter = reportListAdapter
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
package com.zhjt.mogo_core_function_devatools.report.adapter
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
@@ -10,7 +10,7 @@ import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -6,44 +6,58 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTime"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportSrc"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportLevel"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportMsg"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportCode"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportResult"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportActions"
|
||||
style="@style/DebugSettingText"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="24dp"
|
||||
android:layout_margin="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/dialog_bg_color"
|
||||
android:background="#3B4577"
|
||||
app:roundLayoutRadius="10dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -29,7 +29,6 @@ import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog
|
||||
@@ -257,20 +256,6 @@ class MoGoHmiProvider : IMoGoHmiProvider {
|
||||
}
|
||||
}
|
||||
|
||||
override fun showIPCReportWindow(
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let {
|
||||
if (reportLevel == 1) {
|
||||
IPCReportWindow.show(it, errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun showUpgradeDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
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.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import me.jessyan.autosize.AutoSizeCompat
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机异常节点上报适配器
|
||||
* @since: 2022/5/12
|
||||
*/
|
||||
class IPCReportAdapter: RecyclerView.Adapter<IPCReportAdapter.IPCReportHolder>(){
|
||||
|
||||
private var data:List<ReportEntity>? = null
|
||||
|
||||
fun setData( data: List<ReportEntity>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IPCReportHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_ipc_report, parent, false)
|
||||
return IPCReportHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: IPCReportHolder, position: Int) {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(holder.itemView.resources)
|
||||
data?.let {it ->
|
||||
val reportEntity = it[position]
|
||||
reportEntity.let {
|
||||
holder.tvReportTimeContent.text = it.time
|
||||
var resultStr = "发生异常"
|
||||
for (result in it.resultList){
|
||||
resultStr = "${resultStr}-${CallerAutoPilotControlManager.getReportResultDesc(result)}"
|
||||
}
|
||||
holder.tvReportResultContent.text = resultStr
|
||||
holder.tvReportMsgContent.text = it.msg
|
||||
var actionStr = ""
|
||||
for (action in it.actionsList){
|
||||
actionStr = "${actionStr}-${CallerAutoPilotControlManager.getReportActionDesc(action)}"
|
||||
}
|
||||
holder.tvReportActionContent.text = actionStr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class IPCReportHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var tvReportTimeContent: TextView = itemView.findViewById(R.id.tvReportTimeContent)
|
||||
var tvReportResultContent: TextView = itemView.findViewById(R.id.tvReportResultContent)
|
||||
var tvReportMsgContent: TextView = itemView.findViewById(R.id.tvReportMsgContent)
|
||||
var tvReportActionContent: TextView = itemView.findViewById(R.id.tvReportActionContent)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SoundUtils
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机异常节点上报
|
||||
* @since: 2022/5/12
|
||||
*/
|
||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "IPCReportWindow"
|
||||
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
fun show(
|
||||
context: Context?,
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
context?.let {
|
||||
if (ipcReportWindow == null) {
|
||||
ipcReportWindow = IPCReportWindow(it as Activity)
|
||||
SoundUtils.playRing(it)
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
private var mWindowManager: WindowManager? = null
|
||||
private lateinit var rvIPCReport: RecyclerView
|
||||
private lateinit var ivIpcClose: ImageView
|
||||
private lateinit var tvIpcErrorTab: TextView
|
||||
private lateinit var tvIpcWarningTab: TextView
|
||||
private var ipcReportAdapter: IPCReportAdapter? = null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
private var mInViewX = 0f
|
||||
private var mInViewY = 0f
|
||||
private var mDownInScreenX = 0f
|
||||
private var mDownInScreenY = 0f
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var ipcErrorReportList: List<ReportEntity>? = null //错误上报列表
|
||||
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
||||
|
||||
init {
|
||||
initFloatWindow()
|
||||
}
|
||||
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
rvIPCReport = mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
||||
tvIpcErrorTab = mFloatLayout.findViewById(R.id.tv_ipc_error_tab)
|
||||
tvIpcWarningTab = mFloatLayout.findViewById(R.id.tv_ipc_warning_tab)
|
||||
mWindowParams = WindowManager.LayoutParams()
|
||||
mWindowManager = mActivity.windowManager
|
||||
mWindowParams?.let {
|
||||
it.format = PixelFormat.RGBA_8888
|
||||
it.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
|
||||
it.gravity = Gravity.START or Gravity.TOP
|
||||
it.width = 924
|
||||
it.height = 444
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
ipcReportAdapter = IPCReportAdapter()
|
||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(
|
||||
mActivity,
|
||||
LinearLayoutManager.VERTICAL, false
|
||||
)
|
||||
rvIPCReport.adapter = ipcReportAdapter
|
||||
//关闭按钮
|
||||
ivIpcClose.setOnClickListener {
|
||||
hideFloatWindow()
|
||||
}
|
||||
//错误列表
|
||||
tvIpcErrorTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_normal_bg)
|
||||
ipcReportAdapter?.setData(ipcErrorReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//预警列表
|
||||
tvIpcWarningTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_select_bg)
|
||||
ipcReportAdapter?.setData(ipcWarningReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun refreshData(
|
||||
errorReportList: List<ReportEntity>,
|
||||
warningReportList: List<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
if (reportLevel == 1) {
|
||||
ipcReportAdapter?.setData(errorReportList)
|
||||
ipcErrorReportList = errorReportList
|
||||
} else {
|
||||
ipcReportAdapter?.setData(warningReportList)
|
||||
ipcWarningReportList = warningReportList
|
||||
}
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onTouch(v: View?, motionEvent: MotionEvent?): Boolean {
|
||||
when (motionEvent?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
// 获取相对View的坐标,即以此View左上角为原点
|
||||
mInViewX = motionEvent.x
|
||||
mInViewY = motionEvent.y
|
||||
// 获取相对屏幕的坐标,即以屏幕左上角为原点
|
||||
mDownInScreenX = motionEvent.rawX
|
||||
mDownInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
// 更新浮动窗口位置参数
|
||||
mInScreenX = motionEvent.rawX
|
||||
mInScreenY = motionEvent.rawY - BarUtils.getStatusBarHeight()
|
||||
mWindowParams!!.x = (mInScreenX - mInViewX).toInt()
|
||||
mWindowParams!!.y = (mInScreenY - mInViewY).toInt()
|
||||
// 手指移动的时候更新小悬浮窗的位置
|
||||
mWindowManager!!.updateViewLayout(mFloatLayout, mWindowParams)
|
||||
}
|
||||
// MotionEvent.ACTION_UP -> // 如果手指离开屏幕时,xDownInScreen和xInScreen相等,且yDownInScreen和yInScreen相等,则视为触发了单击事件。
|
||||
// if (mDownInScreenX === mInScreenX && mDownInScreenY === mInScreenY) {
|
||||
// }
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
fun showFloatWindow() {
|
||||
if (mFloatLayout.parent == null) {
|
||||
val metrics = DisplayMetrics()
|
||||
// 默认固定位置,靠屏幕右边缘的中间
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
// mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 100
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) {
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
ipcReportWindow = null
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,17 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
|
||||
@@ -28,29 +25,6 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mDebugSettingView: DebugSettingView? = null
|
||||
|
||||
//工控机节点上报列表
|
||||
private val reportList = arrayListOf<ReportEntity>()
|
||||
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
guardianInfo?.let {
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
@@ -60,18 +34,14 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
} else {
|
||||
if (mDebugSettingView == null) {
|
||||
mDebugSettingView = DebugSettingView(context)
|
||||
mDebugSettingView?.reportInit(reportList)
|
||||
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||
override fun showReportListWindow(show: Boolean) {
|
||||
if (show) {
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context.applicationContext as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
CallerDevaToolsManager.showReportListWindow(context,true)
|
||||
} else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
CallerDevaToolsManager.showReportListWindow(context,false)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -115,8 +85,7 @@ class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
mDebugSettingViewFloat = null
|
||||
mDebugSettingView = null
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
reportListFloatWindow = null
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTimeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:text="@string/ipc_report_time"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginStart="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportTimeContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportTimeTitle"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportResultTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportTimeTitle"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:text="@string/ipc_report_type"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginStart="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportResultContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportResultTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportResultTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:minLines="1"
|
||||
android:layout_marginEnd="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportMsgTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportResultContent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:text="@string/ipc_report_msg"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginStart="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportMsgContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportMsgTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportMsgTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:minLines="1"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:layout_marginEnd="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportActionTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportMsgContent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:text="@string/ipc_report_action"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginStart="26dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvReportActionContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvReportActionTitle"
|
||||
app:layout_constraintLeft_toRightOf="@id/tvReportActionTitle"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:minLines="1"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:layout_marginEnd="26dp"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvReportActionContent"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_31"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="26dp"
|
||||
android:layout_marginEnd="26dp"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="924dp"
|
||||
android:layout_height="444dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/dialog_bg_color"
|
||||
app:roundLayoutRadius="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_ipc_error_tab"
|
||||
android:layout_width="412dp"
|
||||
android:layout_height="90dp"
|
||||
android:text="Error"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/ipc_error_tab_normal_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_ipc_warning_tab"
|
||||
android:layout_width="412dp"
|
||||
android:layout_height="90dp"
|
||||
android:text="Warning"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38dp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/tv_ipc_error_tab"
|
||||
android:background="@drawable/ipc_warning_tab_normal_bg"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_ipc_close"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="90dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/icon_ipc_close"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_ipc_report"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_ipc_error_tab"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user