调试窗日志UI更改

1、更改日志UI
2、添加日志过滤标签
This commit is contained in:
xuxinchao
2022-03-21 19:20:26 +08:00
parent 6e040c5a77
commit 0c031aed76
2 changed files with 120 additions and 33 deletions

View File

@@ -14,10 +14,11 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.deva.scene.SceneModule
import com.mogo.eagle.core.data.deva.scene.SceneTAG
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.obu.ObuStatusInfo
@@ -45,17 +46,13 @@ import com.mogo.eagle.core.utilcode.kotlin.onClick
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.MogoMap
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS
import com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP
import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.module.common.MogoApisHandler
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
@@ -98,6 +95,8 @@ class DebugSettingView @JvmOverloads constructor(
//当前PAD支持的CPU架构
private var cpuList = "CPU架构"
//日志过滤标签集合
private val sceneMap = mutableMapOf< String, SceneModule>()
private var dockerRebootDialog: DockerRebootDialog? = null //docker重启对话框
private var adUpgradeDialog : AdUpgradeDialog? = null //工控机升级对话框
@@ -819,6 +818,40 @@ class DebugSettingView @JvmOverloads constructor(
//ADAS日志标签
cbAdasLog.setOnCheckedChangeListener { _, isChecked ->
val adasModule = SceneModule(isChecked,SceneConstant.M_ADAS_IMPL)
sceneMap[SceneConstant.M_ADAS_IMPL] = adasModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//OBU日志标签
cbObuLog.setOnCheckedChangeListener { _, isChecked ->
val obuModule = SceneModule(isChecked,SceneConstant.M_OBU)
sceneMap[SceneConstant.M_OBU] = obuModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//HMI日志标签
cbHmiLog.setOnCheckedChangeListener { _, isChecked ->
val hmiModule = SceneModule(isChecked,SceneConstant.M_HMI)
sceneMap[SceneConstant.M_HMI] = hmiModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//V2X日志标签
cbV2xLog.setOnCheckedChangeListener { _, isChecked ->
val v2xModule = SceneModule(isChecked,SceneConstant.M_V2X)
sceneMap[SceneConstant.M_V2X] = v2xModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//地图日志标签
cbMapLog.setOnCheckedChangeListener { _, isChecked ->
val mapModule = SceneModule(isChecked,SceneConstant.M_MAP)
sceneMap[SceneConstant.M_MAP] = mapModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//开始停止抓取全量日志
tbLogCatch.isChecked =
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)

View File

@@ -1313,16 +1313,6 @@
android:orientation="vertical"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#B200BCD4"
android:padding="@dimen/dp_10"
android:text="日志输出控制"
android:textColor="#000"
android:textSize="@dimen/dp_28"
android:textStyle="bold" />
<com.google.android.flexbox.FlexboxLayout
android:id="@+id/flLogControl"
android:layout_width="match_parent"
@@ -1367,34 +1357,98 @@
</com.google.android.flexbox.FlexboxLayout>
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:alignContent="flex_start"
app:alignItems="center"
app:flexDirection="row"
app:flexWrap="wrap"
app:justifyContent="flex_start"
tools:visibility="visible">
<CheckBox
android:id="@+id/cbAdasLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="ADAS日志"
style="@style/DebugSettingText"
/>
<CheckBox
android:id="@+id/cbObuLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="OBU日志"
style="@style/DebugSettingText"
/>
<CheckBox
android:id="@+id/cbHmiLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="HMI日志"
style="@style/DebugSettingText"
/>
<CheckBox
android:id="@+id/cbV2xLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="V2X日志"
style="@style/DebugSettingText"
/>
<CheckBox
android:id="@+id/cbMapLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="地图日志"
style="@style/DebugSettingText"
/>
</com.google.android.flexbox.FlexboxLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ToggleButton
android:id="@+id/tbLogCatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textOff="开始抓取全量日志"
android:textOn="停止抓取全量日志"
android:textSize="@dimen/dp_24"
/>
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etLogCatch"
android:layout_width="0dp"
android:layout_height="@dimen/dp_80"
android:layout_weight="2"
android:background="#32009688"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:digits="0123456789"
android:gravity="center"
android:hint="默认10分钟"
android:minHeight="48dp"
android:padding="@dimen/dp_5"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbLogCatch"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:padding="@dimen/dp_5"
android:textOff="开始抓取全量日志"
android:textOn="停止抓取全量日志"
android:textSize="@dimen/dp_24" />
android:textColor="#1A1A1A"
android:textSize="14sp"
android:background="@drawable/debug_setting_edit_bg"
android:layout_marginStart="@dimen/dp_30"
android:layout_marginEnd="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
/>
</LinearLayout>