|
|
|
|
@@ -195,6 +195,20 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
level = data.warningMsg.warningData[0].warningLevel
|
|
|
|
|
appId = data.warningMsg.warningData[0].warningType.toString()
|
|
|
|
|
status = data.warningMsg.warningData[0].status
|
|
|
|
|
|
|
|
|
|
//15秒内同一个事件只出现一次
|
|
|
|
|
if (rvMap.containsKey(appId)) {
|
|
|
|
|
var oldTime = rvMap[appId]
|
|
|
|
|
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
|
|
|
|
if (timeDiff < 15) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
rvMap.remove(appId)
|
|
|
|
|
rvMap[appId] = System.currentTimeMillis()
|
|
|
|
|
} else {
|
|
|
|
|
rvMap[appId] = System.currentTimeMillis()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//拼凑数据
|
|
|
|
|
if (appId != null) {
|
|
|
|
|
handleSdkObu(appId, direction, status, level, data)
|
|
|
|
|
@@ -230,6 +244,7 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val rvMap = mutableMapOf<String, Long>()
|
|
|
|
|
val rsiMap = mutableMapOf<String, Long>()
|
|
|
|
|
val rsmMap = mutableMapOf<String, Long>()
|
|
|
|
|
|
|
|
|
|
@@ -409,17 +424,14 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
if (rsiMap.containsKey(appId)) {
|
|
|
|
|
var oldTime = rsiMap[appId]
|
|
|
|
|
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
|
|
|
|
Log.d("lixp", "----1-- timeDiff = $timeDiff --appId = $appId")
|
|
|
|
|
if (timeDiff < 15) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
rsiMap.remove(appId)
|
|
|
|
|
rsiMap[appId] = System.currentTimeMillis()
|
|
|
|
|
Log.d("lixp", "---- timeDiff-----------2-----------")
|
|
|
|
|
} else {
|
|
|
|
|
rsiMap[appId] = System.currentTimeMillis()
|
|
|
|
|
}
|
|
|
|
|
Log.d("lixp", "---- timeDiff-----------3-----------")
|
|
|
|
|
|
|
|
|
|
CallerLogger.d(
|
|
|
|
|
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
|
|
|
|
@@ -531,17 +543,14 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
if (rsmMap.containsKey(v2xType)) {
|
|
|
|
|
var oldTime = rsmMap[v2xType]
|
|
|
|
|
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
|
|
|
|
Log.e("lixp", "onMogoObuRsmWarning ------ timeDiff---1----- = $timeDiff --v2xType = $v2xType")
|
|
|
|
|
if (timeDiff < 15) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
rsmMap.remove(v2xType)
|
|
|
|
|
rsmMap[v2xType] = System.currentTimeMillis()
|
|
|
|
|
Log.e("lixp", "onMogoObuRsmWarning ---- timeDiff---------2---------")
|
|
|
|
|
} else {
|
|
|
|
|
rsmMap[v2xType] = System.currentTimeMillis()
|
|
|
|
|
}
|
|
|
|
|
Log.e("lixp", "onMogoObuRsmWarning ---- timeDiff----------3---------")
|
|
|
|
|
|
|
|
|
|
//物体数据绘制 TODO 这里与dc通过工控机有区别
|
|
|
|
|
when (data.status) {
|
|
|
|
|
@@ -643,7 +652,6 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
|
|
|
|
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}"
|
|
|
|
|
)
|
|
|
|
|
Log.d("liyz", "obu onMogoObuMapMath status = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}")
|
|
|
|
|
when (data.status) {
|
|
|
|
|
MogoObuConstants.STATUS.ADD -> { // 添加
|
|
|
|
|
UiThreadHandler.post {
|
|
|
|
|
@@ -721,51 +729,32 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
info: MogoObuRvWarningData
|
|
|
|
|
) {
|
|
|
|
|
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
|
|
|
|
|
var alertContent: String
|
|
|
|
|
var ttsContent: String
|
|
|
|
|
var alertContent: String = ""
|
|
|
|
|
var ttsContent: String = ""
|
|
|
|
|
var changeVisualAngle = false
|
|
|
|
|
when (appId) {
|
|
|
|
|
// 变道预警,注意左后车辆/注意右后车辆
|
|
|
|
|
EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
|
|
|
|
if (
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
|
|
|
|
) {
|
|
|
|
|
ttsContent = String.format(ttsContent, "左")
|
|
|
|
|
alertContent = String.format(alertContent, "左")
|
|
|
|
|
} else if (
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
|
|
|
|
) {
|
|
|
|
|
ttsContent = String.format(ttsContent, "右")
|
|
|
|
|
alertContent = String.format(alertContent, "右")
|
|
|
|
|
}
|
|
|
|
|
//交叉路口碰撞预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//车辆失控预警
|
|
|
|
|
EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
|
|
|
|
alertContent = String.format(alertContent, direction.desc)
|
|
|
|
|
ttsContent = String.format(ttsContent, direction.desc)
|
|
|
|
|
//交叉路口碰撞预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//异常车辆提醒
|
|
|
|
|
EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
|
|
|
|
alertContent = String.format(alertContent, direction.desc)
|
|
|
|
|
ttsContent = String.format(ttsContent, direction.desc)
|
|
|
|
|
//左转辅助预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//盲区预警
|
|
|
|
|
EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType -> {
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
|
|
|
|
|
if (
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
|
|
|
|
@@ -784,10 +773,65 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
alertContent = String.format(alertContent, "右")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 变道预警,注意左后车辆/注意右后车辆
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
|
|
|
|
|
if (
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
|
|
|
|
) {
|
|
|
|
|
ttsContent = String.format(ttsContent, "左")
|
|
|
|
|
alertContent = String.format(alertContent, "左")
|
|
|
|
|
} else if (
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
|
|
|
|
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
|
|
|
|
) {
|
|
|
|
|
ttsContent = String.format(ttsContent, "右")
|
|
|
|
|
alertContent = String.format(alertContent, "右")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//逆向超车预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//紧急制动预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//异常车辆提醒
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
|
|
|
|
|
alertContent = String.format(alertContent, direction.desc)
|
|
|
|
|
ttsContent = String.format(ttsContent, direction.desc)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//车辆失控预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
|
|
|
|
|
alertContent = String.format(alertContent, direction.desc)
|
|
|
|
|
ttsContent = String.format(ttsContent, direction.desc)
|
|
|
|
|
}
|
|
|
|
|
//车辆失控预警
|
|
|
|
|
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
|
|
|
|
|
else -> {
|
|
|
|
|
ttsContent = EventTypeEnumNew.getWarningTts(appId)
|
|
|
|
|
alertContent = EventTypeEnumNew.getWarningContent(appId)
|
|
|
|
|
else -> { //TODO
|
|
|
|
|
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
|
|
|
|
|
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -882,7 +926,6 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
// 删除
|
|
|
|
|
MogoObuConstants.STATUS.DELETE -> {
|
|
|
|
|
// 移除顶部弹窗
|
|
|
|
|
Log.d("liyz","handlerTrafficLight new obu disableWarningTrafficLight() --->")
|
|
|
|
|
CallerHmiManager.disableWarningTrafficLight()
|
|
|
|
|
CallerHmiManager.disableWarningV2X(appId.toString())
|
|
|
|
|
isShowGreenWave = false
|
|
|
|
|
@@ -1011,9 +1054,8 @@ class MogoPrivateObuNewManager private constructor() {
|
|
|
|
|
when (currentLight.light) {
|
|
|
|
|
// 灯光不可用
|
|
|
|
|
0 -> {
|
|
|
|
|
// CallerHmiManager.showWarningTrafficLight(0, 3) //TODO
|
|
|
|
|
// CallerHmiManager.showWarningTrafficLight(0, 3)
|
|
|
|
|
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
|
|
|
|
|
Log.e("liyz", "currentLight.light = ${currentLight.light} ----0-----")
|
|
|
|
|
}
|
|
|
|
|
// 红灯
|
|
|
|
|
2, 3 -> {
|
|
|
|
|
|