diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
index 6d749ccdab..ca38830dba 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
@@ -20,6 +20,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_AD
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_ROUTE
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_STATUS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_STATUS_QUERY_RESP
+import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_SYSTEM_STATUS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_V2N_EVENT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_ADAS_VEHICLE
@@ -444,9 +445,16 @@ class MoGoAdasListenerImpl : OnAdasListener {
} else {
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady = false
}
+
invokeAutopilotStatusRespByQuery(statusInfo)
}
+ @ChainLog(
+ linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
+ linkCode = CHAIN_SOURCE_ADAS,
+ nodeAliasCode = CHAIN_CODE_ADAS_SYSTEM_STATUS,
+ paramIndexes = [0, 1]
+ )
override fun onSystemStatus(header: MessagePad.Header?, statusInf: SsmInfo.SsmStatusInf?) {
if (statusInf != null && statusInf.hasAutoPilotReady()) {
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().ssmAutoPilotReady =
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/BoneTabLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/BoneTabLayout.kt
index 9025aac49b..4b4f7906fe 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/BoneTabLayout.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/BoneTabLayout.kt
@@ -5,6 +5,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.hmi.R
+import kotlinx.android.synthetic.main.view_bone_tab.view.carInfoTabView
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchCarInfo
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchMore
import kotlinx.android.synthetic.main.view_bone_tab.view.tabSwitchMsgBox
@@ -66,39 +67,36 @@ class BoneTabLayout @JvmOverloads constructor(
when (tabType) {
TabType.CAR_INFO -> {
tabSwitchCarInfo.switchTab(check)
- if(check){
-
- }else{
-
- }
+ carInfoTabView.visibility = if (check) VISIBLE else GONE
}
TabType.MSG_INFO -> {
tabSwitchMsgBox.switchTab(check)
- if(check){
+ if (check) {
- }else{
+ } else {
}
}
TabType.REPORT_INFO -> {
tabSwitchReport.switchTab(check)
- if(check){
+ if (check) {
- }else{
+ } else {
}
}
TabType.MORE_INFO -> {
tabSwitchMore.switchTab(check)
- if(check){
+ if (check) {
- }else{
+ } else {
}
}
+
else -> {}
}
}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/CarInfoTabView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/CarInfoTabView.kt
index 9c088e9e2a..eadbfec4fb 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/CarInfoTabView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/CarInfoTabView.kt
@@ -4,15 +4,204 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
+import com.mogo.commons.storage.SharedPrefsMgr
+import com.mogo.eagle.core.data.app.AppConfigInfo
+import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
+import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
+import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
+import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
+import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
+import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
+import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
+import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
+import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
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
+import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
+import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
+import com.mogo.eagle.core.utilcode.util.AppUtils
+import com.mogo.eagle.core.utilcode.util.ToastUtils
+import com.mogo.eagle.core.utilcode.util.UiThreadHandler
+import com.mogo.map.MogoData
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADMapVersion
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvADVersion
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarExit
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarLoginInfo
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvCarNo
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvHDMapUpdate
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvPADUpdate
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvPadVersion
+import kotlinx.android.synthetic.main.view_car_info_tab.view.tvSnInfo
+import system_master.SsmInfo
+import system_master.SystemStatusInfo
+
class CarInfoTabView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
-) : ConstraintLayout(context, attrs, defStyleAttr){
+) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
+ IMoGoAutopilotStatusListener, IMoGoDevaToolsListener {
+
+ companion object{
+ private const val TAG = "CarInfoTabView"
+ }
+
+
+ private var loginOut: (() -> Unit)? = null
+ @Volatile
+ private var isHDCached = false
init {
LayoutInflater.from(context).inflate(R.layout.view_car_info_tab, this, true)
+ initView()
}
+
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ CallerHmiListenerManager.addListener(TAG, this)
+ CallerAutoPilotStatusListenerManager.addListener(TAG, this)
+ CallerDevaToolsListenerManager.addListener(TAG, this)
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ CallerHmiListenerManager.removeListener(TAG)
+ CallerAutoPilotStatusListenerManager.removeListener(TAG)
+ CallerDevaToolsListenerManager.removeListener(TAG)
+ }
+
+ private fun initView() {
+ showCurrentPadVersion()
+ showCurrentAdVersion()
+ updateAdHdMapVersion()
+
+ tvSnInfo.text = SharedPrefsMgr.getInstance().sn
+ tvCarExit.setOnClickListener {
+ loginOut?.invoke()
+ }
+ //鹰眼版本 检查更新
+ tvPADUpdate.setOnClickListener {
+ HmiActionLog.hmiAction(
+ "${SceneConstant.M_HMI}${TAG}",
+ "pad version view clicked"
+ )
+ val provider = CallerDevaToolsManager.upgradeProvider()
+ if (provider?.isDownloading() == true) {
+ ToastUtils.showShort("正在下载最新版本,请稍候再试...")
+ return@setOnClickListener
+ }
+ CallerDevaToolsManager.queryAppUpgrade()
+ }
+
+ //高精地图 检查更新
+ tvHDMapUpdate.setOnClickListener {
+ HmiActionLog.hmiAction(
+ "${SceneConstant.M_HMI}${TAG}",
+ mapOf("isHDCached" to isHDCached)
+ )
+ if (isHDCached) { // 已缓存
+ ToastUtils.showShort(resources.getString(R.string.offline_had_downloaded))
+ } else {// 未缓存
+ if (CallerMapUIServiceManager.getCityCode().isNullOrEmpty()) {// 未拿到高德的cityCode
+ if ((CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().longitude <= 0.0 && CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().latitude <= 0.0)) {// 未拿到高精的经纬度
+ ToastUtils.showShort(resources.getString(R.string.location_try_again))
+ } else { // 拿到了高精的经纬度
+ val dialog = OfflineMapDialog(context)
+ dialog.location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
+ dialog.show()
+ }
+ } else {// 拿到高德的cityCode
+ OfflineMapDialog(context).show()
+ }
+ }
+ }
+ MogoData.mogoMapData.get()?.isCityDataCached {
+ updateHDDataCacheStatus(it)
+ }
+ }
+
+ private fun showCurrentPadVersion() {
+ tvPadVersion.text = tvPadVersion.text.toString() + AppUtils.getAppVersionName()
+ }
+
+
+ fun setLoginInfo(loginNo: String) {
+ if (loginNo.isNotEmpty()) {
+ tvCarLoginInfo.text = loginNo.take(3) + "****" + loginNo.takeLast(4)
+ } else {
+ tvCarLoginInfo.text = ""
+ }
+ }
+
+ fun setCarNo(carNo: String) {
+ // todo emArrow 需要同时监听工控的车牌信息,防止调试跳过无车牌内容(链接先后顺序不一致也会导致数据显示异常)
+ if (carNo.isEmpty()) {
+ tvCarNo.visibility = GONE
+ tvCarNo.text = ""
+ } else {
+ tvCarNo.visibility = VISIBLE
+ tvCarNo.text = carNo.substring(0, 2) + " " + carNo.substring(2);
+ }
+ }
+
+ fun loginOut(loginOut: (() -> Unit)) {
+ this.loginOut = loginOut
+ }
+
+ override fun updateHDDataCacheStatus(isCached: Boolean) {
+ isHDCached = isCached
+ }
+
+ private fun showCurrentAdVersion() {
+ UiThreadHandler.post {
+ CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
+ tvADVersion.text = tvADVersion.text.toString() + it
+ }
+ }
+ }
+
+ override fun onAutopilotDockerInfo(dockerVersion: String) {
+ super.onAutopilotDockerInfo(dockerVersion)
+ showCurrentAdVersion()
+ }
+
+ private fun updateAdHdMapVersion() {
+ if(AppConfigInfo.adHdMapVersion.isNotEmpty()){
+ tvADMapVersion.text = tvADMapVersion.text.toString() + AppConfigInfo.adHdMapVersion
+ }
+ }
+
+ override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
+ CallerLogger.i(SceneConstant.M_HMI + TAG, "hdMapVer=" + status.hdMapVer)
+ //hdMapVer返回示例:/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改,对原609场景修改为6091、6092、6201、 6202四种细分场景,并对通往园区路口改为619
+ if (status.hdMapVer != null && status.hdMapVer.isNotEmpty()) {
+ //对地图版本进行截取
+ val city = status.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
+ val version = status.hdMapVer.substringAfter("$city|").substringBefore("|")
+ AppConfigInfo.adHdMapVersion = "${city}_${version}"
+ updateAdHdMapVersion()
+ }
+
+ }
+
+ /**
+ * 定频SSM接口
+ * 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
+ * 定频SSM接入后 onStatusQueryResp 状态查询应答接口将弃用
+ * @param statusInf 数据
+ */
+ override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
+ CallerLogger.i(SceneConstant.M_HMI + TAG, "hdMapVer=" + statusInf.hdMapVer)
+ //hdMapVer返回示例:/home/mogo/autopilot/share/hadmap_engine/data/hadmap_data/db.sqlite|bj|2.2.7|对bus路线上的junction进行修改,对原609场景修改为6091、6092、6201、 6202四种细分场景,并对通往园区路口改为619
+ if (statusInf.hdMapVer != null && statusInf.hdMapVer.isNotEmpty()) {
+ //对地图版本进行截取
+ val city = statusInf.hdMapVer.substringAfter(".sqlite|").substringBefore("|")
+ val version = statusInf.hdMapVer.substringAfter("$city|").substringBefore("|")
+ AppConfigInfo.adHdMapVersion = "${city}_${version}"
+ updateAdHdMapVersion()
+ }
+ }
+
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt
index 1d1b659df3..8b4e320bed 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SystemVersionView.kt
@@ -53,6 +53,7 @@ class SystemVersionView @JvmOverloads constructor(
private var previousProgress: Int = -1 //前一秒的下载进度,用于计算下载剩余时间
private var currentProgress: Int = -1 //当前已下载包体大小
+ @Volatile
private var isHDCached = false
init {
@@ -67,7 +68,7 @@ class SystemVersionView @JvmOverloads constructor(
//鹰眼版本视图点击事件
ivPadVersion.setOnClickListener {
- hmiAction("$M_HMI$$TAG", "pad version view clicked")
+ hmiAction("$M_HMI$TAG", "pad version view clicked")
val provider = CallerDevaToolsManager.upgradeProvider()
if (provider?.isDownloading() == true) {
ToastUtils.showShort("正在下载最新版本,请稍候再试...")
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_item.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_item.png
new file mode 100644
index 0000000000..f64a10ace6
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_item.png differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_switch.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_switch.png
new file mode 100644
index 0000000000..5ea67d1d2f
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bg_tab_switch.png differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bone_tab_bg.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bone_tab_bg.png
deleted file mode 100644
index 68bff3e346..0000000000
Binary files a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/bone_tab_bg.png and /dev/null differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/icon_red_notice.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/icon_red_notice.png
new file mode 100644
index 0000000000..ead29a385c
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-nodpi/icon_red_notice.png differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_tab_car_no.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_tab_car_no.xml
new file mode 100644
index 0000000000..4325856259
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_tab_car_no.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_tab.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_tab.xml
index 0b557c5c29..2a1cd0bc83 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_tab.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_bone_tab.xml
@@ -29,7 +29,7 @@
android:layout_width="match_parent"
android:layout_height="@dimen/dp_224"
android:layout_marginBottom="@dimen/dp_m_2"
- android:background="@drawable/bone_tab_bg"
+ android:background="@drawable/bg_tab_switch"
android:elevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_car_info_tab.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_car_info_tab.xml
index feb35276a6..71785f63ad 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_car_info_tab.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_car_info_tab.xml
@@ -4,91 +4,223 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/background_color">
+ android:background="@drawable/bg_tab_item">
-
+ android:layout_height="match_parent">
-
-
-
-
-
+ android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/dp_21">
-
+
-
+
-
+
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml
index 2e6a7ccd9f..d4e789045a 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/color.xml
@@ -16,7 +16,9 @@
#3700B3
#03DAC5
#000000
+ #B3000000
#8F0005
+ #2EACFF
#FF0006
#0099dd
#FFFFFF
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml
index d001c4cdd4..923678eb39 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/strings.xml
@@ -6,6 +6,13 @@
登陆信息
退出
车辆绑定
+ 版本信息
+ 设备SN
+ PAD:
+ AD:
+ HDMAP:
+ ADMAP:
+ 检查更新
最小化
日志
diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt
index 711da1b560..8eeabaea5b 100644
--- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt
+++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/deva/chain/ChainConstant.kt
@@ -67,6 +67,7 @@ class ChainConstant {
const val CHAIN_CODE_ADAS_P_OBJECTS = "CHAIN_CODE_ADAS_P_OBJECTS"
const val CHAIN_CODE_ADAS_P_ACTIONS = "CHAIN_CODE_ADAS_P_ACTIONS"
const val CHAIN_CODE_ADAS_STATUS_QUERY_RESP = "CHAIN_CODE_ADAS_STATUS_QUERY_RESP"
+ const val CHAIN_CODE_ADAS_SYSTEM_STATUS = "CHAIN_CODE_ADAS_SYSTEM_STATUS"
const val CHAIN_CODE_ADAS_PARALLEL = "CHAIN_CODE_ADAS_PARALLEL"
const val CHAIN_CODE_ADAS_MAP_PARAM = "CHAIN_CODE_ADAS_MAP_PARAM"
const val CHAIN_CODE_ADAS_V2N_EVENT = "CHAIN_CODE_ADAS_V2N_EVENT"