[6.5.0][道路事件] 逻辑优化
This commit is contained in:
@@ -322,7 +322,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid")
|
||||
val newEventId = "other_retrograde_vehicle_${event.eventId}"
|
||||
val isUseGps = event.gnssType != 0
|
||||
val eventLocation = if (isUseGps) arrayOf(event.longitude, event.latitude) else CoordinateTransform.GCJ02ToWGS84(event.longitude, event.latitude)
|
||||
Logger.i(TAG, "isUseGps --> $isUseGps")
|
||||
val eventLocation = arrayOf(event.longitude, event.latitude)
|
||||
val carLocation = if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
AiRoadMarker.aiMakers.getOrPut(newEventId) {
|
||||
val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1])
|
||||
@@ -396,7 +397,8 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
}
|
||||
Logger.d(TAG, "cameraIp: $cameraIp, heading:$heading, uuid: $uuid")
|
||||
val isUseGps = data.gnssType != 0
|
||||
val eventLocation = if (isUseGps) arrayOf(data.longitude, data.latitude) else CoordinateTransform.GCJ02ToWGS84(data.longitude, data.latitude)
|
||||
Logger.i(TAG, "isUseGps --> $isUseGps")
|
||||
val eventLocation = arrayOf(data.longitude, data.latitude)
|
||||
val carLocation = if (isUseGps) CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() else CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val distance = CoordinateUtils.calculateLineDistance(carLocation.longitude, carLocation.latitude, eventLocation[0], eventLocation[1])
|
||||
AiRoadMarker.aiMakers.getOrPut(data.eventId) {
|
||||
|
||||
@@ -109,12 +109,14 @@ class AiRoadMarker {
|
||||
.set3DMode(true)
|
||||
.isUseGps(marker.isUseGps)
|
||||
.icon3DRes(EventTypeEnumNew.getMarker3DRes(marker.poiType))
|
||||
.anchorColor("#D65D5AFF")
|
||||
.controlAngle(true)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.rotate(marker.poi_angle.toFloat())
|
||||
.longitude(marker.poi_lon)
|
||||
.latitude(marker.poi_lat)
|
||||
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType) {
|
||||
builder.anchorColor("#D6E1BA9A")
|
||||
}
|
||||
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdatePoint(builder.build())?.let { p ->
|
||||
if (!markerIds.contains(markerId)) {
|
||||
markerIds.add(markerId)
|
||||
|
||||
@@ -78,7 +78,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
|
||||
override fun onStopLineInfo(info: StopLine) {
|
||||
Log.d(TAG, "-- onStopLineInfo --: ${info.distance}")
|
||||
if (!hasCrossRoad && info.distance <= 30.0) {
|
||||
if (!hasCrossRoad && info.distance <= 80.0) {
|
||||
hasCrossRoad = true
|
||||
triggerRoadId.set(this.roadId.get())
|
||||
distanceOfCarToStopLine.set(info.distance)
|
||||
@@ -140,7 +140,11 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
if (delay > 0) {
|
||||
delay(delay)
|
||||
}
|
||||
val lastPriority = prevScene.get()?.priority ?: Int.MIN_VALUE
|
||||
val prev = prevScene.get()
|
||||
if (prev?.javaClass == scene.javaClass) {
|
||||
return@launch
|
||||
}
|
||||
val lastPriority = prev?.priority ?: Int.MIN_VALUE
|
||||
val currentPriority = scene.priority
|
||||
if (lastPriority > currentPriority) {
|
||||
return@launch
|
||||
@@ -161,6 +165,11 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
Log.d(TAG, "--- doChangeAngle ---: $target")
|
||||
val prev = prevScene.get()
|
||||
try {
|
||||
if (!target.isCanTouch) {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(false)
|
||||
} else {
|
||||
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
|
||||
}
|
||||
it.changeMapVisualAngle(angle, null)
|
||||
} finally {
|
||||
if (prev == null || prev.javaClass != target.javaClass) {
|
||||
|
||||
@@ -22,6 +22,9 @@ class CrossRoad(private val delayTime: Long): Scene {
|
||||
override val isCanSwitch: Boolean
|
||||
get() = false
|
||||
|
||||
override val isCanTouch: Boolean
|
||||
get() = false
|
||||
|
||||
override fun toString(): String {
|
||||
return "CrossRoad(delayTime=${delayTime}, priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority})"
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ class Default(val delayTime: Long = 2, val unit: TimeUnit = TimeUnit.SECONDS): S
|
||||
override val isCanSwitch: Boolean
|
||||
get() = true
|
||||
|
||||
override val isCanTouch: Boolean
|
||||
get() = true
|
||||
|
||||
override fun toString(): String {
|
||||
return "Default(delay=$delay, unit=$unit, angle=$angle, priority=$priority)"
|
||||
}
|
||||
|
||||
@@ -19,4 +19,7 @@ class LongSight(private val delayTime: Long, private val unit: TimeUnit = TimeUn
|
||||
|
||||
override val isCanSwitch: Boolean
|
||||
get() = true
|
||||
|
||||
override val isCanTouch: Boolean
|
||||
get() = true
|
||||
}
|
||||
@@ -27,4 +27,7 @@ class RoadEvent(private val delayTime: Long, private val unit: TimeUnit): Scene
|
||||
|
||||
override val isCanSwitch: Boolean
|
||||
get() = true
|
||||
|
||||
override val isCanTouch: Boolean
|
||||
get() = true
|
||||
}
|
||||
Reference in New Issue
Block a user