[6.5.0]feat: 通用事件弹框,增加支持 文本/图片/直播拉流 三种形式展示;
refactor: 优化 通过公交站点 计算逻辑; feat: 通过公交站点,增加调式面板按钮 动态控制是否展示 计算范围边界点在高精地图绘制; feat: 增加定义 事件类型 通过公交站点 他车逆行;
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventType
|
||||
import com.mogo.eagle.core.data.v2x.RoadV2NEventWindowBean
|
||||
import com.mogo.eagle.core.function.api.hmi.v2n.IRoadV2NEventWindowListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
@@ -7,11 +8,82 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
|
||||
/**
|
||||
* 路侧V2N事件弹框 调用者管理类
|
||||
* 支持 text, image, live_video 3种展示样式
|
||||
*/
|
||||
object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowListener>() {
|
||||
|
||||
const val TAG = "CallerRoadV2NEventWindowListenerManager"
|
||||
|
||||
/**
|
||||
* 通用事件弹框,通过caremaIp, lon , lat请求查询拉流地址
|
||||
* @param eventId 调用者设置唯一的事件 ID
|
||||
* @param timestamp 事件发生的时间
|
||||
* @param iconResId 事件icon drawable id
|
||||
* @param hintStr 事件提示str
|
||||
* @param isNeedTTS show时是否需要同步tts
|
||||
*/
|
||||
fun showText(
|
||||
eventId: String,
|
||||
timestamp: Long,
|
||||
iconResId: Int,
|
||||
hintStr: String,
|
||||
isNeedTTS: Boolean
|
||||
) {
|
||||
val data = RoadV2NEventWindowBean(
|
||||
RoadV2NEventType.TEXT,
|
||||
eventId,
|
||||
timestamp,
|
||||
iconResId,
|
||||
hintStr,
|
||||
isNeedTTS,
|
||||
"",
|
||||
"",
|
||||
0.0,
|
||||
0.0
|
||||
)
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.show(data)
|
||||
}
|
||||
CallerLogger.i(TAG, "show ${data.toString()}, type=${RoadV2NEventType.TEXT}")
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用事件弹框,通过caremaIp, lon , lat请求查询拉流地址
|
||||
* @param eventId 调用者设置唯一的事件 ID
|
||||
* @param timestamp 事件发生的时间
|
||||
* @param iconResId 事件icon drawable id
|
||||
* @param hintStr 事件提示str
|
||||
* @param isNeedTTS show时是否需要同步tts
|
||||
* @param contentImageUrl 内容部分图片 url
|
||||
*/
|
||||
fun showImage(
|
||||
eventId: String,
|
||||
timestamp: Long,
|
||||
iconResId: Int,
|
||||
hintStr: String,
|
||||
isNeedTTS: Boolean,
|
||||
contentImageUrl: String
|
||||
) {
|
||||
val data = RoadV2NEventWindowBean(
|
||||
RoadV2NEventType.IMAGE,
|
||||
eventId,
|
||||
timestamp,
|
||||
iconResId,
|
||||
hintStr,
|
||||
isNeedTTS,
|
||||
contentImageUrl,
|
||||
"",
|
||||
0.0,
|
||||
0.0
|
||||
)
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.show(data)
|
||||
}
|
||||
CallerLogger.i(TAG, "show ${data.toString()}, type=${RoadV2NEventType.IMAGE}")
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用事件弹框,通过caremaIp, lon , lat请求查询拉流地址
|
||||
* @param eventId 调用者设置唯一的事件 ID
|
||||
@@ -23,7 +95,7 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowL
|
||||
* @param lon 事件发生经度
|
||||
* @param lat 事件发生维度
|
||||
*/
|
||||
fun show(
|
||||
fun showLiveVideo(
|
||||
eventId: String,
|
||||
timestamp: Long,
|
||||
iconResId: Int,
|
||||
@@ -34,11 +106,13 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowL
|
||||
lat: Double
|
||||
) {
|
||||
val data = RoadV2NEventWindowBean(
|
||||
RoadV2NEventType.LIVE_VIDEO,
|
||||
eventId,
|
||||
timestamp,
|
||||
iconResId,
|
||||
hintStr,
|
||||
isNeedTTS,
|
||||
"",
|
||||
cameraIp,
|
||||
lon,
|
||||
lat
|
||||
@@ -47,7 +121,7 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase<IRoadV2NEventWindowL
|
||||
val listener = it.value
|
||||
listener.show(data)
|
||||
}
|
||||
CallerLogger.i(TAG, "show ${data.toString()}")
|
||||
CallerLogger.i(TAG, "show ${data.toString()}, type=${RoadV2NEventType.LIVE_VIDEO}")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user