diff --git a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
index 95eaa395d2..ebfb0e785e 100644
--- a/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
+++ b/OCH/mogo-och-bus-passenger/src/main/res/layout/bus_p_base_fragment.xml
@@ -27,7 +27,7 @@
app:layout_constraintTop_toTopOf="parent"/>
-
-
-
-
-
-
-
-
-
-
-
- , 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, 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, 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, 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, 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() {
diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
index 50623760c5..ac8b07b2ff 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt
@@ -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) {
+ private fun handlerTrafficLight(
+ appId: Int,
+ status: Int,
+ lights: List
+ ) {
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)
}
diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
index 2a2b323404..7d75b06c6c 100644
--- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
+++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt
@@ -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
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()
}
diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt
index 2c7e11bdc8..0d980cdf19 100644
--- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt
+++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/binding/BindingCarNetWorkManager.kt
@@ -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(
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml b/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml
index bbc8f0d792..33c14875d8 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/AndroidManifest.xml
@@ -157,14 +157,6 @@
-
-
-
-
-
-
-
-
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt
index 235488a705..2d00e7d2ea 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/BindingcarBroadcastReceiver.kt
@@ -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()
}
}
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt
deleted file mode 100644
index 397103c575..0000000000
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/TurnLightBroadcastReceiver.kt
+++ /dev/null
@@ -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) //设置刹车信息
- }
- }
-}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt
index fefd2b4366..e95dd4c575 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/receiver/V2XWarningBroadcastReceiver.kt
@@ -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)
}
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt
index b1c1f47f2e..e0f9474b10 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt
@@ -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(),
private val lastSpeakJob by lazy { AtomicReference() }
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,
warningReportList: ArrayList,
@@ -193,7 +151,6 @@ class MoGoHmiFragment : MvpFragment(),
v2xType: String,
alertContent: CharSequence?,
ttsContent: String?,
- tag: String?,
listener: IMoGoWarningStatusListener?,
playTts: Boolean,
expireTime: Long
@@ -204,20 +161,6 @@ class MoGoHmiFragment : MvpFragment(),
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(),
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(),
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) {
ThreadUtils.runOnUiThread {
@@ -427,125 +289,18 @@ class MoGoHmiFragment : MvpFragment(),
}
}
- /** 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(),
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, padSn: String, releaseId: String) {
ThreadUtils.runOnUiThread {
if (ContextHolderUtil.getContext() != null) {
@@ -580,9 +324,6 @@ class MoGoHmiFragment : MvpFragment(),
}
}
- /**
- * ok
- */
override fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
ThreadUtils.runOnUiThread {
toolsView.showAdUpgradeStatus(ipcUpgradeStateInfo)
@@ -632,8 +373,4 @@ class MoGoHmiFragment : MvpFragment(),
?.commitAllowingStateLoss()
}
- override fun onDestroy() {
- super.onDestroy()
- CallerLogger.d("$M_HMI$TAG", "onDestroy")
- }
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java
similarity index 97%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java
index 1b8da4b6e1..22905e8b3d 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchAirportDialog.java
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchAirportDialog.java
@@ -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;
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java
similarity index 95%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java
index 6f47cb8e71..d22a34eae7 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchBaseDialog.java
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchBaseDialog.java
@@ -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;
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java
similarity index 97%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java
index 53b912f5a6..b2d450f7ff 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchCarsDialog.java
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchCarsDialog.java
@@ -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;
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java
similarity index 98%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java
index 88cfdb089b..f77c58d62e 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/dispatch/DispatchDialogManager.java
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/notice/DispatchDialogManager.java
@@ -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;
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt
similarity index 98%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt
index 162b620264..6d3c75519a 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ModifyBindingCarDialog.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ModifyBindingCarDialog.kt
@@ -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
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt
similarity index 98%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt
index 31633e2f5b..9f0c04ae9b 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/ToBindingCarDialog.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/ToBindingCarDialog.kt
@@ -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
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt
similarity index 98%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt
index 92fe6ed30b..74cecac037 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/bindingcar/UpgradeAppDialog.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/tools/UpgradeAppDialog.kt
@@ -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
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt
similarity index 93%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt
index 56f19763b4..3c9fe2419f 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/BrakeViewStatus.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/BrakeViewStatus.kt
@@ -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)
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt
similarity index 98%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt
index e221ee5fa1..085dcae0f1 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/PncActionsView.kt
@@ -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
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt
new file mode 100644
index 0000000000..7ef29438c3
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/SteeringBrakeView.kt
@@ -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)
+ }
+
+}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt
similarity index 93%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt
index 4b447c2eaa..29cd185384 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/takeover/TakeOverView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TakeOverView.kt
@@ -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
+ }
)
}
}
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt
similarity index 65%
rename from core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt
rename to core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt
index a507b08ac2..e21e0514a6 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/turnlight/TurnLightViewStatus.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/vehicle/TurnLightViewStatus.kt
@@ -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() {
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt
index 6bc394fba8..2041f3b15b 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/V2XWarningView.kt
@@ -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()
}
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
index 8e84662b5e..f2f6e4c657 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
@@ -16,31 +16,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml
index e8e3c08f6e..54037f7e0f 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/module_main_activity_main.xml
@@ -74,7 +74,6 @@
android:layout_height="match_parent"
android:background="@drawable/main_splash_bg">
-
+ android:layout_gravity="bottom" />
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml
new file mode 100644
index 0000000000..dfbfdbe7bd
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_steering_brake.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
index 7e72417466..638b1ca53c 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/attr.xml
@@ -69,4 +69,8 @@
- @android:color/transparent
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml
index 035df811a8..99c0c612b0 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/values/styles.xml
@@ -7,7 +7,6 @@
- @drawable/module_push_message_background
-