From aa82c43c114656ed89b6cd3ecb91e4ae97259a5a Mon Sep 17 00:00:00 2001 From: aibingbing Date: Thu, 4 Jul 2024 13:41:43 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0]fix:=20=E9=9B=86=E5=90=88=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8=EF=BC=9B=20feat:?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=20=E4=BB=96=E8=BD=A6=E5=80=92=E8=BD=A6/?= =?UTF-8?q?=E9=80=86=E8=A1=8C=20mock=20=E6=95=B0=E6=8D=AE=EF=BC=9B=20refac?= =?UTF-8?q?tor:=20=E9=80=9A=E8=BF=87=E5=85=AC=E4=BA=A4=E7=AB=99/=E4=BB=96?= =?UTF-8?q?=E8=BD=A6=E5=80=92=E8=BD=A6=E9=80=86=E8=A1=8C=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=B1=95=E7=A4=BA=E6=96=87=E6=9C=AC=EF=BC=88=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E7=A9=BA=E9=97=B4=E6=9C=89=E9=99=90=EF=BC=89=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../busstation/PassBusStationEventManager.kt | 28 ++++++++++++++++++- .../biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 21 ++++++-------- .../eagle/core/data/enums/EventTypeEnumNew.kt | 6 ++-- 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt index 3a658b1456..1085da5f79 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt @@ -8,6 +8,7 @@ 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 import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager +import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.hmi.CallerRoadV2NEventWindowListenerManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils @@ -25,6 +26,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.cancel import kotlinx.coroutines.launch +import mogo.telematics.pad.MessagePad import java.util.LinkedList import java.util.UUID import java.util.concurrent.atomic.AtomicBoolean @@ -117,6 +119,11 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { TAG, "removeNeedNotifiedBusStation --> ${it.toString()}" ) + if (HmiBuildConfig.isShowBusStationStrategyBorderPoint) { + mockOtherRetroGradeVehicleData(it.getBusStationPoint().longitude, + it.getBusStationPoint().latitude, + currentLocation.heading) + } } } } @@ -202,7 +209,6 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { if (!isCalculateNearByStation.get()) { isCalculateNearByStation.set(true) calculateNearByStation(gnssInfo, 15, 10) - isCalculateNearByStation.set(false) } } @@ -256,6 +262,7 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { busStationNearByQueue.add(busStationList) } } + isCalculateNearByStation.set(false) } } @@ -294,4 +301,23 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { overlayManager?.removeAllPointsInOwner("TYPE_MARKER_BUS_STATION") } + private fun mockOtherRetroGradeVehicleData(lon: Double, lat: Double, heading: Double) { + val newPoint = DrivingDirectionUtils.calculateNewPoint( + lon, + lat, + heading, + 120.0 + ) + val event = MessagePad.Event.newBuilder().setEventId("123456") + .setEventType(MessagePad.EventType.CONVERSE_RUNNING) + .setExts("{\"cameraIp\":\"172.18.7.40\"}") + .setGnssType(2) + .addTargetIds("${UUID.randomUUID().toString()}") + .setLongitude(newPoint.first) + .setLatitude(newPoint.second) + .setTimestamp(System.currentTimeMillis()) + .build() + CallerV2nNioEventListenerManager.invokeV2nNioOtherRetrogradeEvent(event) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 2109243055..783d64fce6 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -325,18 +325,15 @@ internal object V2NIdentifyDrawer: IEventDismissListener { return@Callback true } val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) - val newEventId = "other_retrograde_vehicle_${event.eventId}_${event.timestamp}_${event.longitude}_${event.latitude}" - val cameraIp = if(TextUtils.isEmpty(event.exts)) - "" - else - (GsonUtils.fromJson(event.exts, Map::class.java)["cameraIp"])?:"" + val cameraIp = if(TextUtils.isEmpty(event.exts)) "" + else (GsonUtils.fromJson(event.exts, Map::class.java)["cameraIp"])?:"" // 弹事件框 CallerRoadV2NEventWindowListenerManager.showLiveVideo( newEventId, event.timestamp, EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), - String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance), + String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt()), isDriver, cameraIp.toString(), event.longitude, @@ -350,12 +347,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener { event.longitude, event.latitude, 150, - 10, + 20, -1, event.targetIdsList.joinToString(separator = ",") ) ) - } if (msg.what == MSG_WHAT_DRAW_GREEN_WAVE) { @@ -562,10 +558,11 @@ internal object V2NIdentifyDrawer: IEventDismissListener { private fun drawOtherRetrogradeVehicle(event: MessagePad.Event) { Logger.i("V2NIdentifyDrawer", "---drawOtherRetrogradeVehicle --- :${event.toString()}, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]") - if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { - handler.removeMessages(MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE) - handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE, event)) - } +// if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) { +// +// } + handler.removeMessages(MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE) + handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_OTHER_RETROGRADE_VEHICLE, event)) } private fun drawGreenWave(crossSpeed: V2nCrossSpeed) { diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index ecd8c64586..e4536b5430 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -462,7 +462,7 @@ enum class EventTypeEnumNew( 245.toString(), "通过公交站", poiTypeSrcVr = R.drawable.icon_v2x_bus_station_driver, - content = "前方%s米有公交站,蘑菇提醒您小心右侧行人及来车", + content = "前方%s米有公交站", tts = "前方%s米有公交站,蘑菇提醒您小心右侧行人及来车" ), TYPE_ATTENTION_CONFLUENCE( @@ -516,8 +516,8 @@ enum class EventTypeEnumNew( "100062", "他车倒车/逆行", poiTypeSrcVr = R.drawable.icon_v2x_other_retrograde_vehicle_driver, - content = "前方%s米有车辆异常倒车/逆行,蘑菇提醒您注意观察小心通过", - tts = "前方%s米有车辆异常倒车/逆行,蘑菇提醒您注意观察小心通过" + content = "前方%s米有车辆异常倒车或逆行", + tts = "前方%s米有车辆异常倒车或逆行,蘑菇提醒您注意观察小心通过" ), TYPE_SOCKET_ROAD_GREE_WAVE( "100063",