[2.13.0-arch-opt] merge
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -120,7 +120,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
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"
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
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"
|
||||
@@ -223,7 +223,7 @@
|
||||
tools:visibility="gone" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -233,7 +233,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--刹车ui-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.BrakeViewStatus
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.BrakeViewStatus
|
||||
android:id="@+id/brakeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -243,7 +243,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
android:layout_marginTop="@dimen/dp_80"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -63,7 +63,7 @@
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
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"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
@@ -177,7 +177,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TakeOverView
|
||||
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"
|
||||
|
||||
@@ -218,11 +218,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.content,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.tts
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -258,11 +254,7 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
content,
|
||||
tts,
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
tts
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,15 +211,13 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_EXTEND.tts
|
||||
)
|
||||
} else {
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.content,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_IDENTIFICATION_PASS.tts
|
||||
)
|
||||
}
|
||||
return@turnLightToGreen
|
||||
@@ -230,8 +228,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + ", 稍后重试",
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts
|
||||
)
|
||||
return@turnLightToGreen
|
||||
}
|
||||
@@ -251,8 +248,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
showWarning(
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.content + time,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts,
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.poiType
|
||||
EventTypeEnumNew.TYPE_VIP_ERROR_IDENTIFICATION.tts
|
||||
)
|
||||
} else {
|
||||
CallerLogger.d(
|
||||
@@ -272,7 +268,6 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
v2xType: String,
|
||||
alertContent: CharSequence,
|
||||
ttsContent: String,
|
||||
tag: String
|
||||
) {
|
||||
if (alertContent.toString().isEmpty() || ttsContent.isEmpty()) {
|
||||
Log.d("MsgBox-VipCarManager", "alertContent或ttsContent为空!")
|
||||
@@ -280,15 +275,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(MsgBoxType.V2X, V2XMsg(v2xType, alertContent.toString(), ttsContent))
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType, alertContent, ttsContent, tag,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {}
|
||||
override fun onDismiss() {}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
)
|
||||
CallerHmiManager.warningV2X(v2xType, alertContent, ttsContent)
|
||||
}
|
||||
|
||||
fun destroy() {
|
||||
|
||||
@@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.datacenter.obu
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
@@ -98,7 +98,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
val status = rsiWarningData.status
|
||||
val level = rsiWarningData.warningMsgList[0].warningLevel
|
||||
val direction = getMessageDirection(rsiWarningData.warningMsgList[0].targetPosition)
|
||||
CallerLogger.d("${M_OBU}${TAG}",
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuDcRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${rsiWarningData.warningMsgList[0].eventSerialNum} ---signSerialNum = ${rsiWarningData.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${rsiWarningData.warningMsgList[0].targetPosition}"
|
||||
)
|
||||
|
||||
@@ -277,15 +278,12 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
|
||||
// 更新数据,是否需要
|
||||
@@ -302,8 +300,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 移除顶部弹窗
|
||||
CallerHmiManager.disableWarningV2X((appId + direction.direction))
|
||||
// 更新数据,删除标牌?
|
||||
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
|
||||
// ?.let {
|
||||
@@ -351,7 +347,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${rsmWarningData.warningMsg.warningDataList.get(0).status} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
|
||||
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
|
||||
rsmWarningData.warningMsg.warningDataList.get(
|
||||
0
|
||||
).status
|
||||
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
|
||||
)
|
||||
|
||||
when (rsmWarningData.warningMsg.warningDataList.get(0).status) {
|
||||
@@ -374,17 +374,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_NON
|
||||
CallerHmiManager.dismissWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_ALL
|
||||
)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
|
||||
// 更新数据 TODO
|
||||
@@ -426,7 +423,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
* 红绿灯预警信息
|
||||
*/
|
||||
fun onMogoObuDcSpatWarning(spatWarningData: SpatWarningData?) {
|
||||
CallerLogger.d("${M_OBU}${TAG}", "onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}")
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}"
|
||||
)
|
||||
handlerTrafficLight(
|
||||
spatWarningData!!.warningType,
|
||||
spatWarningData?.status,
|
||||
@@ -438,22 +438,36 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
* 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道
|
||||
*/
|
||||
fun onMogoObuMapMath(data: MapMatchData?) {
|
||||
CallerLogger.d("${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView)
|
||||
if(HmiBuildConfig.isShowObuLimitSpeedView) {
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView
|
||||
)
|
||||
if (HmiBuildConfig.isShowObuLimitSpeedView) {
|
||||
if (data != null) {
|
||||
CallerLogger.d("${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}")
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
|
||||
Math.round(
|
||||
(data.speedMaxLimit * 0.02 * 3.6)
|
||||
)
|
||||
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU)
|
||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU)
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,7 +510,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
/**
|
||||
* 处理红绿灯
|
||||
*/
|
||||
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<ObuWarningEvent.SpatLight>) {
|
||||
private fun handlerTrafficLight(
|
||||
appId: Int,
|
||||
status: Int,
|
||||
lights: List<ObuWarningEvent.SpatLight>
|
||||
) {
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
|
||||
@@ -514,7 +532,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 移除顶部弹窗,当收不到信号的时候触发一次
|
||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isShowGreenWave = false
|
||||
isShowRunRedLight = false
|
||||
}
|
||||
@@ -551,10 +568,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
|
||||
if (!isShowRunRedLight) {
|
||||
isShowRunRedLight = true
|
||||
CallerHmiManager.disableWarningV2X(1667.toString())
|
||||
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
CallerLogger.d("${M_OBU}${TAG}","MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent ")
|
||||
ttsContent =
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
alertContent =
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent "
|
||||
)
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
@@ -569,22 +590,32 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L)
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次
|
||||
if (!isShowGreenWave) {
|
||||
isShowGreenWave = true
|
||||
CallerHmiManager.disableWarningV2X(1666.toString())
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}")
|
||||
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
|
||||
)
|
||||
val adviceSpeed =
|
||||
"${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}"
|
||||
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
|
||||
Math.round(
|
||||
currentLight.suggestMaxSpeed * 3.6 * 0.02
|
||||
)
|
||||
}"
|
||||
val adviceSpeedTts =
|
||||
"${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}"
|
||||
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
|
||||
Math.round(
|
||||
currentLight.suggestMaxSpeed * 3.6 * 0.02
|
||||
)
|
||||
}"
|
||||
|
||||
ttsContent =
|
||||
String.format(
|
||||
@@ -596,7 +627,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
|
||||
adviceSpeed
|
||||
)
|
||||
val maxSpeed = currentLight.suggestMaxSpeed*3.6
|
||||
val maxSpeed = currentLight.suggestMaxSpeed * 3.6
|
||||
if (maxSpeed > 0) {
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
@@ -614,11 +645,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
ttsContent// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -628,37 +655,46 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
when (currentLight.light) {
|
||||
// 灯光不可用
|
||||
0 -> {
|
||||
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.BLACK, DataSourceType.TELEMATIC)
|
||||
CallerTrafficLightListenerManager.showTrafficLight(
|
||||
TrafficLightEnum.BLACK,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
}
|
||||
|
||||
// 红灯
|
||||
2, 3 -> {
|
||||
2, 3 -> { //todo 小鹏
|
||||
if (!isRedLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.RED, DataSourceType.TELEMATIC)
|
||||
CallerTrafficLightListenerManager.showTrafficLight(
|
||||
TrafficLightEnum.RED,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
val red = currentLight.countDown / 10
|
||||
CallerTrafficLightListenerManager.changeCountdownRed(red)
|
||||
}
|
||||
|
||||
// 绿灯
|
||||
4, 5, 6 -> {
|
||||
4, 5, 6 -> { //todo 小鹏
|
||||
if (!isGreenLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.GREEN, DataSourceType.TELEMATIC)
|
||||
CallerTrafficLightListenerManager.showTrafficLight(
|
||||
TrafficLightEnum.GREEN,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
val green = currentLight.countDown / 10
|
||||
CallerTrafficLightListenerManager.changeCountdownGreen(green)
|
||||
}
|
||||
|
||||
// 黄灯
|
||||
7, 8 -> {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.YELLOW, DataSourceType.TELEMATIC)
|
||||
CallerTrafficLightListenerManager.showTrafficLight(
|
||||
TrafficLightEnum.YELLOW,
|
||||
DataSourceType.TELEMATIC
|
||||
)
|
||||
val yellow = currentLight.countDown / 10
|
||||
CallerTrafficLightListenerManager.changeCountdownYellow(yellow)
|
||||
}
|
||||
|
||||
@@ -410,15 +410,12 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
|
||||
// 更新数据
|
||||
@@ -573,17 +570,14 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_NON
|
||||
CallerHmiManager.dismissWarning(
|
||||
WarningDirectionEnum.ALERT_WARNING_ALL
|
||||
)
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -844,7 +838,6 @@ private fun handleSdkObu(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(appId + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
@@ -855,14 +848,12 @@ private fun handleSdkObu(
|
||||
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
if (changeVisualAngle) {
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
@@ -910,7 +901,6 @@ private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 移除顶部弹窗
|
||||
CallerTrafficLightListenerManager.disableTrafficLight()
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isShowGreenWave = false
|
||||
isShowRunRedLight = false
|
||||
isYellowLight = false
|
||||
@@ -956,7 +946,6 @@ private fun changeTrafficLightStatus(
|
||||
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
|
||||
if (!isShowRunRedLight) {
|
||||
isShowRunRedLight = true
|
||||
CallerHmiManager.disableWarningV2X(1667.toString())
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"changeTrafficLightStatus 闯红灯 --------> "
|
||||
@@ -981,11 +970,7 @@ private fun changeTrafficLightStatus(
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
ttsContent// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -993,7 +978,6 @@ private fun changeTrafficLightStatus(
|
||||
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
|
||||
if (!isShowGreenWave) {
|
||||
isShowGreenWave = true
|
||||
CallerHmiManager.disableWarningV2X(1666.toString())
|
||||
|
||||
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
|
||||
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
|
||||
@@ -1038,11 +1022,7 @@ private fun changeTrafficLightStatus(
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null,
|
||||
true,
|
||||
5000L
|
||||
ttsContent// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1056,8 +1036,7 @@ private fun changeTrafficLightStatus(
|
||||
}
|
||||
// 红灯
|
||||
2, 3 -> {
|
||||
if (!isRedLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
if (!isRedLight) { //todo 小鹏
|
||||
isRedLight = true
|
||||
}
|
||||
isGreenLight = false
|
||||
@@ -1067,9 +1046,8 @@ private fun changeTrafficLightStatus(
|
||||
}
|
||||
|
||||
// 绿灯
|
||||
4, 5, 6 -> {
|
||||
4, 5, 6 -> { //todo 小鹏
|
||||
if (!isGreenLight) {
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
isGreenLight = true
|
||||
}
|
||||
isRedLight = false
|
||||
@@ -1085,7 +1063,6 @@ private fun changeTrafficLightStatus(
|
||||
}
|
||||
isRedLight = false
|
||||
isGreenLight = false
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.YELLOW)
|
||||
val yellow = currentLight.countDown.toInt()
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.mogo.eagle.core.data.bindingcar.BindingCarInfo
|
||||
import com.mogo.eagle.core.data.bindingcar.BindingCarRequest
|
||||
import com.mogo.eagle.core.data.bindingcar.ModifyBindingcarInfo
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager.changeCurrentIcon
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil
|
||||
@@ -79,8 +79,8 @@ class BindingCarNetWorkManager private constructor() {
|
||||
//根据车辆类型切换不同的车辆模型,只针对红旗做处理
|
||||
updateCarVrIconRes(info.getData().brandId)
|
||||
when (info.getData().compare) {
|
||||
"0" -> showBindingcarDialog()
|
||||
"3" -> showModifyBindingcarDialog()
|
||||
"0" -> showBindingCarDialog()
|
||||
"3" -> showModifyBindingCarDialog()
|
||||
"null" -> TipToast.shortTip("当前工控机没有入库")
|
||||
}
|
||||
SharedPrefsMgr.getInstance(context!!).putString(
|
||||
|
||||
@@ -157,14 +157,6 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!--转向灯和刹车-->
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.TurnLightBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="com.hmi.turnlight" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!--绑定车辆-->
|
||||
<receiver android:name="com.mogo.eagle.core.function.hmi.receiver.BindingcarBroadcastReceiver">
|
||||
<intent-filter>
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.mogo.eagle.core.function.hmi.receiver
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingcarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBindingCarDialog
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showModifyBindingCarDialog
|
||||
|
||||
/**
|
||||
* 绑定车辆
|
||||
@@ -31,9 +31,9 @@ class BindingcarBroadcastReceiver : BroadcastReceiver() {
|
||||
type: Int
|
||||
) {
|
||||
if (type == 1) {
|
||||
showBindingcarDialog()
|
||||
showBindingCarDialog()
|
||||
} else if (type == 2) {
|
||||
showModifyBindingcarDialog()
|
||||
showModifyBindingCarDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.receiver
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
|
||||
|
||||
/**
|
||||
* 转向灯,刹车
|
||||
*
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class TurnLightBroadcastReceiver : BroadcastReceiver() {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "TurnLightBroadcastReceiver"
|
||||
}
|
||||
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
try {
|
||||
val type = intent.getIntExtra("type", 0)
|
||||
val lightInt = intent.getIntExtra("light", 0)
|
||||
showTurnLight(type, lightInt)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun showTurnLight( //type 1,转向灯,2刹车
|
||||
type: Int,
|
||||
lightInt: Int
|
||||
) {
|
||||
if (type == 1) {
|
||||
showTurnLight(lightInt) //设置转向灯
|
||||
} else if (type == 2) {
|
||||
showBrakeLight(lightInt) //设置刹车信息
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
)
|
||||
if (v2xIsShow) {
|
||||
// 分发场景
|
||||
dispatchShowWaring(v2xType, alertContent, ttsContent, tag)
|
||||
dispatchShowWaring(v2xType, alertContent, ttsContent)
|
||||
} else {
|
||||
dispatchCloseWaring(tag)
|
||||
}
|
||||
@@ -75,7 +75,6 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
v2xType: Int,
|
||||
alertContent: String?,
|
||||
ttsContent: String?,
|
||||
tag: String?
|
||||
) {
|
||||
if (EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType == v2xType.toString()) {
|
||||
CallerViewLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(1,DataSourceType.MAP)
|
||||
@@ -90,7 +89,6 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
)
|
||||
)
|
||||
//预留调试入口
|
||||
CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent,
|
||||
tag, null, true, 5000L)
|
||||
CallerHmiManager.warningV2X(v2xType.toString(), alertContent, ttsContent)
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.AlphaAnimation
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
@@ -34,33 +29,26 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.dispatch.DispatchDialogManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.IPCReportWindow
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.eagle.core.function.main.DisplayEffectsHelper
|
||||
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
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.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.reminder.api.IReminder
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
import kotlinx.android.synthetic.main.fragment_hmi.*
|
||||
import kotlinx.coroutines.*
|
||||
@@ -83,39 +71,9 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
private val lastSpeakJob by lazy { AtomicReference<Job>() }
|
||||
private var lastShowV2XJob: Job? = null
|
||||
|
||||
private var showingV2XTip: IReminder? = null
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 工控机重启返回结果
|
||||
* @param code
|
||||
* @param msg
|
||||
*/
|
||||
override fun showDockerRebootResult(code: Int, msg: String) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (code >= -1) {
|
||||
//重启成功
|
||||
ToastUtils.showShort("重启成功")
|
||||
} else {
|
||||
//重启失败
|
||||
msg.let {
|
||||
ToastUtils.showShort(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 展示工控机监控上报数据
|
||||
* @param errorReportList 错误级别上报数据列表
|
||||
* @param warningReportList 提醒级别上报数据列表
|
||||
* @param reportLevel 1:error级别 2:warning级别
|
||||
*/
|
||||
override fun showIPCReportWindow(
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
@@ -193,7 +151,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listener: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
expireTime: Long
|
||||
@@ -204,20 +161,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
val warningContent = alertContent
|
||||
?: EventTypeEnumNew.getWarningContent(v2xType)
|
||||
|
||||
//占道施工预警
|
||||
if (v2xType == "10006" || v2xType == "100061") {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val oldTime =
|
||||
context?.let { it -> SharedPrefsMgr.getInstance(it).getLong("roadwork", 0) }
|
||||
if (currentTime - oldTime!! > 60) { //超过一分钟,才会继续播报重复提醒
|
||||
context?.let { it ->
|
||||
SharedPrefsMgr.getInstance(it)
|
||||
.putLong("roadwork", System.currentTimeMillis() / 1000)
|
||||
}
|
||||
CallerAutoPilotControlManager.sendTripInfo(5, "", "", "", false)
|
||||
}
|
||||
}
|
||||
|
||||
if (warningContent.isEmpty()) {
|
||||
CallerLogger.e("$M_HMI$TAG", "Show warningContent is null or empty!")
|
||||
return
|
||||
@@ -232,22 +175,18 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
delay(expireTime)
|
||||
}.also { itx ->
|
||||
lastShowV2XJob = itx
|
||||
}.invokeOnCompletion { _ ->
|
||||
}.invokeOnCompletion {
|
||||
listener?.onDismiss()
|
||||
showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
|
||||
}
|
||||
|
||||
if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) {
|
||||
val last = lastSpeakJob.get()
|
||||
Log.d("CODE", "---- 0 ------: last: $last")
|
||||
if (last != null && !last.isCompleted) {
|
||||
Log.d("CODE", "---- 1 ------")
|
||||
return
|
||||
}
|
||||
lifecycleScope.launch(Dispatchers.Default) {
|
||||
Log.d("CODE", "---- 2 ------")
|
||||
speak(it, ttsContent)
|
||||
Log.d("CODE", "---- 3 ------")
|
||||
}.also { itx ->
|
||||
lastSpeakJob.set(itx)
|
||||
}
|
||||
@@ -274,150 +213,73 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
AIAssist.getInstance(ctx).speakTTSVoiceWithLevel(text, AIAssist.LEVEL2, voiceCallback)
|
||||
} catch (t: Throwable) {
|
||||
it.resumeWith(Result.success(Unit))
|
||||
CallerLogger.d("$M_HMI$TAG", t.message)
|
||||
CallerLogger.w("$M_HMI$TAG", t.message)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指定floatTag 的 VR下V2X预警弹窗
|
||||
* @param tag 弹窗标识
|
||||
*/
|
||||
override fun disableWarningV2X(tag: String?) {
|
||||
activity?.let {
|
||||
WarningFloat.dismiss(tag)
|
||||
}
|
||||
CallerLogger.d("$M_HMI$TAG", "--- disableWarningV2X ---")
|
||||
lifecycleScope.launch {
|
||||
showingV2XTip?.takeIf { it.isShowing() }?.also { it.hide() }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
override fun showWarning(direction: WarningDirectionEnum) {
|
||||
CallerLogger.d(TAG, "showWarning====")
|
||||
flV2XWarningView?.showWarning(direction)
|
||||
if (flV2XWarningView != null) {
|
||||
flicker(flV2XWarningView)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 闪动动画
|
||||
*/
|
||||
fun flicker(view: View) {
|
||||
val alphaAnimation = AlphaAnimation(0f, 0.88f)
|
||||
alphaAnimation.duration = 600
|
||||
alphaAnimation.interpolator = LinearInterpolator()
|
||||
alphaAnimation.repeatCount = Animation.INFINITE
|
||||
alphaAnimation.repeatMode = Animation.REVERSE
|
||||
view.startAnimation(alphaAnimation)
|
||||
}
|
||||
|
||||
fun clearAnimation(view: View) {
|
||||
view.clearAnimation()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
override fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
flV2XWarningView?.showWarning(direction, closeTime)
|
||||
flicker(flV2XWarningView)
|
||||
}
|
||||
|
||||
override fun dismissWarning(direction: WarningDirectionEnum) {
|
||||
flV2XWarningView?.dismissWarning(direction)
|
||||
clearAnimation(flV2XWarningView)
|
||||
}
|
||||
|
||||
/** todo----------------------------------------------- **/
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||
context?.let {
|
||||
DispatchDialogManager.getInstance(it).showDialog(msgData)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun dismissDispatchDialog() {
|
||||
context?.let {
|
||||
DispatchDialogManager.getInstance(it).releaseDialog()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 展示云公告交警详情
|
||||
* @param trafficStylePushData
|
||||
*/
|
||||
override fun showNoticeForTrafficWithData(trafficStylePushData: NoticeTrafficStylePushData?) {
|
||||
if (trafficStylePushData == null) {
|
||||
return
|
||||
}
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let {
|
||||
NoticeTrafficDialog.show(it, trafficStylePushData)
|
||||
trafficStylePushData?.let {
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let { it ->
|
||||
NoticeTrafficDialog.show(it, trafficStylePushData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 展示云公告详情
|
||||
*/
|
||||
override fun showNoticeNormalData(normalData: NoticeNormalData?) {
|
||||
if (normalData == null) {
|
||||
return
|
||||
}
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let {
|
||||
NoticeCheckDialog.show(it, normalData)
|
||||
normalData?.let {
|
||||
ThreadUtils.runOnUiThread {
|
||||
context?.let { it ->
|
||||
NoticeCheckDialog.show(it, normalData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun startRoadCameraLive(flvUrl: String) {
|
||||
cameraLiveView.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showNoSignView() {
|
||||
cameraLiveView.showNoSignView()
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showToolsView() {
|
||||
toolsView.showToolsFloat(context)
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun hideToolsView() {
|
||||
toolsView.dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
@BizConfig(V2I, "", BIZ_RTS)
|
||||
override fun showVideoDialog(infList: List<Infrastructure>) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
@@ -427,125 +289,18 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
/** todo----------------------------------------------- **/
|
||||
private var isLeftLight: Boolean = false
|
||||
private var isRightLight: Boolean = false
|
||||
private var isDisappare: Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var isVisualAngleChanged = false
|
||||
|
||||
/**
|
||||
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
|
||||
*/
|
||||
override fun showTurnLight(light: Int) {
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight = $light ---isLeftLight = $isLeftLight ---isRightLight = $isRightLight"
|
||||
)
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1 || light == 2) {
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged = true
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(true))
|
||||
}
|
||||
} else {
|
||||
if (isVisualAngleChanged) {
|
||||
isVisualAngleChanged = false
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(false))
|
||||
}
|
||||
}
|
||||
if (light == 1) { //左转灯
|
||||
if (!isLeftLight) {
|
||||
isLeftLight = true
|
||||
isRightLight = false
|
||||
isDisappare = false
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light = 1"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
} else if (light == 2) { //右转灯
|
||||
if (!isRightLight) {
|
||||
isRightLight = true
|
||||
isLeftLight = false
|
||||
isDisappare = false
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light = 2"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
} else {
|
||||
if (!isDisappare) { //默认 不亮灯
|
||||
isDisappare = true
|
||||
isLeftLight = false
|
||||
isRightLight = false
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"TurnLight"}",
|
||||
"---showTurnLight ---light other"
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var isBrake: Boolean = false
|
||||
|
||||
/**
|
||||
* 显示刹车效果
|
||||
*/
|
||||
override fun showBrakeLight(light: Int) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (light == 1) { //刹车灯亮
|
||||
if (!isBrake) {
|
||||
isBrake = true
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"BrakeLight"}",
|
||||
" showBrakeLight light = 1 "
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
|
||||
}
|
||||
} else {
|
||||
if (isBrake) {//默认 不亮灯
|
||||
isBrake = false
|
||||
CallerLogger.d(
|
||||
"${SceneConstant.M_DEVA}${"BrakeLight"}",
|
||||
" showBrakeLight light != 1 "
|
||||
)
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
//brakeView.setBrakeLight(light)
|
||||
}
|
||||
}
|
||||
/** todo----------------------------------------------- **/
|
||||
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showToBindingcarDialog() {
|
||||
if (ContextHolderUtil.getContext() != null) {
|
||||
ToBindingCarDialog.show(ContextHolderUtil.getContext())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showModifyBindingcarDialog() {
|
||||
if (ContextHolderUtil.getContext() != null) {
|
||||
ModifyBindingCarDialog.show(ContextHolderUtil.getContext())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 升级app弹框
|
||||
*/
|
||||
override fun showUpgradeDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
@@ -556,22 +311,11 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
if (ContextHolderUtil.getContext() != null) {
|
||||
UpgradeAppDialog.show(
|
||||
ContextHolderUtil.getContext(),
|
||||
name,
|
||||
url,
|
||||
title,
|
||||
content,
|
||||
installType
|
||||
name, url, title, content, installType
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
* 工控机镜像升级确认窗
|
||||
* @param images 镜像列表
|
||||
* @param padSn SN
|
||||
* @param releaseId 任务ID
|
||||
*/
|
||||
override fun showAdUpgradeDialog(images: List<String>, padSn: String, releaseId: String) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (ContextHolderUtil.getContext() != null) {
|
||||
@@ -580,9 +324,6 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ok
|
||||
*/
|
||||
override fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
toolsView.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
@@ -632,8 +373,4 @@ class MoGoHmiFragment : MvpFragment<MoGoHmiContract.View?, HmiPresenter?>(),
|
||||
?.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerLogger.d("$M_HMI$TAG", "onDestroy")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.dispatch;
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice;
|
||||
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_EZHOU;
|
||||
import static com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean.DISPATCH_SOURCE_HENGYANG;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.bindingcar
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.turnlight
|
||||
package com.mogo.eagle.core.function.hmi.ui.vehicle
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ObjectAnimator
|
||||
@@ -11,6 +11,7 @@ import android.view.animation.Animation
|
||||
import android.view.animation.DecelerateInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import kotlinx.android.synthetic.main.view_brake_light_status.view.*
|
||||
@@ -47,6 +48,7 @@ class BrakeViewStatus @JvmOverloads constructor(
|
||||
if (brakeLight == 1) { //刹车灯亮
|
||||
if (!isBrake) {
|
||||
isBrake = true
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
var appearAnimation = AlphaAnimation(0f, 1f)
|
||||
appearAnimation.duration = 300
|
||||
@@ -61,6 +63,7 @@ class BrakeViewStatus @JvmOverloads constructor(
|
||||
} else { //不踩刹车,就消失
|
||||
if (isBrake) {
|
||||
isBrake = false
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
// scaleImageAndTv()
|
||||
var disappearAnimation = AlphaAnimation(1f, 0f)
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.pnc
|
||||
package com.mogo.eagle.core.function.hmi.ui.vehicle
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.vehicle
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import kotlinx.android.synthetic.main.view_steering_brake.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
* 现阶段模型支持刹车与转向同时触发,现有逻辑中还存在两者优先级状态。后续通过各自实现,将去除优先级
|
||||
* 刹车,调用模型的逻辑暂时放入view。 转向不受影响
|
||||
*/
|
||||
class SteeringBrakeView(context: Context, attrs: AttributeSet?) : ConstraintLayout(context, attrs),
|
||||
IMoGoChassisLamplightListener, IMoGoChassisLocationWGS84Listener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "SteeringBrakeView"
|
||||
}
|
||||
|
||||
private var isShowTurnLight = false
|
||||
private var brakeLight = -1
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_steering_brake, this, true)
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.SteeringBrakeView)
|
||||
val dayLight = typedArray.getBoolean(R.styleable.SteeringBrakeView_day_light_mode, false)
|
||||
turnLightView.dayLightMode(dayLight)
|
||||
typedArray.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerChassisLamplightListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息,小于默认认为是刹车
|
||||
brakeLight =
|
||||
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(
|
||||
MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f
|
||||
)
|
||||
) {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
CallerLogger.d(
|
||||
"$M_HMI$TAG",
|
||||
"---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight
|
||||
)
|
||||
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(brakeLight)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
super.onAutopilotLightSwitchData(lightSwitch)
|
||||
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
|
||||
if (lightSwitch != null) {
|
||||
CallerLogger.d("$M_HMI$TAG", "---lightSwitch.getNumber() = " + lightSwitch.number)
|
||||
if (lightSwitch.number == 1 || lightSwitch.number == 2) {
|
||||
isShowTurnLight = true
|
||||
brakeView.visibility = View.VISIBLE
|
||||
brakeView.setBrakeLight(0)
|
||||
} else {
|
||||
brakeView.visibility = View.GONE
|
||||
isShowTurnLight = false
|
||||
}
|
||||
turnLightView.visibility = View.VISIBLE
|
||||
turnLightView.setTurnLight(lightSwitch)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerChassisLamplightListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.takeover
|
||||
package com.mogo.eagle.core.function.hmi.ui.vehicle
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -59,7 +59,6 @@ class TakeOverView @JvmOverloads constructor(
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnumNew.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
takeOver = true
|
||||
@@ -70,9 +69,7 @@ class TakeOverView @JvmOverloads constructor(
|
||||
takeOver = false
|
||||
visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.turnlight
|
||||
package com.mogo.eagle.core.function.hmi.ui.vehicle
|
||||
|
||||
import android.animation.AnimatorSet
|
||||
import android.animation.ObjectAnimator
|
||||
@@ -10,12 +10,10 @@ import android.view.animation.AlphaAnimation
|
||||
import android.view.animation.Animation
|
||||
import android.widget.ImageView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import chassis.Chassis
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Turning
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import kotlinx.android.synthetic.main.view_turn_light_status.view.*
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
@@ -28,82 +26,52 @@ import kotlinx.coroutines.launch
|
||||
* @since 2022/1/10
|
||||
*/
|
||||
class TurnLightViewStatus @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
init {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_turn_light_status_daytime, this, true)
|
||||
|
||||
private var init: Boolean = false
|
||||
|
||||
fun dayLightMode(dayLight: Boolean) {
|
||||
if (dayLight) {
|
||||
LayoutInflater.from(context)
|
||||
.inflate(R.layout.view_turn_light_status_daytime, this, true)
|
||||
} else {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_turn_light_status, this, true)
|
||||
}
|
||||
invalidate()
|
||||
init = true
|
||||
}
|
||||
|
||||
private var isShowNormalBg :Boolean = false
|
||||
private var isLeftLight :Boolean = false
|
||||
private var isRightLight :Boolean = false
|
||||
private var isDisappare :Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var isVisualAngleChanged = false
|
||||
|
||||
/**
|
||||
* 转向灯动画
|
||||
*/
|
||||
fun setTurnLight(directionLight: Int) {
|
||||
if (!isShowNormalBg && (directionLight == 1 || directionLight == 2)) {
|
||||
isShowNormalBg = true
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
showNormalAnimation()
|
||||
fun setTurnLight(directionLight: Chassis.LightSwitch) {
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
if (!init) {
|
||||
return@launch
|
||||
}
|
||||
}
|
||||
|
||||
if (directionLight == 1 || directionLight == 2) {
|
||||
if (!isVisualAngleChanged) {
|
||||
isVisualAngleChanged = true
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(true))
|
||||
}
|
||||
}
|
||||
|
||||
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
|
||||
if (directionLight == 1) { //左转向
|
||||
if (!isLeftLight) {
|
||||
isLeftLight = true
|
||||
isRightLight = false
|
||||
isDisappare = false
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
//根据左右进行显示和隐藏,实际要判断每个来的时间和频度
|
||||
when (directionLight) {
|
||||
Chassis.LightSwitch.LIGHT_LEFT -> { //左转向
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(true))
|
||||
showNormalAnimation()
|
||||
left_select_image.visibility = View.VISIBLE
|
||||
right_select_image.visibility = View.GONE
|
||||
right_select_image.clearAnimation()
|
||||
setAnimation(left_select_image)
|
||||
}
|
||||
|
||||
}
|
||||
} else if (directionLight == 2) { //右转向
|
||||
if (!isRightLight) {
|
||||
isRightLight = true
|
||||
isLeftLight = false
|
||||
isDisappare = false
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
Chassis.LightSwitch.LIGHT_RIGHT -> { //右转向
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(true))
|
||||
showNormalAnimation()
|
||||
left_select_image.visibility = View.GONE
|
||||
right_select_image.visibility = View.VISIBLE
|
||||
left_select_image.clearAnimation()
|
||||
setAnimation(right_select_image)
|
||||
}
|
||||
}
|
||||
|
||||
} else { //消失
|
||||
if (isVisualAngleChanged) {
|
||||
isVisualAngleChanged = false
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(false))
|
||||
}
|
||||
if (!isDisappare) {
|
||||
isDisappare = true
|
||||
isShowNormalBg = false
|
||||
isLeftLight = false
|
||||
isRightLight = false
|
||||
GlobalScope.launch(Dispatchers.Main) {
|
||||
else -> { //消失
|
||||
CallerVisualAngleManager.changeVisualAngle(Turning(false))
|
||||
animationDisappear()
|
||||
}
|
||||
}
|
||||
@@ -168,7 +136,7 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
|
||||
override fun onAnimationEnd(p0: Animation?) {
|
||||
turn_light_layout.visibility = View.GONE
|
||||
// stopAnimate()
|
||||
stopAnimate()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -176,18 +144,14 @@ class TurnLightViewStatus @JvmOverloads constructor(
|
||||
//实现图片闪烁效果
|
||||
private fun setAnimation(imageView: ImageView) {
|
||||
val animationSet = AnimatorSet()
|
||||
|
||||
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha",0f, 1.0f)
|
||||
val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha",1.0f, 0f)
|
||||
val valueAnimator = ObjectAnimator.ofFloat(imageView, "alpha", 0f, 1.0f)
|
||||
val valueAnimatorDisappare = ObjectAnimator.ofFloat(imageView, "alpha", 1.0f, 0f)
|
||||
valueAnimator.duration = 1000
|
||||
valueAnimatorDisappare.duration = 800
|
||||
|
||||
valueAnimator.repeatCount = -1
|
||||
valueAnimatorDisappare.repeatCount = -1
|
||||
|
||||
animationSet.playTogether(valueAnimatorDisappare, valueAnimator)
|
||||
animationSet.start()
|
||||
|
||||
}
|
||||
|
||||
private fun stopAnimate() {
|
||||
@@ -4,6 +4,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.AlphaAnimation
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.RelativeLayout
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
@@ -36,22 +39,13 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
LayoutInflater.from(context).inflate(R.layout.module_hmi_warning_v2x, this, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum) {
|
||||
showWarning(direction, ALL_CLOSE_TIMER)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long = ALL_CLOSE_TIMER) {
|
||||
UiThreadHandler.post {
|
||||
// 如果传入的不是关闭显示,则设置倒计时,定时关闭红框警示
|
||||
if (direction != ALERT_WARNING_NON) {
|
||||
@@ -59,16 +53,8 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
postDelayed(closeWarningTask, closeTime)
|
||||
}
|
||||
when (direction) {
|
||||
ALERT_WARNING_NON -> {
|
||||
removeCallbacks(closeWarningTask)
|
||||
hmiWarningTopImg.visibility = View.GONE
|
||||
hmiWarningRightImg.visibility = View.GONE
|
||||
hmiWarningBottomImg.visibility = View.GONE
|
||||
hmiWarningLeftImg.visibility = View.GONE
|
||||
hmiWarningLeftTopImg.visibility = View.GONE
|
||||
hmiWarningLeftBottomImg.visibility = View.GONE
|
||||
hmiWarningRightTopImg.visibility = View.GONE
|
||||
hmiWarningRightBottomImg.visibility = View.GONE
|
||||
ALERT_WARNING_NON ->{
|
||||
// nothing
|
||||
}
|
||||
ALERT_WARNING_TOP -> {
|
||||
hmiWarningTopImg.visibility = View.VISIBLE
|
||||
@@ -150,7 +136,7 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
hmiWarningRightTopImg.visibility = View.GONE
|
||||
hmiWarningRightBottomImg.visibility = View.GONE
|
||||
}
|
||||
ALERT_WARNING_ALL -> {
|
||||
ALERT_WARNING_ALL -> { //todo problem
|
||||
hmiWarningTopImg.visibility = View.VISIBLE
|
||||
hmiWarningRightImg.visibility = View.GONE
|
||||
hmiWarningBottomImg.visibility = View.GONE
|
||||
@@ -161,6 +147,12 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
hmiWarningRightBottomImg.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
val alphaAnimation = AlphaAnimation(0f, 0.88f)
|
||||
alphaAnimation.duration = 600
|
||||
alphaAnimation.interpolator = LinearInterpolator()
|
||||
alphaAnimation.repeatCount = Animation.INFINITE
|
||||
alphaAnimation.repeatMode = Animation.REVERSE
|
||||
startAnimation(alphaAnimation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,11 +163,7 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
removeCallbacks(closeWarningTask)
|
||||
when (direction) {
|
||||
ALERT_WARNING_TOP -> {
|
||||
// hmiWarningTopImg.visibility = View.GONE
|
||||
hmiWarningRightTopImg.visibility = View.GONE
|
||||
// hmiWarningLeftTopImg.visibility = View.GONE
|
||||
// hmiWarningLeftBottomImg.visibility = View.GONE
|
||||
// hmiWarningRightBottomImg.visibility = View.GONE
|
||||
}
|
||||
ALERT_WARNING_RIGHT -> {
|
||||
hmiWarningRightImg.visibility = View.GONE
|
||||
@@ -199,6 +187,10 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
hmiWarningLeftTopImg.visibility = View.GONE
|
||||
}
|
||||
ALERT_WARNING_ALL -> {
|
||||
hmiWarningTopImg.visibility = View.GONE
|
||||
hmiWarningRightImg.visibility = View.GONE
|
||||
hmiWarningBottomImg.visibility = View.GONE
|
||||
hmiWarningLeftImg.visibility = View.GONE
|
||||
hmiWarningLeftTopImg.visibility = View.GONE
|
||||
hmiWarningLeftBottomImg.visibility = View.GONE
|
||||
hmiWarningRightTopImg.visibility = View.GONE
|
||||
@@ -208,5 +200,6 @@ class V2XWarningView @JvmOverloads constructor(
|
||||
CallerLogger.d("$M_HMI$TAG", "Not Support Direction")
|
||||
}
|
||||
}
|
||||
clearAnimation()
|
||||
}
|
||||
}
|
||||
@@ -16,31 +16,4 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--刹车ui-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.BrakeViewStatus
|
||||
android:id="@+id/brakeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -74,7 +74,6 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/main_splash_bg">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp_157"
|
||||
android:layout_height="@dimen/dp_255"
|
||||
@@ -91,8 +90,6 @@
|
||||
android:id="@+id/rvConnectInfo"
|
||||
android:layout_width="1200dp"
|
||||
android:layout_height="680dp"
|
||||
android:layout_gravity="bottom"
|
||||
|
||||
/>
|
||||
android:layout_gravity="bottom" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.TurnLightViewStatus
|
||||
android:id="@+id/turnLightView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--刹车ui-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.vehicle.BrakeViewStatus
|
||||
android:id="@+id/brakeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="42dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -69,4 +69,8 @@
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="SteeringBrakeView">
|
||||
<attr name="day_light_mode" format="boolean"/>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -7,7 +7,6 @@
|
||||
<item name="android:windowBackground">@drawable/module_push_message_background</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="TitleBig">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
||||
@@ -2,23 +2,50 @@ package com.mogo.eagle.core.function.map
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.map.MogoMapView
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
class MapBizView(context: Context?) : MogoMapView(context) {
|
||||
class MapBizView(context: Context?) : MogoMapView(context), IMoGoSkinModeChangeListener,
|
||||
IMoGoPlanningRottingListener, IMoGoChassisLocationWGS84Listener, IMoGoChassisLamplightListener {
|
||||
|
||||
override fun onCreate(bundle: Bundle?) {
|
||||
super.onCreate(bundle)
|
||||
map.uiController.showMyLocation(true)
|
||||
// 添加Caller监听
|
||||
// CallerSkinModeListenerManager.addListener(MapFragment.functionName, this)
|
||||
//
|
||||
// CallerChassisLocationWGS84ListenerManager.addListener(MapFragment.functionName, this)
|
||||
// CallerChassisLamplightListenerManager.addListener(MapFragment.functionName, this)
|
||||
|
||||
CallerSkinModeListenerManager.addListener(MapFragment.functionName, this)
|
||||
CallerPlanningRottingListenerManager.addListener(MapFragment.functionName, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(MapFragment.functionName, this)
|
||||
CallerChassisLamplightListenerManager.addListener(MapFragment.functionName, this)
|
||||
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
// 先取消注册数据,再onDestroy
|
||||
CallerSkinModeListenerManager.removeListener(MapFragment.functionName)
|
||||
CallerPlanningRottingListenerManager.removeListener(MapFragment.functionName)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(MapFragment.functionName)
|
||||
CallerChassisLamplightListenerManager.removeListener(MapFragment.functionName)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,12 +6,12 @@ import android.view.View
|
||||
import chassis.Chassis
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.map.CenterLine
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.business.MapPointCloudSubscriber
|
||||
@@ -20,13 +20,18 @@ import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLamplightListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showBrakeLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showTurnLight
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.overview.InfStructureManager
|
||||
import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData
|
||||
import com.mogo.eagle.core.function.overview.obtainViewModel
|
||||
import com.mogo.eagle.core.function.overview.vm.OverViewModel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.Utils
|
||||
import com.mogo.map.IMogoMap
|
||||
@@ -43,11 +48,11 @@ import com.zhidaoauto.map.sdk.open.business.PointCloudHelper
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
||||
class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
MapView,
|
||||
IMoGoMapFragmentProvider,
|
||||
IMoGoSkinModeChangeListener,
|
||||
IMoGoChassisLocationWGS84Listener,
|
||||
IMoGoChassisLamplightListener {
|
||||
MapView,
|
||||
IMoGoMapFragmentProvider,
|
||||
IMoGoSkinModeChangeListener,
|
||||
IMoGoChassisLocationWGS84Listener,
|
||||
IMoGoChassisLamplightListener {
|
||||
|
||||
private var mMogoMapView: MogoMapView? = null
|
||||
private var mMogoMap: IMogoMap? = null
|
||||
@@ -236,7 +241,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
}
|
||||
}
|
||||
|
||||
private fun getSightModeAngle(mode: Int): Float {
|
||||
private fun getSightModeAngle(mode: Int): Float { //todo 宏宇
|
||||
var angle = 0.0f
|
||||
when (mode) {
|
||||
SIGHT_MODE_NORMAL -> {
|
||||
@@ -314,66 +319,28 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
|
||||
override val functionName: String
|
||||
get() = functionName
|
||||
|
||||
private var turnLightTimes = 0
|
||||
private var isOnTurnLight = false
|
||||
private var turnLight = 0
|
||||
|
||||
private var isShowTurnLight = false
|
||||
private var brakeLight = -1
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
// 更新地图控件
|
||||
// 跟新地图控件
|
||||
mMogoMapView?.setExtraGPSData(gnssInfo)
|
||||
|
||||
if (gnssInfo != null) {
|
||||
//设置刹车信息,小于默认认为是刹车
|
||||
brakeLight = if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f)) {
|
||||
1
|
||||
} else {
|
||||
0
|
||||
}
|
||||
d(SceneConstant.M_DEVA + "BrakeLight", "---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight)
|
||||
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
|
||||
showBrakeLight(brakeLight)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
|
||||
if (lightSwitch != null) {
|
||||
val state: Int = setTurnLightState(lightSwitch.number) //对转向灯进行转换
|
||||
d(SceneConstant.M_DEVA + "TurnLight", "---onAutopilotLightSwitchData ---state = " + state + "---lightSwitch.getNumber() = " + lightSwitch.number)
|
||||
if (state == 1 || state == 2) {
|
||||
isShowTurnLight = true
|
||||
showBrakeLight(0)
|
||||
} else {
|
||||
isShowTurnLight = false
|
||||
lightSwitch?.let {
|
||||
when (it.number) {
|
||||
1 -> { //左转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
2 -> { //右转灯
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
else -> {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
showTurnLight(state)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setTurnLightState(turn_light: Int): Int {
|
||||
if (turn_light == 0) {
|
||||
if (isOnTurnLight) {
|
||||
if (turnLightTimes >= 10) {
|
||||
isOnTurnLight = false
|
||||
turnLight = 0
|
||||
}
|
||||
turnLightTimes++
|
||||
}
|
||||
} else if (turn_light == 1) {
|
||||
turnLightTimes = 0
|
||||
isOnTurnLight = true
|
||||
turnLight = 1
|
||||
} else if (turn_light == 2) {
|
||||
turnLightTimes = 0
|
||||
isOnTurnLight = true
|
||||
turnLight = 2
|
||||
}
|
||||
return turnLight
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -336,7 +336,6 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
tempAppId.toString(),
|
||||
tempContent,
|
||||
tempTts,
|
||||
"$tempAppId",
|
||||
object : IMoGoWarningStatusListener {
|
||||
val change = changeVisualAngle
|
||||
override fun onShow() {
|
||||
@@ -350,9 +349,7 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
CallerVisualAngleManager.changeVisualAngle(Default())
|
||||
}
|
||||
}
|
||||
},
|
||||
true,
|
||||
5000L
|
||||
}
|
||||
)
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(trafficData)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.v2x.events.scenario.scene.road;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.context.ContextHolderUtil;
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum;
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
|
||||
@@ -10,6 +12,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean;
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType;
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg;
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager;
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
|
||||
@@ -17,6 +20,8 @@ import com.mogo.eagle.core.function.v2x.events.scenario.impl.AbsV2XScenario;
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -110,6 +115,16 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
}
|
||||
}
|
||||
|
||||
//占道施工预警
|
||||
if (poiType.equals("10006") || poiType.equals("100061")) {
|
||||
long currentTime = System.currentTimeMillis() / 1000;
|
||||
long oldTime = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getLong("roadwork", 0);
|
||||
if (currentTime - oldTime > 60) { //超过一分钟,才会继续播报重复提醒
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putLong("roadwork", System.currentTimeMillis() / 1000);
|
||||
CallerAutoPilotManager.sendTripInfo(5, "", "", "", false);
|
||||
}
|
||||
}
|
||||
|
||||
CallerMsgBoxManager.INSTANCE.saveMsgBox(
|
||||
new MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
@@ -119,7 +134,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
)
|
||||
);
|
||||
CallerHmiManager.INSTANCE.warningV2X(poiType, alarmText,
|
||||
ttsText, TAG, this, !entity.isOnlyShow(),
|
||||
ttsText, this, !entity.isOnlyShow(),
|
||||
TimeUnit.SECONDS.toMillis(5));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class V2XFrontWarningScenario extends AbsV2XScenario implements IMoGoChas
|
||||
);
|
||||
CallerHmiManager.INSTANCE.warningV2X(v2xType + "",
|
||||
getAlertContentForFrontWarning(mMarkerEntity), mMarkerEntity.getTts(),
|
||||
TAG, this, !entity.isOnlyShow(),
|
||||
this, !entity.isOnlyShow(),
|
||||
TimeUnit.SECONDS.toMillis(3));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,13 +38,7 @@ interface IMoGoHmiProvider {
|
||||
/**
|
||||
* 不展示顶部弹窗,其它保留
|
||||
*/
|
||||
fun warningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, tag: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long)
|
||||
|
||||
/**
|
||||
* 关闭指定floatTag 的 VR下V2X预警弹窗
|
||||
* @param tag 弹窗标识
|
||||
*/
|
||||
fun disableWarningV2X(tag: String?)
|
||||
fun warningV2X(v2xType: String, alertContent: CharSequence?, ttsContent: String?, listener: IMoGoWarningStatusListener?, playTts: Boolean, expireTime: Long)
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
@@ -95,16 +89,6 @@ interface IMoGoHmiProvider {
|
||||
|
||||
fun hideSmallFragment()
|
||||
|
||||
/**
|
||||
* 展示转向灯
|
||||
*/
|
||||
fun showTurnLight(light: Int)
|
||||
|
||||
/**
|
||||
* 展示刹车灯
|
||||
*/
|
||||
fun showBrakeLight(brakeLight: Int)
|
||||
|
||||
/**
|
||||
* 展示绑定车辆弹框
|
||||
*/
|
||||
@@ -130,13 +114,6 @@ interface IMoGoHmiProvider {
|
||||
*/
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo)
|
||||
|
||||
/**
|
||||
* 工控机重启返回结果
|
||||
* @param code
|
||||
* @param msg
|
||||
*/
|
||||
fun showDockerRebootResult(code: Int,msg: String)
|
||||
|
||||
/**
|
||||
* 展示工控机监控上报数据
|
||||
* @param errorReportList 错误级别上报数据列表
|
||||
|
||||
@@ -309,6 +309,7 @@ object CallerAutoPilotControlManager {
|
||||
* @param isLastStop 是否最终站
|
||||
* @return boolean
|
||||
*/
|
||||
@JvmStatic
|
||||
fun sendTripInfo(type: Int, lineName: String, departureStopName: String, arrivalStopName: String, isLastStop: Boolean) {
|
||||
providerApi?.sendTripInfo(type, lineName, departureStopName, arrivalStopName, isLastStop)
|
||||
}
|
||||
|
||||
@@ -9,14 +9,37 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
*/
|
||||
object CallerChassisLamplightListenerManager : CallerBase<IMoGoChassisLamplightListener>() {
|
||||
|
||||
private var turnLightTimes = 0
|
||||
private var isOnTurnLight = false
|
||||
|
||||
/**
|
||||
* 车辆转向灯数据回调
|
||||
* @param lightSwitch
|
||||
*/
|
||||
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotLightSwitchData(lightSwitch)
|
||||
listener.onAutopilotLightSwitchData(getTurnLightState(lightSwitch))
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTurnLightState(turn_light: Chassis.LightSwitch): Chassis.LightSwitch? {
|
||||
if (turn_light == Chassis.LightSwitch.LIGHT_NONE) {
|
||||
return if (isOnTurnLight) {
|
||||
if (turnLightTimes >= 10) {
|
||||
isOnTurnLight = false
|
||||
return turn_light
|
||||
} else {
|
||||
turnLightTimes++
|
||||
null
|
||||
}
|
||||
} else {
|
||||
null
|
||||
}
|
||||
} else {
|
||||
turnLightTimes = 0
|
||||
isOnTurnLight = true
|
||||
return turn_light
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,30 +59,20 @@ object CallerHmiManager {
|
||||
v2xType: String,
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
tag: String?,
|
||||
listenerIMoGo: IMoGoWarningStatusListener?,
|
||||
playTts: Boolean,
|
||||
listenerIMoGo: IMoGoWarningStatusListener? = null,
|
||||
playTts: Boolean = true,
|
||||
expireTime: Long = 5000L,
|
||||
) {
|
||||
waringProviderApi?.warningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
tag,
|
||||
listenerIMoGo,
|
||||
playTts,
|
||||
expireTime
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指定floatTag 的 VR下V2X预警弹窗
|
||||
* @param tag 弹窗标识
|
||||
*/
|
||||
fun disableWarningV2X(tag: String?) {
|
||||
waringProviderApi?.disableWarningV2X(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
@@ -111,7 +101,6 @@ object CallerHmiManager {
|
||||
|
||||
/**
|
||||
* 呈现交通云公告弹窗(hmi)
|
||||
*
|
||||
* @param trafficStylePushData
|
||||
*/
|
||||
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
|
||||
@@ -120,7 +109,6 @@ object CallerHmiManager {
|
||||
|
||||
/**
|
||||
* 普通公告弹窗
|
||||
*
|
||||
*/
|
||||
fun showNoticeNormalData(noticeNormal: NoticeNormalData) {
|
||||
waringProviderApi?.showNoticeNormalData(noticeNormal)
|
||||
@@ -133,29 +121,11 @@ object CallerHmiManager {
|
||||
waringProviderApi?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 呈现转向灯ui
|
||||
*
|
||||
* @param light
|
||||
*/
|
||||
fun showTurnLight(light: Int) {
|
||||
waringProviderApi?.showTurnLight(light)
|
||||
}
|
||||
|
||||
/**
|
||||
* 呈现刹车灯ui
|
||||
*
|
||||
* @param brakeLight
|
||||
*/
|
||||
fun showBrakeLight(brakeLight: Int) {
|
||||
waringProviderApi?.showBrakeLight(brakeLight)
|
||||
}
|
||||
|
||||
fun showBindingcarDialog() {
|
||||
fun showBindingCarDialog() {
|
||||
waringProviderApi?.showToBindingcarDialog()
|
||||
}
|
||||
|
||||
fun showModifyBindingcarDialog() {
|
||||
fun showModifyBindingCarDialog() {
|
||||
waringProviderApi?.showModifyBindingcarDialog()
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.configureondemand=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx4096m
|
||||
org.gradle.jvmargs=-Xmx2048m
|
||||
#开启gradle缓存
|
||||
org.gradle.caching=true
|
||||
android.enableBuildCache=true
|
||||
|
||||
Reference in New Issue
Block a user