[2.13.2] new func
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
|
||||
@@ -75,4 +76,8 @@ class MapIdentifySubscriber private constructor() :IMoGoIdentifyListener, IMoGoS
|
||||
return IdentifyFactory.getIdentifyObj(uuid)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,9 +9,7 @@ object TrackerSourceColorHelper {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
fun filterData(data: TrackedObject): Boolean {
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type
|
||||
|| data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_501.type || data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_502.type
|
||||
) {
|
||||
if (!FunctionBuildConfig.isDrawUnknownIdentifyData && data.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type) {
|
||||
return true
|
||||
}
|
||||
var trackIPCFilter = true
|
||||
|
||||
@@ -466,34 +466,34 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb
|
||||
.filter { planningObj: MessagePad.PlanningObject -> planningObj.type >= 1000 }
|
||||
.findFirst()
|
||||
if (first.isPresent) {
|
||||
when (first.get().type) {
|
||||
// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物
|
||||
// }
|
||||
val poiType = when (first.get().type) {
|
||||
// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物
|
||||
// }
|
||||
1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域
|
||||
val trackedObj =
|
||||
CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString())
|
||||
trackedObj?.let { t ->
|
||||
handleRoadMarkerEvent(t.toRoadMarker())
|
||||
}
|
||||
EventTypeEnum.AI_ROAD_WORK.poiType
|
||||
}
|
||||
1007 -> { //三角牌
|
||||
|
||||
EventTypeEnum.FOURS_ACCIDENT.poiType
|
||||
}
|
||||
else -> {
|
||||
return
|
||||
}
|
||||
}
|
||||
val trackedObj =
|
||||
CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString())
|
||||
trackedObj?.let { t ->
|
||||
TrackUtils.trackV2xRoadProduceEvent(1)
|
||||
val v2XMessageEntity = V2XMessageEntity<V2XRoadEventEntity>()
|
||||
v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING
|
||||
v2XMessageEntity.content = t.toRoadMarker(poiType).toV2XRoadEventEntity()
|
||||
v2XMessageEntity.isShowState = true
|
||||
V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// private fun buildRoadEntity(e: V2XMarkerExploreWay, extra: Map<String, Any>? = null): V2XRoadEventEntity { // 记录道路事件
|
||||
// val v2XRoadEventEntity = V2XRoadEventEntity()
|
||||
// v2XRoadEventEntity.location = e.location.toMarkerLocation() // 探路目前只有上报拥堵
|
||||
// v2XRoadEventEntity.poiType = EventTypeEnum.AI_ROAD_WORK.poiType
|
||||
// v2XRoadEventEntity.noveltyInfo = e.toMarkExploreWay(extra)
|
||||
// v2XRoadEventEntity.expireTime = 20000
|
||||
// return v2XRoadEventEntity
|
||||
// }
|
||||
|
||||
private fun handleWarningTargetEvent(data: V2XWarningTarget) {
|
||||
val v2xMessageEntity = V2XMessageEntity<V2XWarningTarget>()
|
||||
v2xMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_THE_FRONT_WEAKNESS
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.mogo.eagle.core.function.v2x.events.utils
|
||||
import androidx.core.util.Pair
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum.Companion.isRoadEvent
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerLocation
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerUserInfo
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.v2x.events.manager.impl.MoGoV2XMarkerManager
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker
|
||||
import com.mogo.v2x.data.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
@@ -105,7 +108,7 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult =
|
||||
)
|
||||
}
|
||||
|
||||
fun MessagePad.TrackedObject.toRoadMarker(): V2XMarkerCardResult =
|
||||
fun MessagePad.TrackedObject.toRoadMarker(poiType:String): V2XMarkerCardResult =
|
||||
V2XMarkerCardResult().also { l1 ->
|
||||
this.polygonList?.takeIf { it.isNotEmpty() }?.also { old ->
|
||||
l1.extras = HashMap<String, List<Pair<Double, Double>>>().also { extra ->
|
||||
@@ -115,7 +118,7 @@ fun MessagePad.TrackedObject.toRoadMarker(): V2XMarkerCardResult =
|
||||
}
|
||||
l1.exploreWay = ArrayList<V2XMarkerExploreWay>().also { l2 ->
|
||||
l2.add(V2XMarkerExploreWay().also { l3 ->
|
||||
l3.poiType = EventTypeEnum.AI_ROAD_WORK.poiType
|
||||
l3.poiType = poiType
|
||||
l3.generateTime = 0L
|
||||
l3.location = V2XMarkerLocation().also { l4 ->
|
||||
val p = CoordinateUtils.transformWgsToGcj(this.latitude, this.longitude)
|
||||
@@ -125,8 +128,21 @@ fun MessagePad.TrackedObject.toRoadMarker(): V2XMarkerCardResult =
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun V2XMarkerCardResult.toV2XRoadEventEntity():V2XRoadEventEntity =
|
||||
V2XRoadEventEntity().also { l1 ->
|
||||
val exploreWayList: List<V2XMarkerExploreWay>? = this.exploreWay
|
||||
if(!exploreWayList.isNullOrEmpty() && exploreWayList.isNotEmpty()){
|
||||
for (markerExploreWay in exploreWayList) {
|
||||
if (isRoadEvent(markerExploreWay.poiType)) {
|
||||
val markerLocation = markerExploreWay.location
|
||||
l1.location = markerLocation.toMarkerLocation()
|
||||
l1.poiType = markerExploreWay.poiType
|
||||
l1.noveltyInfo = markerExploreWay.toMarkExploreWay(this.extras)
|
||||
l1.expireTime = 20000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AiRoadMarker.receive(
|
||||
AiRoadMarker.Marker(this.latitude, this.longitude, this.heading, null, null, null)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user