[2.13.0 优化obu显示]
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
package com.mogo.eagle.core.data.enums
|
||||
|
||||
import com.mogo.eagle.core.data.R
|
||||
|
||||
|
||||
/**
|
||||
* 交通信号灯
|
||||
*/
|
||||
enum class EventTypeEnumTrafficLight(
|
||||
val poiType: String, val poiTypeStr: String = "",
|
||||
val poiTypeStrVr: String = "",
|
||||
val poiTypeSrcVr: Int = R.drawable.v2x_icon_live_logo,
|
||||
val content: String = "", val tts: String = ""
|
||||
) {
|
||||
|
||||
TYPE_USECASE_ID_IVP_RED(
|
||||
0x1.toString(),
|
||||
"闯红灯预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_red,
|
||||
content = "路口红灯,禁止通行",
|
||||
tts = "路口红灯,禁止通行"
|
||||
),
|
||||
TYPE_USECASE_ID_IVP_GREEN(
|
||||
0x2.toString(),
|
||||
"绿波通行",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_traffic_lights_green,
|
||||
content = "建议车速 %s KM/H",
|
||||
tts = "建议车速 %s KM/H"
|
||||
),
|
||||
|
||||
TYPE_ERROR(
|
||||
0.toString(),
|
||||
"未知/错误/异常",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_abnormal_vehicle,
|
||||
content = "",
|
||||
tts = ""
|
||||
);
|
||||
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getWarningIcon(poiType: String?): Int {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.poiTypeSrcVr
|
||||
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.poiTypeSrcVr
|
||||
|
||||
else -> TYPE_ERROR.poiTypeSrcVr
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWarningContent(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.content
|
||||
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.content
|
||||
|
||||
else -> TYPE_ERROR.content
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getWarningTts(poiType: String?): String {
|
||||
return when (poiType) {
|
||||
TYPE_USECASE_ID_IVP_RED.poiType -> TYPE_USECASE_ID_IVP_RED.tts
|
||||
TYPE_USECASE_ID_IVP_GREEN.poiType -> TYPE_USECASE_ID_IVP_GREEN.tts
|
||||
else -> TYPE_ERROR.tts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,10 +20,10 @@ enum class EventTypeEnumWeaknessTraffic(
|
||||
content = "注意机动车",
|
||||
tts = "注意机动车"
|
||||
),
|
||||
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES( //TODO 图标需要换
|
||||
TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES(
|
||||
2.toString(),
|
||||
"弱势交通参与者碰撞预警",
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_motorcycle_collision,
|
||||
poiTypeSrcVr = R.drawable.icon_warning_v2x_motobike,
|
||||
content = "注意非机动车",
|
||||
tts = "注意非机动车"
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user