[6.5.0]feat: 通用事件弹框,增加支持 文本/图片/直播拉流 三种形式展示;
refactor: 优化 通过公交站点 计算逻辑; feat: 通过公交站点,增加调式面板按钮 动态控制是否展示 计算范围边界点在高精地图绘制; feat: 增加定义 事件类型 通过公交站点 他车逆行;
This commit is contained in:
@@ -2,8 +2,8 @@ package com.mogo.eagle.function.biz.v2x.busstation
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.HandlerThread
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
@@ -14,6 +14,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UriUtils
|
||||
import com.mogo.map.MogoData
|
||||
import com.mogo.map.entities.BusStation
|
||||
import com.mogo.map.overlay.core.Level
|
||||
@@ -47,9 +48,11 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
// 查询出来的符合条件的公交站点集合
|
||||
private val busStationNearByQueue = LinkedList<List<BusStation>>()
|
||||
|
||||
// 需要提醒的公交站点
|
||||
// 需要提醒的公交站点(待提醒,已提醒)
|
||||
private val busStationListNeedNotified = HashMap<String, BusStation>()
|
||||
|
||||
private val isNotifyRunnableRunning = AtomicBoolean(false)
|
||||
|
||||
private val isDriverScreen by lazy {
|
||||
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
}
|
||||
@@ -94,12 +97,12 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
val currentLocation =
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
busStationListNeedNotified.values.forEach {
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude,
|
||||
it.getBusStationPoint().longitude,
|
||||
it.getBusStationPoint().latitude,
|
||||
).toInt()
|
||||
// val distance = CoordinateUtils.calculateLineDistance(
|
||||
// currentLocation.longitude,
|
||||
// currentLocation.latitude,
|
||||
// it.getBusStationPoint().longitude,
|
||||
// it.getBusStationPoint().latitude,
|
||||
// ).toInt()
|
||||
val angle = DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
currentLocation.longitude,
|
||||
currentLocation.latitude,
|
||||
@@ -107,7 +110,7 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
it.getBusStationPoint().latitude,
|
||||
currentLocation.heading.toInt()
|
||||
)
|
||||
if (distance<=5 && angle >= 90) {
|
||||
if (angle >= 90) {
|
||||
CallerRoadV2NEventWindowListenerManager.dismiss(it.getBusStationId())
|
||||
busStationListNeedNotified.remove(it.getBusStationId())
|
||||
Logger.d(
|
||||
@@ -119,36 +122,43 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
}
|
||||
|
||||
// 开始提醒
|
||||
if (busStationListNeedNotified.isNotEmpty()) {
|
||||
if (busStationListNeedNotified.isNotEmpty() && !isNotifyRunnableRunning.get()) {
|
||||
handler.removeCallbacks(notificationCheckRunnable)
|
||||
handler.post(notificationCheckRunnable)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
handler?.postDelayed(this, 1000L)
|
||||
handler?.postDelayed(this, 800L)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val notificationCheckRunnable = object : Runnable {
|
||||
override fun run() {
|
||||
isNotifyRunnableRunning.set(true)
|
||||
if (busStationListNeedNotified.isNotEmpty()) {
|
||||
val list = busStationListNeedNotified.values.toList()
|
||||
.filter { it.notifyTime <= 0 && it.notifyDistance > 0 }
|
||||
.sortedBy { it.notifyDistance }
|
||||
if (list.isNotEmpty()) {
|
||||
list.first().also {
|
||||
//TODO 调整调用方式
|
||||
it.notifyTime = System.currentTimeMillis()
|
||||
CallerRoadV2NEventWindowListenerManager.show(
|
||||
CallerRoadV2NEventWindowListenerManager.showImage(
|
||||
it.getBusStationId(),
|
||||
it.notifyTime,
|
||||
EventTypeEnumNew.getUpdateIconRes(""),
|
||||
"前方${it.notifyDistance}米有公交站,蘑菇提醒您小心右侧行人及来车",
|
||||
EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
String.format(
|
||||
EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType),
|
||||
it.notifyDistance
|
||||
),
|
||||
isDriverScreen,
|
||||
"192.168.1.1",
|
||||
0.0, 0.0
|
||||
UriUtils.res2Uri(
|
||||
EventTypeEnumNew.getPoiTypeBg(
|
||||
EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType,
|
||||
false
|
||||
).toString()
|
||||
).toString()
|
||||
)
|
||||
Logger.d(
|
||||
TAG,
|
||||
@@ -156,10 +166,13 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
)
|
||||
}
|
||||
if (list.size >= 2) {
|
||||
isNotifyRunnableRunning.set(true)
|
||||
handler.postDelayed(this, 4000L)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
isNotifyRunnableRunning.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,11 +228,7 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
newPoint?.also {
|
||||
farthestLocationList.add(LonLatPoint(it.first, it.second))
|
||||
}
|
||||
if (DebugConfig.isDebug()) {
|
||||
farthestLocationList.last().also {
|
||||
showHDMarker(it.longitude, it.latitude)
|
||||
}
|
||||
}
|
||||
busStationHDMarkerStrategy()
|
||||
}
|
||||
MogoData.mogoMapData.get()?.also { iMogoData ->
|
||||
val busStationList = iMogoData.getBusStation(farthestLocationList)
|
||||
@@ -250,6 +259,21 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private var hasShownBorderPointHDMarker = false
|
||||
private fun busStationHDMarkerStrategy() {
|
||||
if (HmiBuildConfig.isShowBusStationStrategyBorderPoint) {
|
||||
farthestLocationList.last().also {
|
||||
showHDMarker(it.longitude, it.latitude)
|
||||
}
|
||||
hasShownBorderPointHDMarker = true
|
||||
} else {
|
||||
if (hasShownBorderPointHDMarker) {
|
||||
removeHDMarker()
|
||||
hasShownBorderPointHDMarker = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHDMarker(lon: Double, lat: Double) {
|
||||
val builder = Point.Options.Builder(
|
||||
"TYPE_MARKER_BUS_STATION", Level.MAP_MARKER
|
||||
@@ -265,4 +289,9 @@ object BusStationEventManager : IMoGoChassisLocationWGS84Listener {
|
||||
overlayManager?.showOrUpdatePoint(builder.build())
|
||||
}
|
||||
|
||||
private fun removeHDMarker() {
|
||||
val overlayManager = CallerMapUIServiceManager.getOverlayManager()
|
||||
overlayManager?.removeAllPointsInOwner("TYPE_MARKER_BUS_STATION")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -199,7 +199,7 @@ internal object V2NIdentifyDrawer {
|
||||
}
|
||||
}
|
||||
val alert = sb.toString()
|
||||
CallerRoadV2NEventWindowListenerManager.show("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
CallerRoadV2NEventWindowListenerManager.showLiveVideo("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude)
|
||||
}
|
||||
}
|
||||
//消息埋点
|
||||
|
||||
@@ -81,6 +81,7 @@ dependencies {
|
||||
compileOnly project(':core:function-impl:mogo-core-function-datacenter')
|
||||
implementation project(':foudations:mogo-commons')
|
||||
api project(':core:mogo-core-res')
|
||||
implementation project(':core:mogo-core-utils')
|
||||
compileOnly project(':core:mogo-core-function-call')
|
||||
}
|
||||
|
||||
|
||||
@@ -1382,6 +1382,14 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
HmiBuildConfig.isShowRouteStrategy = isChecked
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过公交站计算范围边界点 面板控制
|
||||
*/
|
||||
tbBusStationStrategyBorderPoint.isChecked = HmiBuildConfig.isShowBusStationStrategyBorderPoint
|
||||
tbBusStationStrategyBorderPoint.setOnCheckedChangeListener { _, isChecked ->
|
||||
HmiBuildConfig.isShowBusStationStrategyBorderPoint = isChecked
|
||||
}
|
||||
|
||||
btnThresholdDefine.setOnClickListener {
|
||||
try {
|
||||
accelerationThresholdNum = etThreshold.text.toString().toDouble()
|
||||
|
||||
@@ -14,19 +14,24 @@ import androidx.lifecycle.lifecycleScope
|
||||
import com.mogo.commons.utils.MogoAnalyticUtils
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
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.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideImageLoader
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.containerEventContent
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.containerIconHint
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.containerLivePlay
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.containerImageAndLiveVideo
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.contentImageView
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.ivClose
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.ivV2XImage
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.livePlayView
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.roundRoadV2NEventContainer
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.tvV2XHintContent
|
||||
import kotlinx.android.synthetic.main.hmi_view_road_v2n_event_window.view.tvV2XTimeStr
|
||||
@@ -47,7 +52,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
const val TAG = "RoadV2NEventWindowView"
|
||||
const val ANALYTICS_KEY = "hmi_road_event_window_view"
|
||||
|
||||
public fun trackEvent(msg: String) {
|
||||
fun trackEvent(msg: String) {
|
||||
ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.IO) {
|
||||
val map: MutableMap<String, Any> = HashMap()
|
||||
map["msg"] = msg
|
||||
@@ -69,6 +74,11 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_road_v2n_event_window, this, true)
|
||||
}
|
||||
|
||||
val dismissRunnable = Runnable {
|
||||
CallerLogger.i(TAG, "dismissRunnable")
|
||||
visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
if (isPassengerScreen) {
|
||||
val layoutParam =
|
||||
@@ -85,17 +95,17 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
val padding = AutoSizeUtils.dp2px(context, 37f)
|
||||
roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding)
|
||||
|
||||
val containerEventLayoutParams =
|
||||
val containerIconHintLayoutParams =
|
||||
containerIconHint.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerEventLayoutParams.width = LayoutParams.MATCH_PARENT
|
||||
containerEventLayoutParams.height = LayoutParams.WRAP_CONTENT
|
||||
containerEventLayoutParams.setMargins(
|
||||
containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT
|
||||
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
|
||||
containerIconHintLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 50f),
|
||||
AutoSizeUtils.dp2px(context, 40f),
|
||||
AutoSizeUtils.dp2px(context, 50f),
|
||||
0
|
||||
)
|
||||
containerIconHint.layoutParams = containerEventLayoutParams
|
||||
containerIconHint.layoutParams = containerIconHintLayoutParams
|
||||
|
||||
val ivV2XImageLayoutParams = ivV2XImage.layoutParams as RelativeLayout.LayoutParams
|
||||
ivV2XImageLayoutParams.width = AutoSizeUtils.dp2px(context, 69f)
|
||||
@@ -105,22 +115,25 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
val tvV2XHintContentLayoutParams =
|
||||
tvV2XHintContent.layoutParams as RelativeLayout.LayoutParams
|
||||
tvV2XHintContentLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 30f), 0, 0, 0
|
||||
AutoSizeUtils.dp2px(context, 30f), 0,
|
||||
AutoSizeUtils.dp2px(context, 15f), 0
|
||||
)
|
||||
tvV2XHintContent.layoutParams = tvV2XHintContentLayoutParams
|
||||
tvV2XHintContent.setTextColor(Color.parseColor("#131415"))
|
||||
|
||||
val containerLivePlayLayoutParams =
|
||||
containerLivePlay.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerLivePlayLayoutParams.width = AutoSizeUtils.dp2px(context, 498f)
|
||||
containerLivePlayLayoutParams.height = AutoSizeUtils.dp2px(context, 298f)
|
||||
containerLivePlayLayoutParams.setMargins(
|
||||
val containerImageAndLiveVideoLayoutParams =
|
||||
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 498f)
|
||||
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 298f)
|
||||
containerImageAndLiveVideoLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 51f),
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
AutoSizeUtils.dp2px(context, 51f),
|
||||
0
|
||||
)
|
||||
containerLivePlay.layoutParams = containerLivePlayLayoutParams
|
||||
containerImageAndLiveVideo.layoutParams = containerImageAndLiveVideoLayoutParams
|
||||
|
||||
contentImageView.setRadius(AutoSizeUtils.dp2px(context, 36f).toFloat())
|
||||
|
||||
val tvV2XTimeStrLayoutParams =
|
||||
tvV2XTimeStr.layoutParams as ConstraintLayout.LayoutParams
|
||||
@@ -169,17 +182,17 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
val padding = AutoSizeUtils.dp2px(context, 0f)
|
||||
roundRoadV2NEventContainer.setPadding(padding, padding, padding, padding)
|
||||
|
||||
val containerEventLayoutParams =
|
||||
val containerIconHintLayoutParams =
|
||||
containerIconHint.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerEventLayoutParams.width = LayoutParams.MATCH_PARENT
|
||||
containerEventLayoutParams.height = LayoutParams.WRAP_CONTENT
|
||||
containerEventLayoutParams.setMargins(
|
||||
containerIconHintLayoutParams.width = LayoutParams.MATCH_PARENT
|
||||
containerIconHintLayoutParams.height = LayoutParams.WRAP_CONTENT
|
||||
containerIconHintLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
AutoSizeUtils.dp2px(context, 31f),
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
0
|
||||
)
|
||||
containerIconHint.layoutParams = containerEventLayoutParams
|
||||
containerIconHint.layoutParams = containerIconHintLayoutParams
|
||||
|
||||
val ivV2XImageLayoutParams = ivV2XImage.layoutParams as RelativeLayout.LayoutParams
|
||||
ivV2XImageLayoutParams.width = AutoSizeUtils.dp2px(context, 84f)
|
||||
@@ -191,23 +204,25 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
tvV2XHintContentLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 32f),
|
||||
0,
|
||||
0,
|
||||
AutoSizeUtils.dp2px(context, 15f),
|
||||
0
|
||||
)
|
||||
tvV2XHintContent.layoutParams = tvV2XHintContentLayoutParams
|
||||
tvV2XHintContent.setTextColor(Color.parseColor("#FFFFFF"))
|
||||
|
||||
val containerLivePlayLayoutParams =
|
||||
containerLivePlay.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerLivePlayLayoutParams.width = AutoSizeUtils.dp2px(context, 540f)
|
||||
containerLivePlayLayoutParams.height = AutoSizeUtils.dp2px(context, 300f)
|
||||
containerLivePlayLayoutParams.setMargins(
|
||||
val containerImageAndLiveVideoLayoutParams =
|
||||
containerImageAndLiveVideo.layoutParams as ConstraintLayout.LayoutParams
|
||||
containerImageAndLiveVideoLayoutParams.width = AutoSizeUtils.dp2px(context, 540f)
|
||||
containerImageAndLiveVideoLayoutParams.height = AutoSizeUtils.dp2px(context, 300f)
|
||||
containerImageAndLiveVideoLayoutParams.setMargins(
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
AutoSizeUtils.dp2px(context, 30f),
|
||||
0
|
||||
)
|
||||
containerLivePlay.layoutParams = containerLivePlayLayoutParams
|
||||
containerImageAndLiveVideo.layoutParams = containerImageAndLiveVideoLayoutParams
|
||||
|
||||
contentImageView.setRadius(AutoSizeUtils.dp2px(context, 12f).toFloat())
|
||||
|
||||
val tvV2XTimeStrLayoutParams =
|
||||
tvV2XTimeStr.layoutParams as ConstraintLayout.LayoutParams
|
||||
@@ -256,6 +271,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
|
||||
override fun show(dataBean: RoadV2NEventWindowBean) {
|
||||
trackEvent("show --> ${dataBean.toString()}")
|
||||
UiThreadHandler.removeCallbacks(dismissRunnable)
|
||||
UiThreadHandler.post {
|
||||
currentEventUUID = dataBean.eventId
|
||||
ivV2XImage.setImageDrawable(
|
||||
@@ -271,12 +287,35 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
AIAssist.getInstance(context)
|
||||
.speakTTSVoiceWithLevel(dataBean.hintStr, AIAssist.LEVEL0)
|
||||
}
|
||||
val cityCode =
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode
|
||||
containerLivePlay.startRoadCameraLive(dataBean.eventId,
|
||||
dataBean.cameraIp, dataBean.lon, dataBean.lat, cityCode
|
||||
)
|
||||
when (dataBean.eventType) {
|
||||
RoadV2NEventType.TEXT -> {
|
||||
containerImageAndLiveVideo.visibility = View.GONE
|
||||
contentImageView.visibility = View.GONE
|
||||
livePlayView.visibility = View.GONE
|
||||
}
|
||||
|
||||
RoadV2NEventType.IMAGE -> {
|
||||
containerImageAndLiveVideo.visibility = View.VISIBLE
|
||||
contentImageView.visibility = View.VISIBLE
|
||||
livePlayView.visibility = View.GONE
|
||||
GlideImageLoader.getInstance()
|
||||
.displayImage(dataBean.contentImageUrl, contentImageView)
|
||||
}
|
||||
|
||||
RoadV2NEventType.LIVE_VIDEO -> {
|
||||
containerImageAndLiveVideo.visibility = View.VISIBLE
|
||||
contentImageView.visibility = View.GONE
|
||||
livePlayView.visibility = View.VISIBLE
|
||||
val cityCode =
|
||||
CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84().cityCode
|
||||
livePlayView.startRoadCameraLive(
|
||||
dataBean.eventId,
|
||||
dataBean.cameraIp, dataBean.lon, dataBean.lat, cityCode
|
||||
)
|
||||
}
|
||||
}
|
||||
visibility = View.VISIBLE
|
||||
UiThreadHandler.postDelayed(dismissRunnable, 10 * 1000L)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,8 +325,9 @@ class RoadV2NEventWindowView @JvmOverloads constructor(
|
||||
if (eventId == currentEventUUID) {
|
||||
visibility = View.GONE
|
||||
currentEventUUID = ""
|
||||
containerLivePlay.stopRoadCameraLive()
|
||||
livePlayView.stopRoadCameraLive()
|
||||
trackEvent("dismiss --> eventId=${eventId}, 执行dismiss")
|
||||
UiThreadHandler.removeCallbacks(dismissRunnable)
|
||||
} else {
|
||||
trackEvent("dismiss --> eventId=${eventId}, 跳过dismiss")
|
||||
}
|
||||
|
||||
@@ -34,17 +34,19 @@
|
||||
android:layout_height="@dimen/dp_69"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="fitXY"
|
||||
tools:src="@drawable/v2x_icon_shigong_zhandao" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvV2XHintContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_toRightOf="@+id/ivV2XImage"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start"
|
||||
android:layout_centerVertical="true"
|
||||
android:maxLines="2"
|
||||
android:textColor="#131415"
|
||||
android:textSize="@dimen/dp_32"
|
||||
@@ -52,17 +54,37 @@
|
||||
tools:text="前方150米 道路施工 前方150米 道路施工 前方150米 道路施工" />
|
||||
</RelativeLayout>
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventLivePlayView
|
||||
android:id="@+id/containerLivePlay"
|
||||
<FrameLayout
|
||||
android:id="@+id/containerImageAndLiveVideo"
|
||||
android:layout_width="@dimen/dp_498"
|
||||
android:layout_height="@dimen/dp_298"
|
||||
android:layout_marginStart="@dimen/dp_51"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_51"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/containerIconHint" />
|
||||
app:layout_constraintTop_toBottomOf="@id/containerIconHint">
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.v2n.RoadV2NEventLivePlayView
|
||||
android:id="@+id/livePlayView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
android:id="@+id/contentImageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:visibility="visible"
|
||||
app:miv_radius="@dimen/dp_36"
|
||||
app:miv_shape="round"
|
||||
tools:src="@drawable/bg_v2x_bus_station" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvV2XTimeStr"
|
||||
@@ -80,7 +102,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/containerLivePlay"
|
||||
app:layout_constraintTop_toBottomOf="@id/containerImageAndLiveVideo"
|
||||
tools:text="更新时间:10:38:20" />
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -1474,6 +1474,18 @@
|
||||
android:textOn="关闭「引导线动态效果」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/tbBusStationStrategyBorderPoint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_columnWeight="1"
|
||||
android:layout_margin="2dp"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/dp_20"
|
||||
android:textOff="绘制「通过公交站计算范围边界点」"
|
||||
android:textOn="关闭「通过公交站计算范围边界点」"
|
||||
android:textSize="@dimen/dp_24" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etThreshold"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -100,4 +100,11 @@ object HmiBuildConfig {
|
||||
@Volatile
|
||||
var isShowTurnLightView = true
|
||||
|
||||
/**
|
||||
* 是否展示 通过公交站 计算时的范围边界点
|
||||
*/
|
||||
@JvmField
|
||||
@Volatile
|
||||
var isShowBusStationStrategyBorderPoint = false
|
||||
|
||||
}
|
||||
@@ -457,6 +457,13 @@ enum class EventTypeEnumNew(
|
||||
content = "前方%s米交通事故",
|
||||
tts = "蘑菇路侧提醒您,前方%s米交通事故"
|
||||
),
|
||||
TYPE_USECASE_ROAD_BUS_STATION(
|
||||
245.toString(),
|
||||
"通过公交站",
|
||||
poiTypeSrcVr = R.drawable.icon_v2x_bus_station_driver,
|
||||
content = "前方%s米有公交站,蘑菇提醒您小心右侧行人及来车",
|
||||
tts = "前方%s米有公交站,蘑菇提醒您小心右侧行人及来车"
|
||||
),
|
||||
TYPE_ATTENTION_CONFLUENCE(
|
||||
44.toString(),
|
||||
"前方车辆汇流",
|
||||
@@ -504,7 +511,13 @@ enum class EventTypeEnumNew(
|
||||
content = "前方%s米道路施工",
|
||||
tts = "前方%s米道路施工"
|
||||
),
|
||||
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR(
|
||||
"100062",
|
||||
"他车逆行",
|
||||
poiTypeSrcVr = R.drawable.icon_v2x_wrong_direction_car_driver,
|
||||
content = "前方%s米有车辆异常倒车/逆行,蘑菇提醒您注意观察小心通过",
|
||||
tts = "前方%s米有车辆异常倒车/逆行,蘑菇提醒您注意观察小心通过"
|
||||
),
|
||||
TYPE_ERROR(
|
||||
0.toString(),
|
||||
"未知/错误/异常",
|
||||
@@ -691,6 +704,7 @@ enum class EventTypeEnumNew(
|
||||
FOURS_PONDING.poiType, FOURS_ICE.poiType, FOURS_ACCIDENT.poiType,
|
||||
FOURS_ACCIDENT_01.poiType, FOURS_ACCIDENT_02.poiType, FOURS_ACCIDENT_03.poiType,
|
||||
FOURS_ACCIDENT_04.poiType, FOURS_ACCIDENT_05.poiType -> if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> R.drawable.bg_v2x_bus_station
|
||||
else -> {
|
||||
if (isVrMode) R.drawable.bg_v2x_event_type_red_vr else R.drawable.bg_v2x_event_type_read
|
||||
}
|
||||
@@ -729,6 +743,7 @@ enum class EventTypeEnumNew(
|
||||
TYPE_SOCKET_ROAD_SHIGONG.poiType,
|
||||
TYPE_SOCKET_ROAD_JINGZHI.poiType,
|
||||
TYPE_SOCKET_ROAD_SHIGU.poiType,
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType,
|
||||
TYPE_SOCKET_ROAD_CONGESTION.poiType -> true
|
||||
else -> false
|
||||
}
|
||||
@@ -749,6 +764,8 @@ enum class EventTypeEnumNew(
|
||||
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.tts
|
||||
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.tts
|
||||
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.tts
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.tts
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> TYPE_USECASE_ROAD_BUS_STATION.tts
|
||||
else -> "道路事件"
|
||||
}
|
||||
}
|
||||
@@ -770,6 +787,8 @@ enum class EventTypeEnumNew(
|
||||
TYPE_SOCKET_ROAD_JINGZHI.poiType -> TYPE_SOCKET_ROAD_JINGZHI.content
|
||||
TYPE_SOCKET_ROAD_SHIGU.poiType -> TYPE_SOCKET_ROAD_SHIGU.content
|
||||
TYPE_SOCKET_ROAD_CONGESTION.poiType -> TYPE_SOCKET_ROAD_CONGESTION.content
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.content
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> TYPE_USECASE_ROAD_BUS_STATION.content
|
||||
else -> "道路事件"
|
||||
}
|
||||
}
|
||||
@@ -1131,6 +1150,14 @@ enum class EventTypeEnumNew(
|
||||
TYPE_IPC_DISCONNECT_FOR_MO_FANG.poiType -> {
|
||||
TYPE_IPC_DISCONNECT_FOR_MO_FANG.poiTypeStr
|
||||
}
|
||||
// 通过公交站
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> {
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiTypeStr
|
||||
}
|
||||
// 他车逆行
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> {
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiTypeStr
|
||||
}
|
||||
else ->{
|
||||
"事件通知"
|
||||
}
|
||||
@@ -1157,6 +1184,10 @@ enum class EventTypeEnumNew(
|
||||
TYPE_SOCKET_ROAD_JINGZHI.poiType -> R.drawable.v2x_icon_jingzhi_zhangai
|
||||
TYPE_SOCKET_ROAD_SHIGU.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_shigu_passenger else R.drawable.icon_shigu_driver
|
||||
TYPE_SOCKET_ROAD_CONGESTION.poiType -> R.drawable.v2x_icon_yongdu_vr
|
||||
// 他车逆行/倒车
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_v2x_wrong_direction_car_passenger else R.drawable.icon_v2x_wrong_direction_car_driver
|
||||
// 通过公交站
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) R.drawable.icon_v2x_bus_station_passenger else R.drawable.icon_v2x_bus_station_driver
|
||||
//拥堵
|
||||
FOURS_BLOCK_UP.poiType -> {
|
||||
R.drawable.icon_warning_v2x_congestion
|
||||
@@ -1400,7 +1431,8 @@ enum class EventTypeEnumNew(
|
||||
TYPE_USECASE_ID_ACCIDENT.poiType -> TYPE_USECASE_ID_ACCIDENT.content
|
||||
TYPE_ATTENTION_CONFLUENCE.poiType -> TYPE_ATTENTION_CONFLUENCE.content
|
||||
TYPE_PEDESTRIAN_CROSSING.poiType -> TYPE_PEDESTRIAN_CROSSING.content
|
||||
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.content
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> TYPE_USECASE_ROAD_BUS_STATION.content
|
||||
else -> TYPE_ERROR.content
|
||||
}
|
||||
}
|
||||
@@ -1463,7 +1495,8 @@ enum class EventTypeEnumNew(
|
||||
TYPE_USECASE_ID_ACCIDENT.poiType -> TYPE_USECASE_ID_ACCIDENT.tts
|
||||
TYPE_ATTENTION_CONFLUENCE.poiType -> TYPE_ATTENTION_CONFLUENCE.tts
|
||||
TYPE_PEDESTRIAN_CROSSING.poiType -> TYPE_PEDESTRIAN_CROSSING.tts
|
||||
|
||||
TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.poiType -> TYPE_SOCKET_ROAD_WRONG_DIRECTION_CAR.tts
|
||||
TYPE_USECASE_ROAD_BUS_STATION.poiType -> TYPE_USECASE_ROAD_BUS_STATION.tts
|
||||
else -> TYPE_ERROR.tts
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,20 @@ package com.mogo.eagle.core.data.v2x
|
||||
* 路侧道路事件 弹框
|
||||
*/
|
||||
data class RoadV2NEventWindowBean(
|
||||
var eventType: RoadV2NEventType, //事件弹框类型
|
||||
var eventId: String, //当前事件弹框 ID, show时生成,用于dismiss时使用
|
||||
var timestamp: Long = 0, //事件发生事件戳
|
||||
var iconResId: Int, //事件icon resource id
|
||||
var iconResId: Int, //事件icon res id
|
||||
var hintStr: String, //事件提示文案
|
||||
var isNeedTTS: Boolean = false, //事件文案是否需要同步tts
|
||||
var contentImageUrl: String, // Image 类型时图片 url
|
||||
var cameraIp: String, // 路侧camera ip,用于请求获取拉流地址
|
||||
var lon: Double, //事件坐标-经度
|
||||
var lat: Double, //事件坐标-纬度
|
||||
) {
|
||||
override fun toString(): String {
|
||||
return "RoadV2NEventWindowBean(eventId='$eventId', timestamp=$timestamp, iconResId=$iconResId, hintStr='$hintStr', isNeedTTS=$isNeedTTS, cameraIp='$cameraIp', lon=$lon, lat=$lat)"
|
||||
return "RoadV2NEventWindowBean(eventType=$eventType, eventId='$eventId', timestamp=$timestamp, iconResId='$iconResId', hintStr='$hintStr', isNeedTTS=$isNeedTTS, contentImageUrl='$contentImageUrl', cameraIp='$cameraIp', lon=$lon, lat=$lat)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum class RoadV2NEventType { TEXT, IMAGE, LIVE_VIDEO }
|
||||
|
||||
@@ -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}")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 276 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user