From d4a4d41e4fe90f23d5bdcc0546d5565c8b532fe3 Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Thu, 24 Mar 2022 16:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、增加日志过滤标签,对标签选中状态进行初始化 2、修改控制中心二级菜单边框颜色 --- .../scene/SceneManager.kt | 2 +- .../hmi/ui/setting/DebugSettingView.kt | 72 ++++++++++++++++++- .../setting_toggle_button_background.xml | 15 ++++ .../main/res/layout/view_debug_setting.xml | 61 ++++++++++++++-- 4 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/drawable/setting_toggle_button_background.xml diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt index 55205d11a9..5baadf1dc3 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/scene/SceneManager.kt @@ -45,7 +45,7 @@ class SceneManager { private var sceneModuleTAG: SceneModuleTAG = SceneModuleTAG(mutableMapOf()) private var sceneLogTAG: SceneLogTAG = SceneLogTAG(mutableMapOf()) - fun init() { + init { //过滤所需条件 sceneModuleTAG.map[ADAS] = SceneModule(true, M_ADAS_IMPL) sceneModuleTAG.map[DEVA] = SceneModule(true, M_DEVA) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 0b58988782..667edf6428 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -794,6 +794,39 @@ class DebugSettingView @JvmOverloads constructor( * 设置日志点击监听 */ private fun setLogCheckedChangeListener(){ + //初始化标签选中状态 + val tagMap=CallerDevaToolsManager.getModuleTAG() + tagMap?.let { + it.iterator().forEach {map -> + val name = map.value.name + val log = map.value.log + when(name){ + ////ADAS日志标签 + SceneConstant.M_ADAS_IMPL-> cbAdasLog.isChecked = log + //OBU日志标签 + SceneConstant.M_OBU-> cbObuLog.isChecked = log + //HMI日志标签 + SceneConstant.M_HMI-> cbHmiLog.isChecked = log + //V2X日志标签 + SceneConstant.M_V2X-> cbV2xLog.isChecked = log + //地图日志标签 + SceneConstant.M_MAP-> cbMapLog.isChecked = log + //DEVA日志标签 + SceneConstant.M_DEVA-> cbDevaLog.isChecked = log + //网络模块日志标签 + SceneConstant.M_NETWORK-> cbNetworkLog.isChecked = log + //ROUTE日志标签 + SceneConstant.M_OLD_ROUTE-> cbOldRouteLog.isChecked = log + //BUS日志标签 + SceneConstant.M_BUS-> cbBusLog.isChecked = log + //TAXI日志标签 + SceneConstant.M_TAXI-> cbTaxiLog.isChecked = log + //TAXI_P日志标签 + SceneConstant.M_TAXI_P-> cbTaxiPLog.isChecked = log + } + } + } + /** * 打开、关闭鹰眼Log */ @@ -852,9 +885,42 @@ class DebugSettingView @JvmOverloads constructor( sceneMap[SceneConstant.M_MAP] = mapModule CallerDevaToolsManager.updateModuleTAG(sceneMap) } - - - + //DEVA日志标签 + cbDevaLog.setOnCheckedChangeListener { _, isChecked -> + val devaModule = SceneModule(isChecked,SceneConstant.M_DEVA) + sceneMap[SceneConstant.M_DEVA] = devaModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } + //网络模块日志标签 + cbNetworkLog.setOnCheckedChangeListener { _, isChecked -> + val networkModule = SceneModule(isChecked,SceneConstant.M_NETWORK) + sceneMap[SceneConstant.M_NETWORK] = networkModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } + //ROUTE日志标签 + cbOldRouteLog.setOnCheckedChangeListener { _, isChecked -> + val oldRouteModule = SceneModule(isChecked,SceneConstant.M_OLD_ROUTE) + sceneMap[SceneConstant.M_OLD_ROUTE] = oldRouteModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } + //BUS日志标签 + cbBusLog.setOnCheckedChangeListener { _, isChecked -> + val busModule = SceneModule(isChecked,SceneConstant.M_BUS) + sceneMap[SceneConstant.M_BUS] = busModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } + //TAXI日志标签 + cbTaxiLog.setOnCheckedChangeListener { _, isChecked -> + val taxiModule = SceneModule(isChecked,SceneConstant.M_TAXI) + sceneMap[SceneConstant.M_TAXI] = taxiModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } + //TAXI_P日志标签 + cbTaxiPLog.setOnCheckedChangeListener { _, isChecked -> + val taxiPModule = SceneModule(isChecked,SceneConstant.M_TAXI_P) + sceneMap[SceneConstant.M_TAXI_P] = taxiPModule + CallerDevaToolsManager.updateModuleTAG(sceneMap) + } //开始停止抓取全量日志 tbLogCatch.isChecked = diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/setting_toggle_button_background.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/setting_toggle_button_background.xml new file mode 100644 index 0000000000..f977e253e9 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/setting_toggle_button_background.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/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 512efa5bde..10d9db207d 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -538,7 +538,7 @@ android:layout_height="wrap_content" android:textOff="域控制器" android:textOn="域控制器" - android:background="@drawable/radio_button_normal_background_right" + android:background="@drawable/setting_toggle_button_background" android:drawableEnd="@drawable/icon_right" android:padding="@dimen/dp_20" android:layout_margin="@dimen/dp_10" @@ -783,7 +783,7 @@ android:layout_height="wrap_content" android:textOff="OBU" android:textOn="OBU" - android:background="@drawable/radio_button_normal_background_right" + android:background="@drawable/setting_toggle_button_background" android:drawableEnd="@drawable/icon_right" android:padding="@dimen/dp_20" android:layout_margin="@dimen/dp_10" @@ -867,7 +867,7 @@ android:layout_height="wrap_content" android:textOff="HMI控制" android:textOn="HMI控制" - android:background="@drawable/radio_button_normal_background_right" + android:background="@drawable/setting_toggle_button_background" android:drawableEnd="@drawable/icon_right" android:padding="@dimen/dp_20" android:layout_margin="@dimen/dp_10" @@ -973,7 +973,7 @@ android:layout_height="wrap_content" android:textOff="HD地图控制" android:textOn="HD地图控制" - android:background="@drawable/radio_button_normal_background_right" + android:background="@drawable/setting_toggle_button_background" android:drawableEnd="@drawable/icon_right" android:padding="@dimen/dp_20" android:layout_margin="@dimen/dp_10" @@ -1427,6 +1427,59 @@ style="@style/DebugSettingText" /> + + + + + + + + + + +