@@ -282,10 +282,14 @@ class MogoPrivateObuManager private constructor() {
|
||||
|
||||
}
|
||||
|
||||
// (4) V2I预警信息:CVX_IVP_THREAT_IND
|
||||
// (4) V2I预警信息:CVX_IVP_THREAT_IND,红绿灯
|
||||
override fun onCvxIvpThreatIndInfo(info: CvxIvpThreatIndInfo?) {
|
||||
Logger.d(MogoObuConst.TAG_MOGO_OBU, "CvxIvpThreatIndInfo ------> $info")
|
||||
if (info != null && info.ext_info != null && info.threat_info != null && info.ext_info.lights != null && info.ext_info.lights.isNotEmpty()) {
|
||||
if (info != null && info.ext_info != null
|
||||
&& info.threat_info != null
|
||||
&& info.ext_info.lights != null
|
||||
&& info.ext_info.lights.isNotEmpty()
|
||||
) {
|
||||
handlerTrafficLight(
|
||||
info.threat_info.app_id,
|
||||
info.status,
|
||||
@@ -487,6 +491,7 @@ class MogoPrivateObuManager private constructor() {
|
||||
/**
|
||||
* 修改红绿灯
|
||||
*/
|
||||
@Synchronized
|
||||
private fun changeTrafficLightStatus(
|
||||
appId: Int,
|
||||
lights: List<Light>,
|
||||
@@ -499,8 +504,30 @@ class MogoPrivateObuManager private constructor() {
|
||||
val currentLight = lights[index]
|
||||
Logger.d(
|
||||
MogoObuConst.TAG_MOGO_OBU,
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phase} --- index = $index ---appId = $appId"
|
||||
"currentLight = $currentLight ---currentLight.phase = ${currentLight.phase} ---rlvw_violation_type = ${currentLight.rlvw_violation_type} --- index = $index ---appId = $appId ---appId = $appId"
|
||||
)
|
||||
// 闯红灯预警
|
||||
when (currentLight.rlvw_violation_type) {
|
||||
0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE
|
||||
}
|
||||
0x1 -> {//无违规 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION
|
||||
CallerHmiManager.disableWarningV2X(appId.toString())
|
||||
}
|
||||
0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT
|
||||
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
|
||||
alertContent = EventTypeEnum.getWarningContent(appId.toString())
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null
|
||||
)
|
||||
}
|
||||
0x3 -> {//闯黄灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_YELLOW_LIGHT
|
||||
}
|
||||
}
|
||||
|
||||
when (currentLight.phase) {
|
||||
// 灯光不可用
|
||||
0x0 -> {
|
||||
@@ -514,20 +541,12 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
isGreenLight = false
|
||||
CallerHmiManager.showWarningTrafficLight(1)
|
||||
|
||||
val red = currentLight.count_down.toInt()
|
||||
CallerHmiManager.changeCountdownRed(red)
|
||||
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
|
||||
alertContent = EventTypeEnum.getWarningContent(appId.toString())
|
||||
CallerHmiManager.changeCountdownGreen(0)
|
||||
CallerHmiManager.changeCountdownYellow(0)
|
||||
|
||||
CallerHmiManager.showWarningV2X(
|
||||
appId,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
appId.toString(),
|
||||
null
|
||||
)
|
||||
}
|
||||
// 绿灯
|
||||
0x2 -> {
|
||||
@@ -647,19 +666,6 @@ class MogoPrivateObuManager private constructor() {
|
||||
EventTypeEnum.TYPE_USECASE_ID_LTA.poiType -> {
|
||||
alertContent = EventTypeEnum.getWarningContent(appId.toString())
|
||||
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
|
||||
if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "左")
|
||||
} else if (
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
|
||||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
|
||||
) {
|
||||
ttsContent = String.format(ttsContent, "右")
|
||||
}
|
||||
}
|
||||
|
||||
//异常车辆提醒
|
||||
|
||||
Reference in New Issue
Block a user