open chain and add log debug view

This commit is contained in:
zhongchao
2022-03-01 17:12:02 +08:00
parent 47461acde5
commit 7dba6a2e52
8 changed files with 141 additions and 97 deletions

View File

@@ -40,6 +40,7 @@ import com.mogo.eagle.core.utilcode.kotlin.onClick
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.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
@@ -269,7 +270,8 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化工控机 IP信息
val autoPilotIpAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
SharedPrefsMgr.getInstance(context)
.getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
etAutopilotIP.setText(autoPilotIpAddress)
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
@@ -338,7 +340,7 @@ class DebugSettingView @JvmOverloads constructor(
tbIsDemoMode.isChecked = FunctionBuildConfig.isDemoMode
// 演示模式
tbIsDemoMode.setOnCheckedChangeListener { buttonView, isChecked ->
tbIsDemoMode.setOnCheckedChangeListener { _, isChecked ->
CallerAutoPilotManager.setDemoMode(isChecked)
FunctionBuildConfig.isDemoMode = isChecked
cbIsDrawAutopilotTrajectoryData.isEnabled = !isChecked
@@ -354,29 +356,27 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutoPilotManager.setControlAutopilotCarAuto(isChecked)
}
tbSelfLog.setOnCheckedChangeListener { buttonView, isChecked ->
tbSelfLog.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
LogUtils.getConfig().isLogSwitch = false
Logger.init(LogLevel.OFF)
com.elegant.log.simplelog.Logger.init(com.elegant.log.simplelog.LogLevel.OFF)
com.zhidao.account.sdk.utils.Logger.init(false)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
} else {
LogUtils.getConfig().isLogSwitch = true
Logger.init(LogLevel.DEBUG)
com.elegant.log.simplelog.Logger.init(com.elegant.log.simplelog.LogLevel.DEBUG)
com.zhidao.account.sdk.utils.Logger.init(true)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true
}
}
tbADASLog.setOnCheckedChangeListener { buttonView, isChecked ->
tbADASLog.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotManager.setIsWriteLog(false)
} else {
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotManager.setIsWriteLog(true)
} else {
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotManager.setIsWriteLog(false)
}
}
tbControlView.setOnCheckedChangeListener { buttonView, isChecked ->
tbControlView.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerSmpManager.hidePanel()
} else {
@@ -388,7 +388,13 @@ class DebugSettingView @JvmOverloads constructor(
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerDevaToolsManager.startCatchLog()
val logCatchTime = etLogCatch.text.toString().toInt()
if (logCatchTime > 60) {
tbLogCatch.isChecked = false
TipToast.shortTip("最长抓取时间为60分钟")
return@setOnCheckedChangeListener
}
CallerDevaToolsManager.startCatchLog(logCatchTime)
} else {
CallerDevaToolsManager.stopCatchLog()
}
@@ -427,7 +433,7 @@ class DebugSettingView @JvmOverloads constructor(
logViewDestroy()
}
}
tbLogTraceView.setOnCheckedChangeListener { _, isChecked ->
cbAdasChainLog.setOnCheckedChangeListener { _, isChecked ->
val traceInfoMap = CallerDevaToolsManager.getTraceInfo()
val chainLogParam = traceInfoMap[ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA]
chainLogParam?.let {

View File

@@ -365,7 +365,7 @@
android:id="@+id/flLogControl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:orientation="vertical"
app:alignContent="flex_start"
app:alignItems="center"
app:flexDirection="row"
@@ -389,18 +389,8 @@
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="关闭「ADAS」Log"
android:textOn="打开「ADAS」Log"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbLogCatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
android:gravity="center"
android:textOff="开始抓取全量日志"
android:textOn="停止抓取全量日志"
android:textOff="打开「ADAS」Log"
android:textOn="关闭「ADAS」Log"
android:textSize="@dimen/dp_24" />
<ToggleButton
@@ -413,18 +403,58 @@
android:textOn="关闭日志过滤面板"
android:textSize="@dimen/dp_24" />
<ToggleButton
android:id="@+id/tbLogTraceView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="2dp"
</com.google.android.flexbox.FlexboxLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:orientation="horizontal">
<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:digits="0123456789"
android:gravity="center"
android:textOff="ADAS长链数据未写入"
android:textOn="ADAS长链数据写入中..."
android:hint="默认10分钟"
android:minHeight="48dp"
android:padding="@dimen/dp_5"
android:textSize="@dimen/dp_24" />
</com.google.android.flexbox.FlexboxLayout>
<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" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="--------------------链路日志--------------------"
android:textColor="@android:color/holo_red_light"
android:textSize="@dimen/dp_24"
android:textStyle="bold" />
<CheckBox
android:id="@+id/cbAdasChainLog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:padding="@dimen/dp_10"
android:text="ADAS长链数据"
android:textColor="#000"
android:textSize="@dimen/dp_24" />
</LinearLayout>
<!--域控制器(工控机)配置信息-->
<LinearLayout
android:layout_width="match_parent"