add func of take over view and fix bug of tts speak

This commit is contained in:
zhongchao
2022-09-20 19:11:27 +08:00
parent b94325b343
commit f25f909efc
9 changed files with 91 additions and 25 deletions

View File

@@ -1384,33 +1384,45 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
* 工控机监控节点上报
*/
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
guardianInfo?.let {
if (reportList.size > 49) {
reportList.removeLast()
}
reportList.add(
0,
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
)
)
}
ThreadUtils.runOnUiThread {
reportListFloatWindow?.refreshData(reportList)
guardianInfo?.let {
when (it.code) {
EXIT_AUTOPILOT_FOR_PLANNING,
EXIT_AUTOPILOT_FOR_LOCATION,
EXIT_AUTOPILOT_FOR_CHASSIS,
EXIT_AUTOPILOT_FOR_DISTANCE-> {
//todo test
EXIT_AUTOPILOT_FOR_DISTANCE -> {
showWarningV2X(
EventTypeEnum.TAKE_OVER_EVENT.poiType,
EventTypeEnum.TAKE_OVER_EVENT.content,
EventTypeEnum.TAKE_OVER_EVENT.tts,
EventTypeEnum.TAKE_OVER_EVENT.poiType,
object : IMoGoWarningStatusListener {
override fun onShow() {
clTakeOverView.visibility = View.VISIBLE
}
postOnMainThread(6_000L) {
}
override fun onDismiss() {
clTakeOverView.visibility = View.GONE
}
},
true,
6000L
)
}
}
if (reportList.size > 49) {
reportList.removeLast()
}
reportList.add(
0,
ReportEntity(
TimeUtils.millis2String(System.currentTimeMillis()),
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
)
)
reportListFloatWindow?.refreshData(reportList)
}
}
}

View File

@@ -0,0 +1,18 @@
package com.mogo.eagle.core.function.hmi.ui.takeover
import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.hmi.R
class TakeOverView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
init {
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 399 KiB

View File

@@ -48,6 +48,16 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
android:id="@+id/clTakeOverView"
android:visibility="gone"
android:layout_width="@dimen/hmi_take_over_request_width"
android:layout_height="@dimen/hmi_take_over_request_height"
android:layout_marginTop="@dimen/hmi_take_over_request_m_top"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--自动驾驶按钮及状态-->
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
android:id="@+id/viewAutopilotStatus"
@@ -186,8 +196,8 @@
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_110"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--APP、MAP版本-->
<com.mogo.eagle.core.function.hmi.ui.widget.VersionNameView
@@ -203,10 +213,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="30px"
app:layout_constraintTop_toTopOf="@+id/viewLimitingVelocity"
app:layout_constraintEnd_toStartOf="@+id/viewLimitingVelocity"
app:layout_goneMarginTop="30px"
app:layout_goneMarginEnd="40px"/>
app:layout_constraintTop_toTopOf="@+id/viewLimitingVelocity"
app:layout_goneMarginEnd="40px"
app:layout_goneMarginTop="30px" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- app:layout_constraintBottom_toBottomOf="parent"-->

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="@dimen/hmi_take_over_request_width"
android:layout_height="@dimen/hmi_take_over_request_height">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/icon_take_over_request"
tools:ignore="ContentDescription" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -66,4 +66,7 @@
<dimen name="module_mogo_och_margin_left">40px</dimen>
<dimen name="module_mogo_och_margin_bottom">46px</dimen>
<dimen name="hmi_take_over_request_width">810px</dimen>
<dimen name="hmi_take_over_request_height">560px</dimen>
<dimen name="hmi_take_over_request_m_top">524px</dimen>
</resources>

View File

@@ -65,4 +65,8 @@
<dimen name="module_mogo_och_autopilot_status_text_size">42px</dimen>
<dimen name="module_mogo_och_margin_left">40px</dimen>
<dimen name="module_mogo_och_margin_bottom">46px</dimen>
<dimen name="hmi_take_over_request_width">810px</dimen>
<dimen name="hmi_take_over_request_height">560px</dimen>
<dimen name="hmi_take_over_request_m_top">524px</dimen>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -111,6 +111,12 @@ enum class EventTypeEnum(
GHOST_PROBE("10024", "前方盲区行人预警", "前方盲区行人预警", R.drawable.icon_warning_v2x_pedestrian_crossing,
"前方盲区行人通行,请注意", "前方盲区即将有行人通过,请减速慢行"),
//接管
TAKE_OVER_EVENT(
"20000", "注意周围、立即接管", "注意周围、立即接管", R.drawable.icon_warning_take_over,
"注意周围、立即接管", "自动驾驶退出请立即接管"
),
// 前方静止or慢速车辆报警
ALERT_FRONT_CAR("99999"),
@@ -357,8 +363,8 @@ enum class EventTypeEnum(
tts = ""
),
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯请优先通行"),
TYPE_VIP_ERROR_IDENTIFICATION("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败请稍后重试"),
TYPE_VIP_IDENTIFICATION("10022", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "VIP车辆优先通行", "已为您变灯请优先通行"),
TYPE_VIP_ERROR_IDENTIFICATION("10023", "", "", R.drawable.icon_warning_v2x_vip_turn_light, "请求失败,", "请求失败请稍后重试"),
TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线");