diff --git a/build.gradle b/build.gradle index cbd64fba4f..afc1ee4733 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ buildscript { classpath 'com.mogo.cloud:systrace:1.0.1' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18' classpath 'com.mogo.sticky:service:1.0.8' - classpath 'io.github.knight-zxw:lancet-plugin:0.0.4' + classpath 'io.github.knight-zxw:lancet-plugin:0.0.4_mogo' // classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true } } diff --git a/config.gradle b/config.gradle index 5365d0898b..c95cde91f4 100644 --- a/config.gradle +++ b/config.gradle @@ -220,7 +220,7 @@ ext { //========================= LancetX =================== - lancetx_runtime : "io.github.knight-zxw:lancet-runtime:0.0.4", + lancetx_runtime : "io.github.knight-zxw:lancet-runtime:0.0.4_mogo", //========================= autosize ====================== androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1', diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt index 7f0be345a3..1c40d47f56 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt @@ -52,13 +52,12 @@ import com.mogo.eagle.core.function.v2x.events.utils.toV2XRoadEventEntity import com.mogo.eagle.core.function.v2x.internal.V2XManager import com.mogo.eagle.core.function.v2x.internal.callback.IV2XCallback import com.mogo.eagle.core.function.v2x.internal.config.V2XConfig -import com.mogo.eagle.core.function.v2x.internal.data.V2XAdvanceWarning -import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult -import com.mogo.eagle.core.function.v2x.internal.data.V2XWarningTarget +import com.mogo.eagle.core.function.v2x.internal.data.* import com.mogo.eagle.core.function.v2x.internal.event.V2XEvent import com.mogo.eagle.core.function.v2x.road.V2XEventServiceApi import com.mogo.eagle.core.network.MoGoRetrofitFactory import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.eagle.core.utilcode.mogo.logger.Logger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.UiThreadHandler @@ -209,6 +208,13 @@ object V2XEventManager : IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback, } handleRoadMarkerEvent(event.data.toRoadMarker()) } + + is V2XEvent.RoadEventX -> { + handleRoadMarkerEvent(event.data.toRoadMarker()) + } + else -> { + Logger.e(TAG, "onAck other event: $event") + } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java index 7b0d9d278e..327a28d209 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/manager/impl/MoGoV2XMarkerManager.java @@ -90,18 +90,18 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { // 清除上次的道路事件, 这里注意,道路事件的触发和这里是异步操作会触发异常 mV2XRoadEventEntityArrayList.clear(); // 获取探路以及新鲜事儿 - List exploreWayList = markerCardResult.getExploreWay(); + List exploreWayList = markerCardResult.getExploreWay(); if (exploreWayList != null) { - for (V2XMarkerExploreWay markerExploreWay : exploreWayList) { + for (MarkerExploreWay markerExploreWay : exploreWayList) { if (EventTypeEnumNew.isRoadEvent(markerExploreWay.getPoiType())) { - V2XMarkerLocation markerLocation = markerExploreWay.getLocation(); + MarkerLocation markerLocation = markerExploreWay.getLocation(); // 记录道路事件 V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity(); - v2XRoadEventEntity.setLocation(EntityUtilsKt.toMarkerLocation(markerLocation)); + v2XRoadEventEntity.setLocation(markerLocation); // 探路目前只有上报拥堵 String poi = markerExploreWay.getPoiType(); v2XRoadEventEntity.setPoiType(poi); - v2XRoadEventEntity.setNoveltyInfo(EntityUtilsKt.toMarkExploreWay(markerExploreWay, markerCardResult.getExtras())); + v2XRoadEventEntity.setNoveltyInfo(markerExploreWay); v2XRoadEventEntity.setExpireTime(20000); mV2XRoadEventEntityArrayList.add(v2XRoadEventEntity); } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt index 1a1bc8ce6c..c088868c50 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/airoad/AiRoadMarker.kt @@ -7,7 +7,6 @@ import android.os.Looper import android.view.animation.DecelerateInterpolator import androidx.core.util.Pair import com.mogo.cloud.commons.utils.* -import com.mogo.commons.AbsMogoApplication import com.mogo.eagle.core.data.map.MogoLatLng import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity import com.mogo.eagle.core.function.call.autopilot.* diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt index 26dacad912..2a1ee214bd 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XAiRoadEventMarker.kt @@ -18,63 +18,39 @@ class V2XAiRoadEventMarker { private val current = AtomicReference?>>() - private val v2xLocation = AtomicReference() - private val overlayManager by lazy { CallerMapUIServiceManager.getOverlayManager() } fun drawMarkers(entity: V2XRoadEventEntity, wrapper: MarkerWrapper) { - val extra = entity.noveltyInfo.extras["polygon"] + val polygon = entity.noveltyInfo.polygon v2xMarker()?.drawableAlarmPOI(context(), entity, null)?.also { wrapper.addMarker(it) } - if (extra is List<*> && entity.poiType != EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.poiType) { - if (extra.size > 0) { - val polygons: MutableList> = ArrayList() - for (i in extra.indices) { - val o = extra[i]!! as? androidx.core.util.Pair<*, *> ?: continue - val first = o.first - val second = o.second - if (first == null || second == null) { - continue - } - if (first !is Double || second !is Double) { - continue - } - polygons.add(androidx.core.util.Pair.create(second, first)) - } - if (polygons.size > 0) { - val l2 = entity.noveltyInfo?.location ?: return - v2xLocation.set(MogoLocation().also { - it.longitude = l2.lon; it.latitude = l2.lat; it.heading = l2.angle - }) + if (polygon != null && polygon.isNotEmpty() && entity.poiType != EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.poiType) { + val options = MogoPolylineOptions() + val colors = ArrayList() + colors.add(Color.argb(204, 237, 172, 21)) + colors.add(Color.argb(0, 255, 255, 255)) + options.colorValues(colors) + val points = ArrayList() - val options = MogoPolylineOptions() - val colors = ArrayList() - colors.add(Color.argb(204, 237, 172, 21)) - colors.add(Color.argb(0, 255, 255, 255)) - options.colorValues(colors) - val points = ArrayList() - - for (p in polygons) { - points.add(MogoLatLng(p.first, p.second)) - } - if (points.size > 2) { - points.add(points[0]) - } - options.points(points) - options.useGradient(true) - options.useFacade(true) - options.setGps(true) - options.width(5f) - options.zIndex(75000f) - options.maxIndex(800000f) - val line = overlayManager?.addPolyline(options) - line?.let { - current.set(Pair(line, wrapper.markers)) - line.isVisible = true - wrapper.addLine(line) - } - } + for (p in polygon) { + points.add(MogoLatLng(p.first, p.second)) + } + if (points.size > 2) { + points.add(points[0]) + } + options.points(points) + options.useGradient(true) + options.useFacade(true) + options.setGps(true) + options.width(5f) + options.zIndex(75000f) + options.maxIndex(800000f) + val line = overlayManager?.addPolyline(options) + line?.let { + current.set(Pair(line, wrapper.markers)) + line.isVisible = true + wrapper.addLine(line) } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java index a743246918..b97689f35b 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventMarker.java @@ -1,9 +1,7 @@ package com.mogo.eagle.core.function.v2x.events.scenario.scene.road; import android.util.Log; - import androidx.core.util.Pair; - import com.mogo.eagle.core.data.enums.EventTypeEnumNew; import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; import com.mogo.eagle.core.data.map.entity.MarkerLocation; @@ -15,7 +13,6 @@ import com.mogo.eagle.core.function.v2x.events.remove.MarkerRemoveManager; import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker; import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.map.marker.IMogoMarker; - import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -34,10 +31,21 @@ public class V2XRoadEventMarker implements IV2XMarker { if (marker != null) { if (entity != null) { Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType()); - if (!Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) - && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType()) - && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) - && !Objects.equals(entity.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType())) { + if (isAiRoadEvent(entity.getPoiType())) { + MarkerExploreWay noveltyInfo = entity.getNoveltyInfo(); + Log.d("RWJ", "V2XRoadEventMarker -> noveltyInfo:" + noveltyInfo); + if (noveltyInfo != null) { + Pair gpsLocation = noveltyInfo.getGpsLocation(); + List> polygons = noveltyInfo.getPolygon(); + if (gpsLocation != null && polygons != null) { + MarkerLocation location = noveltyInfo.getLocation(); + AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity); + AiRoadMarker aiMarker = new AiRoadMarker(); + aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType())); + AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker); + } + } + } else { IMogoMarker iMarker = marker.drawableAlarmPOI(BridgeApi.INSTANCE.context(), entity, null); if (iMarker != null) { Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- add Marker"); @@ -48,48 +56,6 @@ public class V2XRoadEventMarker implements IV2XMarker { } else { Log.d("RWJ", "V2XRoadEventMarker:" + entity.getPoiType() + "--- return empty marker"); } - } else { - MarkerExploreWay noveltyInfo = entity.getNoveltyInfo(); - Log.d("RWJ", "V2XRoadEventMarker -> noveltyInfo:" + noveltyInfo); - if (noveltyInfo != null && noveltyInfo.extras != null) { - List> polygons = new ArrayList<>(); - Pair gpsLocation = null; - if (noveltyInfo.extras.containsKey("polygon")) { - Object extra = noveltyInfo.extras.get("polygon"); - if (extra instanceof List) { - List l = (List) extra; - if (l.size() > 0) { - for (int i = 0; i < l.size(); i++) { - Object o = l.get(i); - if (!(o instanceof Pair)) { - continue; - } - Pair p = (Pair) o; - Object first = p.first; - Object second = p.second; - if (first == null || second == null) { - continue; - } - if (!(first instanceof Double) || !(second instanceof Double)) { - continue; - } - polygons.add(Pair.create((Double) first, (Double) second)); - } - } - } - } - - if (noveltyInfo.extras.containsKey("gps_location")) { - gpsLocation = (Pair) ((List)(noveltyInfo.extras.get("gps_location"))).get(0); - } - if (!polygons.isEmpty() && gpsLocation != null) { - MarkerLocation location = noveltyInfo.getLocation(); - AiRoadMarker.Marker m = new AiRoadMarker.Marker(noveltyInfo.getInfoId(), noveltyInfo.getPoiType(), gpsLocation.second, gpsLocation.first, location.getAngle(), polygons, null, entity); - AiRoadMarker aiMarker = new AiRoadMarker(); - aiMarker.marker(m, true, isDrawRoadLine(m.getPoiType())); - AiRoadMarker.aiMakers.put(noveltyInfo.getInfoId(), aiMarker); - } - } } } } @@ -98,6 +64,13 @@ public class V2XRoadEventMarker implements IV2XMarker { } } + private boolean isAiRoadEvent(String poiType) { + return Objects.equals(poiType, EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) + && Objects.equals(poiType, EventTypeEnumNew.FOURS_ACCIDENT_04.getPoiType()) + && Objects.equals(poiType, EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) + && Objects.equals(poiType, EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType()); + } + private boolean isDrawRoadLine(String poiType) { return EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType().equals(poiType); } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt index 65ebd78c9d..0b8602e86e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/utils/EntityUtils.kt @@ -4,7 +4,6 @@ import androidx.core.util.Pair import com.mogo.eagle.core.data.enums.EventTypeEnumNew.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.scenario.scene.airoad.AiRoadMarker import com.mogo.eagle.core.function.v2x.internal.data.* @@ -13,85 +12,24 @@ import mogo.telematics.pad.MessagePad import roadwork.Road -fun V2XMarkerLocation?.toMarkerLocation(): MarkerLocation? = - if (this == null) null else MarkerLocation().also { - it.lon = this.lon - it.lat = this.lat - it.address = this.address - it.angle = this.angle - } - -fun MarkerExploreWayItem?.toMarkerExploreWayItem(): com.mogo.eagle.core.data.map.entity.MarkerExploreWayItem? = - if (this == null) null else com.mogo.eagle.core.data.map.entity.MarkerExploreWayItem().also { - it.illegalCount = this.illegalCount - it.content = this.content - it.url = this.url - it.thumbnail = this.thumbnail - } - -fun V2XMarkerUserInfo?.toMarkerUserInfo(): MarkerUserInfo? = - if (this == null) null else MarkerUserInfo().also { - it.safeLabelType = this.safeLabelType - it.safeLabel = this.safeLabel - it.lastActiveweekAvgscore = this.lastActiveweekAvgscore - it.gender = this.gender - it.userHead = this.userHead - it.userName = this.userName - it.setAge(this.age) - } - -fun V2XMarkerExploreWay.toMarkExploreWay(extras: Map? = null): MarkerExploreWay = - MarkerExploreWay().also { - it.items = this.items?.map { itx -> itx.toMarkerExploreWayItem() } - it.userInfo = this.userInfo?.toMarkerUserInfo() - it.distance = this.distance - it.cityName = this.cityName - it.setGenerateTime(this.generateTime) - it.infoId = this.infoId - it.setFileType(this.fileType) - it.setDirection(this.direction) - it.location = this.location?.toMarkerLocation() - it.sn = this.sn - it.canLive = this.canLive != "0" - it.poiType = this.poiType - it.type = this.type - it.infoCheckNode = this.infoCheckNode - it.isFabulous = this.isFabulous - it.uploadType = this.uploadType - it.isCanLive = this.canLive != "0" - it.extras = extras - } - fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult = V2XMarkerCardResult().also { l1 -> - this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.also { old -> - l1.extras = HashMap>>().also { extra -> - extra["polygon"] = old.map { d -> - Pair(d.lon, d.lat) - } - - extra["gps_location"] = listOf( - Pair( - this.roadwork?.center?.point?.lon ?: 0.0, - this.roadwork?.center?.point?.lat ?: 0.0 - ) - ) - } - } val centerX = this.roadwork?.center?.point?.lon ?: 0.0 val centerY = this.roadwork?.center?.point?.lat ?: 0.0 val id = "${centerX}_${centerY}" - l1.exploreWay = ArrayList().also { l2 -> - l2.add(V2XMarkerExploreWay().also { l3 -> + l1.exploreWay = ArrayList().also { l2 -> + l2.add(MarkerExploreWay().also { l3 -> l3.poiType = this.roadwork?.poiType?.toString() - l3.generateTime = this.roadwork?.detectTime ?: 0L - l3.location = V2XMarkerLocation().also { l4 -> + l3.setGenerateTime(this.roadwork?.detectTime ?: 0L) + l3.location = MarkerLocation().also { l4 -> val p = CoordinateTransform.WGS84ToGCJ02(this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.point?.lat ?: 0.0) l4.lon = p[0] l4.lat = p[1] l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0 } l3.infoId = id + l3.gpsLocation = Pair(this.roadwork?.center?.point?.lon ?: 0.0, this.roadwork?.center?.point?.lat ?: 0.0) + l3.polygon = this.roadwork?.polygonList?.takeIf { it.isNotEmpty() }?.map { Pair(it.lon, it.lat) } }) } AiRoadMarker.aiMakers[id]?.receive() @@ -99,52 +37,41 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult = fun V2XRoadXData.toRoadMarker(): V2XMarkerCardResult = V2XMarkerCardResult().also { l1 -> - this.polygon?.takeIf { it.isNotEmpty() }?.also { old -> - l1.extras = HashMap>>().also { extra -> - extra["polygon"] = old.map { d -> - Pair(d.lon, d.lat) - } - extra["gps_location"] = listOf(Pair(this.center?.lon ?: 0.0, this.center?.lat ?: 0.0)) - } - } - - l1.exploreWay = ArrayList().also { l2 -> - l2.add(V2XMarkerExploreWay().also { l3 -> + l1.exploreWay = ArrayList().also { l2 -> + l2.add(MarkerExploreWay().also { l3 -> l3.poiType = this.poiType - l3.generateTime = this.detectTime ?: 0L - l3.location = V2XMarkerLocation().also { l4 -> + l3.setGenerateTime(this.detectTime ?: 0L) + l3.location = MarkerLocation().also { l4 -> val p = CoordinateTransform.WGS84ToGCJ02(this.center?.lon ?: 0.0, this.center?.lat ?: 0.0) l4.lon = p[0] l4.lat = p[1] l4.angle = this.centerRoad?.bearing ?: 0.0 } l3.infoId = this.index + l3.gpsLocation = Pair(this.center?.lon ?: 0.0, this.center?.lat ?: 0.0) + l3.polygon = this.polygon?.takeIf { it.isNotEmpty() }?.map { Pair(it.lon, it.lat) } }) } - AiRoadMarker.aiMakers[this.index]?.receive() } fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult = V2XMarkerCardResult().also { l1 -> - this.polygonList?.takeIf { it.isNotEmpty() }?.also { old -> - l1.extras = HashMap>>().also { extra -> - extra["polygon"] = old.map { d -> Pair(d.longitude, d.latitude) } - extra["gps_location"] = listOf(Pair(this.longitude, this.latitude)) - } - } val id = "${this.longitude}_${this.latitude}" - l1.exploreWay = ArrayList().also { l2 -> - l2.add(V2XMarkerExploreWay().also { l3 -> + l1.exploreWay = ArrayList().also { l2 -> + l2.add(MarkerExploreWay().also { l3 -> l3.poiType = poiType - l3.generateTime = 0L - l3.location = V2XMarkerLocation().also { l4 -> + l3.setGenerateTime(0L) + l3.location = MarkerLocation().also { l4 -> val p = CoordinateTransform.WGS84ToGCJ02(this.longitude, this.latitude) l4.lon = p[0] l4.lat = p[1] l4.angle = this.heading } l3.infoId = id + + l3.gpsLocation = Pair(this.longitude, this.latitude) + l3.polygon = this.polygonList?.takeIf { it.isNotEmpty() }?.map { Pair(it.longitude, it.latitude) } }) } AiRoadMarker.aiMakers[id]?.receive() @@ -152,14 +79,14 @@ fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult fun V2XMarkerCardResult.toV2XRoadEventEntity(): V2XRoadEventEntity = V2XRoadEventEntity().also { l1 -> - val exploreWayList: List? = this.exploreWay + val exploreWayList: List? = this.exploreWay if (!exploreWayList.isNullOrEmpty() && exploreWayList.isNotEmpty()) { for (markerExploreWay in exploreWayList) { if (isRoadEvent(markerExploreWay.poiType)) { val markerLocation = markerExploreWay.location - l1.location = markerLocation.toMarkerLocation() + l1.location = markerLocation l1.poiType = markerExploreWay.poiType - l1.noveltyInfo = markerExploreWay.toMarkExploreWay(this.extras) + l1.noveltyInfo = markerExploreWay l1.expireTime = 20000 } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt index db6a6b5754..a486687d10 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/internal/data/V2XMarkerCardResult.kt @@ -1,6 +1,8 @@ package com.mogo.eagle.core.function.v2x.internal.data import androidx.annotation.Keep +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay +import com.mogo.eagle.core.data.map.entity.MarkerLocation import java.io.Serializable @Keep @@ -41,20 +43,15 @@ class V2XMarkerCardResult: V2XBaseData(), Serializable { /** * 探路数据集合 */ - var exploreWay: List? = null + var exploreWay: List? = null /** * 服务端下发消息时间 */ var messageTime: Long = 0 - /** - * 额外信息 - */ - var extras: Map? = null - override fun toString(): String { - return "MarkerCardResult(dataType=$dataType, carChat=$carChat, shareMusic=$shareMusic, noveltyInfo=$noveltyInfo, onlineCar=$onlineCar, exploreWay=$exploreWay, messageTime=$messageTime, extras=$extras)" + return "MarkerCardResult(dataType=$dataType, carChat=$carChat, shareMusic=$shareMusic, noveltyInfo=$noveltyInfo, onlineCar=$onlineCar, exploreWay=$exploreWay, messageTime=$messageTime)" } } @@ -369,7 +366,7 @@ class V2XMarkerExploreWay: Serializable { /** * 位置信息 */ - var location: V2XMarkerLocation? = null + var location: MarkerLocation? = null /** * 车辆方位 diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java index 8516d97fcf..12287a8b76 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/map/entity/MarkerExploreWay.java @@ -4,6 +4,8 @@ package com.mogo.eagle.core.data.map.entity; import android.text.TextUtils; +import androidx.core.util.Pair; + import java.io.Serializable; import java.util.List; import java.util.Map; @@ -35,7 +37,10 @@ public class MarkerExploreWay implements Serializable { // 1 需要用户判断是否拥堵 进行UGC问答 private int infoCheckNode; - public Map extras = null; + + private Pair gpsLocation; + + private List> polygon; public String getAddr() { if (TextUtils.isEmpty(addr)) { @@ -170,6 +175,22 @@ public class MarkerExploreWay implements Serializable { this.uploadType = uploadType; } + public Pair getGpsLocation() { + return gpsLocation; + } + + public void setGpsLocation(Pair gpsLocation) { + this.gpsLocation = gpsLocation; + } + + public List> getPolygon() { + return polygon; + } + + public void setPolygon(List> polygon) { + this.polygon = polygon; + } + @Override public boolean equals(Object o) { if (this == o) return true;