[8.0.0]调试面板-版本信息增加动态配置鹰眼显示MAP版本

This commit is contained in:
xuxinchao
2025-05-20 16:11:33 +08:00
parent 89641b48df
commit 8de8ea1d40
7 changed files with 129 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.devatools.IOTAListener
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
@@ -25,6 +26,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.och.CallerOchCustomViewManager
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.tools.OfflineMapDialog
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
@@ -68,7 +70,8 @@ class CarInfoTabView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener, IOTAListener {
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener, IOTAListener,
IMapShowNameListener {
companion object {
private const val TAG = "CarInfoTabView"
@@ -91,6 +94,7 @@ class CarInfoTabView @JvmOverloads constructor(
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerDevaToolsListenerManager.addListener(TAG, this)
CallerDataCenterBizListener.addListener(TAG, this)
CallerMapShowNameManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
@@ -99,6 +103,7 @@ class CarInfoTabView @JvmOverloads constructor(
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerDevaToolsListenerManager.removeListener(TAG)
CallerDataCenterBizListener.removeListener(TAG)
CallerMapShowNameManager.removeListener(TAG)
}
private fun initView() {
@@ -248,8 +253,12 @@ class CarInfoTabView @JvmOverloads constructor(
private fun showCurrentAdVersion() {
UiThreadHandler.post {
CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
tvADVersionName.text = it
if(AppConfigInfo.mapShowName.isNotEmpty()){
tvADVersionName.text = AppConfigInfo.mapShowName
}else{
CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
tvADVersionName.text = it
}
}
}
}
@@ -356,4 +365,9 @@ class CarInfoTabView @JvmOverloads constructor(
}
}
override fun changeMapShowName(showName: String) {
super.changeMapShowName(showName)
showCurrentAdVersion()
}
}

View File

@@ -96,6 +96,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuInfoListenerManager
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
@@ -337,6 +338,8 @@ import kotlin.collections.set
import kotlin.math.abs
import kotlin.system.exitProcess
import com.mogo.eagle.core.function.hmi.ui.tools.ShowDevicesManagerStateDialog
import kotlinx.android.synthetic.main.view_debug_setting.view.btnEnsureMap
import kotlinx.android.synthetic.main.view_debug_setting.view.etMapShowName
import kotlinx.android.synthetic.main.view_debug_setting.view.tbTileFileLog
@@ -597,6 +600,18 @@ internal class DebugSettingView @JvmOverloads constructor(
appVersionInfoLayout.visibility = View.GONE
}
}
//动态配置鹰眼显示MAP版本
if(AppConfigInfo.mapShowName.isEmpty()){
AppConfigInfo.mapShowName = CallerAutoPilotStatusListenerManager.getDockerVersion()+""
}
etMapShowName.setText(AppConfigInfo.mapShowName)
etMapShowName.text?.let { etMapShowName.setSelection(it.length) }
btnEnsureMap.setOnClickListener {
AppConfigInfo.mapShowName = etMapShowName.text.toString()
tvIpcVersionInfo.text = "MAP${AppConfigInfo.mapShowName}"
tvIpcVersionInfoKey.text = "MAP${AppConfigInfo.mapShowName}"
CallerMapShowNameManager.invokeMapShowName(AppConfigInfo.mapShowName)
}
/**
* 状态中心
@@ -2108,7 +2123,11 @@ internal class DebugSettingView @JvmOverloads constructor(
} else {
tvIpcProtocolVersionInfo.text = "工控机协议版本:${AppConfigInfo.protocolVersionNumber}"
}
val dockerVersion = CallerAutoPilotStatusListenerManager.getDockerVersion()
val dockerVersion = if(AppConfigInfo.mapShowName.isNotEmpty() && AppConfigInfo.mapShowName!=CallerAutoPilotStatusListenerManager.getDockerVersion()){
AppConfigInfo.mapShowName
}else{
CallerAutoPilotStatusListenerManager.getDockerVersion()
}
tvIpcVersionInfo.text = "MAP$dockerVersion"
tvIpcVersionInfoKey.text = "MAP$dockerVersion"
tvMoGoMapVersion.text = "HD-Map版本${DebugConfig.getMapVersion()}"

View File

@@ -3,11 +3,15 @@ package com.mogo.eagle.core.function.hmi.ui.widget
import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.util.Log
import android.view.LayoutInflater
import android.widget.LinearLayout
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.*
import com.mogo.eagle.core.utilcode.util.AppUtils
@@ -23,7 +27,7 @@ class VersionNameView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr),IMoGoAutopilotStatusListener {
) : LinearLayout(context, attrs, defStyleAttr),IMoGoAutopilotStatusListener, IMapShowNameListener {
companion object {
const val TAG = "VersionNameView"
@@ -64,7 +68,9 @@ class VersionNameView @JvmOverloads constructor(
@SuppressLint("SetTextI18n")
private fun showCurrentMapVersion() {
val old = tvMapVersionName?.text
val version = dockerVersion
val version = AppConfigInfo.mapShowName.ifEmpty {
dockerVersion
}
if (!version.isNullOrEmpty() && old != version) {
scope.launch {
tvMapVersionName?.also {
@@ -78,11 +84,13 @@ class VersionNameView @JvmOverloads constructor(
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerMapShowNameManager.addListener(TAG,this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerMapShowNameManager.removeListener(TAG)
}
override fun onAutopilotDockerInfo(dockerVersion: String) {
@@ -93,4 +101,9 @@ class VersionNameView @JvmOverloads constructor(
CallerDevaToolsManager.dockerVersion(dockerVersion)
}
override fun changeMapShowName(showName: String) {
super.changeMapShowName(showName)
showCurrentMapVersion()
}
}

View File

@@ -543,6 +543,45 @@
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="动态配置鹰眼显示MAP版本:"
style="@style/DebugSettingText"
/>
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/etMapShowName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
tools:ignore="SpeakableTextPresentCheck"
android:background="@drawable/debug_setting_edit_bg"
android:textColor="#1A1A1A"
android:textSize="@dimen/dp_24"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
android:paddingStart="@dimen/dp_20"
android:paddingEnd="@dimen/dp_20"
/>
<Button
android:id="@+id/btnEnsureMap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
style="@style/DebugSettingText"
android:paddingStart="@dimen/dp_30"
android:paddingEnd="@dimen/dp_30"
android:paddingTop="@dimen/dp_10"
android:paddingBottom="@dimen/dp_10"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
</LinearLayout>
<ToggleButton

View File

@@ -62,6 +62,9 @@ object AppConfigInfo {
//工控机激光Slam地图版本
@Volatile
var slamMapVersion: String =""
//鹰眼可动态展示的MAP版本
@Volatile
var mapShowName: String = ""
//业务状态信息
/**

View File

@@ -0,0 +1,14 @@
package com.mogo.eagle.core.function.api.setting
/**
* 工控机显示版本监听接口
*/
interface IMapShowNameListener {
/**
* 工控机显示版本
* @param showName 展示版本
*/
fun changeMapShowName(showName: String){}
}

View File

@@ -0,0 +1,21 @@
package com.mogo.eagle.core.function.call.setting
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 工控机展示版本
*/
object CallerMapShowNameManager: CallerBase<IMapShowNameListener>() {
/**
* 工控机显示版本
* @param showName 展示版本
*/
fun invokeMapShowName(showName: String){
M_LISTENERS.forEach{
val listener = it.value
listener.changeMapShowName(showName)
}
}
}