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",