@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user