1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -14,6 +14,7 @@
|
||||
<entry key="../../../../../../layout/custom_preview.xml" value="0.390625" />
|
||||
<entry key="../../../../../layout/custom_preview.xml" value="0.19947916666666668" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml" value="0.15572916666666667" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.8466666666666667" />
|
||||
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="0.5" />
|
||||
<entry key="modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml" value="0.22125" />
|
||||
<entry key="modules/mogo-module-adas/src/main/res/layout/dialog_adas_dispatch_remind.xml" value="0.22658490296325878" />
|
||||
|
||||
@@ -8,14 +8,15 @@ import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.function.hmi.notification.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.V2XNotificationView
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.module.common.enums.EventTypeEnum
|
||||
import com.mogo.utils.logger.Logger
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
|
||||
@@ -28,9 +29,48 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
MoGoWarningContract.View {
|
||||
|
||||
var mWarningFloat: WarningFloat.Builder? = null
|
||||
var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
override fun initViews() {
|
||||
autopilotStatus.visibility = View.VISIBLE
|
||||
autopilotStatus.setOnLongClickListener {
|
||||
activity?.let {
|
||||
val debugSettingView = DebugSettingView(it)
|
||||
|
||||
if (mDebugSettingViewFloat != null) {
|
||||
WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false)
|
||||
mDebugSettingViewFloat = null
|
||||
} else {
|
||||
mDebugSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(debugSettingView)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, offsetY = 80)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting;
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -6,6 +17,36 @@ package com.mogo.eagle.core.function.hmi.ui.setting;
|
||||
* 调试使用的设置页面,这里制作为调试使用
|
||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||
*/
|
||||
public class DebugSettingView {
|
||||
class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener {
|
||||
|
||||
}
|
||||
private val TAG = "DebugSettingView"
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_debug_setting, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerObuListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerObuListenerManager.removeListener(TAG)
|
||||
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfo()
|
||||
}
|
||||
|
||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,10 +30,8 @@
|
||||
android:layout_height="@dimen/module_mogo_autopilot_status_bg_height"
|
||||
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/flSpeedChartView"
|
||||
app:layout_constraintTop_toBottomOf="@+id/flSpeedChartView"
|
||||
tools:visibility="visible" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/flSpeedChartView" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="@dimen/dp_600"
|
||||
android:layout_height="@dimen/dp_600"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitleObu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OBU状态"
|
||||
android:textColor="#000"
|
||||
android:textSize="@dimen/dp_30"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvObuInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintEnd_toEndOf="@+id/tvTitleObu"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvTitleObu"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvTitleObu" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -58,7 +58,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
override fun onConnected() {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onConnected ------> ")
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
|
||||
@@ -80,7 +80,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
|
||||
@@ -107,14 +107,14 @@ class MogoPrivateObuManager private constructor() {
|
||||
mObuStatusInfo.appInfo = info.app_info
|
||||
mObuStatusInfo.hliInfo = info.hli_info
|
||||
mObuStatusInfo.otherInfo = info.other_info
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
}
|
||||
|
||||
// (2) 车辆信息:CVX_HV_INFO_IND
|
||||
override fun onCvxHvInfoIndInfo(info: CvxHvInfoIndInfo?) {
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", true) }
|
||||
mObuStatusInfo.obuHvStatus = true
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxHvInfoIndInfo ------> $info")
|
||||
if (info != null && info.basic_info != null && info.basic_info.position != null) {
|
||||
val movingObjectInfo = info.basic_info
|
||||
@@ -164,7 +164,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
override fun onCvxRvInfoIndInfo(info: CvxRvInfoIndInfo) {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxRvInfoIndInfo ------> $info")
|
||||
mObuStatusInfo.obuRvStatus = true
|
||||
CallerObuListenerManager.invokeCheckAutoPilotBtnListener(mObuStatusInfo)
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", true) }
|
||||
// 更新数据
|
||||
TrafficDataConvertUtils.cvxRvInfoIndInfo2TrafficData(info)?.let {
|
||||
|
||||
@@ -4,6 +4,7 @@ import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
|
||||
/**
|
||||
@@ -16,15 +17,23 @@ object CallerObuListenerManager : CallerBase() {
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo()
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val mObuStatusListeners: HashMap<String, IMoGoObuStatusListener> = HashMap()
|
||||
|
||||
/**
|
||||
* 查询OBU状态
|
||||
*/
|
||||
fun getObuStatusInfo(): String {
|
||||
return GsonUtils.toJson(mObuStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加自动驾驶按钮选中监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addCheckAutoPilotBtnListener(
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoObuStatusListener
|
||||
) {
|
||||
@@ -33,18 +42,30 @@ object CallerObuListenerManager : CallerBase() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* 删除 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeCheckAutoPilotBtnListener(@Nullable tag: String) {
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
mObuStatusListeners.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发自动驾驶按钮选中监听
|
||||
* @param isChecked 选中状态
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun invokeCheckAutoPilotBtnListener(obuStatusInfo: ObuStatusInfo) {
|
||||
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
|
||||
mObuStatusListeners.forEach {
|
||||
if (it.value == listener) {
|
||||
mObuStatusListeners.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 触发自动驾驶按钮选中监听
|
||||
* @param obuStatusInfo 选中状态
|
||||
*/
|
||||
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
|
||||
LogUtils.dTag(TAG, "isChecked:$obuStatusInfo")
|
||||
mObuStatusInfo = obuStatusInfo
|
||||
mObuStatusListeners.forEach {
|
||||
|
||||
Reference in New Issue
Block a user