[dev_arch_opt_3.0] 添加obu信息展示,待联调

This commit is contained in:
lixiaopeng
2023-03-15 17:19:43 +08:00
parent 194d8894d7
commit fdbc224adc
5 changed files with 17 additions and 40 deletions

View File

@@ -109,7 +109,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
override fun onCurrentVersion(version: MogoObuSystemBConfigData) {
CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onCurrentVersion version = ${version.version}")
if (!version.version.isNullOrEmpty()) {
CallerObuInfoListenerManager.invokeObuVersionName(version.version)
CallerDevaToolsManager.queryObuUpgrade(version.version)
}
}
@@ -200,7 +199,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* @param data 系统状态
*/
override fun onObuSystemStatus(data: MogoObuSystemStatusData?) {
CallerObuInfoListenerManager.invokeGetObuInfo(data.toString())
}
/**

View File

@@ -152,8 +152,7 @@ internal class DebugSettingView @JvmOverloads constructor(
//OBU连接状态
private var obuConnectStatus: Boolean = false
private var mObuVersionName: String = ""
private var mObuDeviceId: String = ""
private var mObuInfoStr: String = ""
//渠道包标签
private var onlineSelected: Boolean = true
@@ -1527,7 +1526,6 @@ internal class DebugSettingView @JvmOverloads constructor(
}"
)
tvServerSocketStatus.text = Html.fromHtml(
"服务器Socket状态${
if (MogoStatusManager.getInstance().isSocketOnLine) {
@@ -1635,10 +1633,8 @@ internal class DebugSettingView @JvmOverloads constructor(
tbIsDemoMode.text = "开启美化模式"
}
//obu TODO 后面会添加很多os那边需要显示的内容
obuVersionNameTv.text = Html.fromHtml(
"OBU信息$mObuVersionName"
)
//obu信息排查obu相关问题使用
tvObuInfoContent.text = mObuInfoStr
obuConnectStatusTv.text = Html.fromHtml(
"OBU连接状态${
@@ -2048,12 +2044,7 @@ internal class DebugSettingView @JvmOverloads constructor(
setLogCheckedChangeListener()
}
override fun onGetObuVersionName(obuVersionName: String) {
mObuVersionName = obuVersionName
override fun onGetObuInfo(obuInfoStr: String) {
mObuInfoStr = obuInfoStr
}
override fun onObuDeviceId(obuDeviceId: String) {
mObuDeviceId = obuDeviceId
}
}

View File

@@ -1117,13 +1117,19 @@
<TextView
android:id="@+id/obuVersionNameTv"
style="@style/DebugSettingText"
android:text="OBU信息"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0" />
<TextView
android:id="@+id/tvObuInfoContent"
style="@style/DebugSettingText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minLines="3" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -9,14 +9,8 @@ package com.mogo.eagle.core.function.api.datacenter.obu
interface IMoGoObuInfoListener {
/**
* @param obuVersionName OBU硬件版本
* @param obuInfoStr OBU信息
*/
fun onGetObuVersionName(obuVersionName: String)
/**
* obuDeviceId
*/
fun onObuDeviceId(obuDeviceId: String)
fun onGetObuInfo(obuInfoStr: String)
}

View File

@@ -9,25 +9,12 @@ import com.mogo.eagle.core.function.call.base.CallerBase
*/
object CallerObuInfoListenerManager : CallerBase<IMoGoObuInfoListener>() {
fun invokeObuVersionName(obuVersionName: String) {
fun invokeGetObuInfo(obuInfoStr: String) {
M_LISTENERS.forEach {
val listener = it.value
listener.onGetObuVersionName(obuVersionName)
listener.onGetObuInfo(obuInfoStr)
}
}
fun invokeObuDeviceId(obuDeviceId: String) {
M_LISTENERS.forEach {
val listener = it.value
listener.onObuDeviceId(obuDeviceId)
}
}
// fun invokeQueryContainersResponse(dockerList: List<String>) {
// M_LISTENERS.forEach {
// val listener = it.value
// //TODO
// }
// }
}