[2.15.0][feat]替换全览模式的V2X数据来源

This commit is contained in:
chenfufeng
2023-03-30 18:15:09 +08:00
parent 86df90cd10
commit c9de9aa286
6 changed files with 137 additions and 7 deletions

View File

@@ -22,13 +22,16 @@ import com.amap.api.maps.TextureMapView
import com.amap.api.maps.model.*
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.v2x.Center
import com.mogo.eagle.core.data.v2x.V2XEventData
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager
import com.mogo.eagle.core.function.call.biz.CallerFuncBizListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showVideoDialog
import com.mogo.eagle.core.function.map.R
@@ -43,9 +46,12 @@ import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocat
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
import com.mogo.eagle.core.function.smp.V2XMarkerView
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo.telematics.pad.MessagePad
import mogo.v2x.MogoV2X
import kotlin.math.pow
/**
* 全览地图View
@@ -57,7 +63,7 @@ class OverMapView @JvmOverloads constructor(
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : RelativeLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,
IMoGoPlanningRottingListener {
IMoGoPlanningRottingListener, IMoGoV2XListener {
// =============自定义属性相关=============
private var mapStylePath: String? = null
@@ -313,9 +319,10 @@ class OverMapView @JvmOverloads constructor(
}
override fun onV2XEvents(v2XEventData: List<V2XEventData>?) {
showV2XEventMarkers(v2XEventData)
// showV2XEventMarkers(v2XEventData)
}
})
CallerV2XListenerManager.addListener(TAG, this)
// 主动查一次全局路径规划的数据
getGlobalPath()
}
@@ -471,6 +478,7 @@ class OverMapView @JvmOverloads constructor(
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
CallerPlanningRottingListenerManager.removeListener(TAG)
CallerV2XListenerManager.removeListener(TAG)
}
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
@@ -696,4 +704,53 @@ class OverMapView @JvmOverloads constructor(
handlePlanningData(it.wayPointsList)
}
}
override fun onV2nGlobalPathEvents(
eventCount: Int,
construct: MogoV2X.RSI_PB?,
triangle: MogoV2X.RSI_PB?,
congestion: MogoV2X.RSI_PB?,
parkingViolation: MogoV2X.RSM_PB?
) {
val constructList = construct?.rsiFrame?.rtes?.rteDataList
val triangleList = triangle?.rsiFrame?.rtes?.rteDataList
val congestionList = congestion?.rsiFrame?.rtes?.rteDataList
val parkingList = parkingViolation?.rsmFrame?.participants?.participantDataList
val list = ArrayList<V2XEventData>()
constructList?.forEach {
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
list.add(V2XEventData(
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10006", 1
))
}
}
triangleList?.forEach {
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
list.add(V2XEventData(
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10032", 1
))
}
}
congestionList?.forEach {
it.eventPos?.offsetLL?.positionLatLon?.let { latLon ->
list.add(V2XEventData(
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10007", 1
))
}
}
parkingList?.forEach {
it.pos?.offsetLL?.positionLatLon?.let { latLon ->
list.add(V2XEventData(
0, 0, "", Center(latLon.lat * 10.0.pow(-7.0),
latLon.lon * 10.0.pow(-7.0)), null, 0.0, "10025", 1
))
}
}
UiThreadHandler.post {
showV2XEventMarkers(list)
}
}
}