From 68a77465b86bf226f8822f23458fd87f185a6df6 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Wed, 21 Dec 2022 16:05:44 +0800 Subject: [PATCH] [2.13.2]add func of pnc actions and add test code of road problem --- .../function/hmi/ui/pnc/PncActionsView.kt | 2 +- .../function/main/MainLauncherActivity.java | 2 +- .../function/v2x/events/V2XEventManager.kt | 5 +- .../receiver/TestPanelBroadcastReceiver.java | 154 ------------ .../receiver/TestPanelBroadcastReceiver.kt | 236 ++++++++++++++++++ .../data/autopilot/pnc/PncActionsHelper.kt | 14 +- 6 files changed, 254 insertions(+), 159 deletions(-) delete mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java create mode 100644 core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt index 539658cf16..1c178824d5 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/pnc/PncActionsView.kt @@ -72,7 +72,7 @@ class PncActionsView @JvmOverloads constructor( @BizConfig(FOUNDATION, "", BIZ_PNC_ACTIONS) override fun pncActions(planningActionMsg: MessagePad.PlanningActionMsg) { - mAutoPilotStatusInfo?.let { + mAutoPilotStatusInfo?.let { it -> if (it.state == STATUS_AUTOPILOT_RUNNING) { UiThreadHandler.post { var actions: String? = null diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java index 7b1f3b8992..6db07edddb 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/main/MainLauncherActivity.java @@ -120,7 +120,7 @@ public class MainLauncherActivity extends MainActivity implements IMogoIntentLis protected void onStop() { super.onStop(); IntentManager.getInstance().unregisterIntentListener(Intent.ACTION_CLOSE_SYSTEM_DIALOGS, this); - //ActivityLifecycleManager.getInstance().setAppActive(false); +// ActivityLifecycleManager.getInstance().setAppActive(false); } @Override 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 a181b9daa1..4efe37df18 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 @@ -467,8 +467,8 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb .findFirst() if (first.isPresent) { val poiType = when (first.get().type) { - // 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物 - // } +// 1004 -> { //V2N_RSM,静止事件,包括异常停车、异常静止障碍物 +// } 1005 -> { //V2N_RSI,施工事件,包括锥桶或者挡板围城的施工场景,是个多边形包围区域 EventTypeEnum.AI_ROAD_WORK.poiType } @@ -479,6 +479,7 @@ object V2XEventManager : IMoGoMapLocationListener, IMoGoTokenCallback, IV2XCallb return } } + CallerLogger.d("$M_V2X$TAG", "poiType : $poiType , 触发道路事件") val trackedObj = CallerMapIdentifyManager.getIdentifyObj(first.get().uuid.toString()) trackedObj?.let { t -> diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java deleted file mode 100644 index acb38623e6..0000000000 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.java +++ /dev/null @@ -1,154 +0,0 @@ -package com.mogo.eagle.core.function.v2x.events.receiver; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -import androidx.localbroadcastmanager.content.LocalBroadcastManager; - -import com.mogo.commons.module.status.MogoStatusManager; -import com.mogo.eagle.core.data.map.MogoLatLng; -import com.mogo.eagle.core.data.map.entity.MarkerExploreWay; -import com.mogo.eagle.core.data.map.entity.V2XMessageEntity; -import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity; -import com.mogo.eagle.core.function.call.chat.CallerChatManager; -import com.mogo.eagle.core.function.call.map.CallerSmpManager; -import com.mogo.eagle.core.function.v2x.events.consts.V2XConst; -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XOptimalRouteDataRes; -import com.mogo.eagle.core.function.v2x.events.entity.net.V2XSpecialCarRes; -import com.mogo.eagle.core.function.v2x.events.utils.TestOnLineCarUtils; -import com.mogo.eagle.core.function.v2x.events.utils.V2XSQLiteUtils; -import com.mogo.eagle.core.utilcode.util.Utils; - -import java.util.List; - -/** - * V2X 测试面板广播接收,目的是可以通过广播调用起来面板 - * - * @author donghongyu - */ -public class TestPanelBroadcastReceiver extends BroadcastReceiver { - private static final String TAG = V2XConst.MODULE_NAME + "_TestPanelBroadcastReceiver"; - - private Context mContext; - - @Override - public void onReceive(Context context, Intent intent) { - try { - this.mContext = context; - int sceneType = intent.getIntExtra(V2XConst.BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0); - - // 分发场景 - dispatchSceneTest(sceneType); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - /** - * 分发处理场景 - * - * @param sceneType 场景类型 - */ - private void dispatchSceneTest(int sceneType) { - if (sceneType == 0) {//打开用户信息 - CallerChatManager.INSTANCE.call(Utils.getApp(), "X20202111230C01"); - } else if (sceneType == 1) {// 触发道路事件 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioRoadEventData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - - // 存储本地,出行动态作展示 - saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, - v2XMessageEntity.getContent().getNoveltyInfo()); - } - if (sceneType == 2) {// 触发AI道路施工事件 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioAIRoadEventData(); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - - // 存储本地,出行动态作展示 - saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, - v2XMessageEntity.getContent().getNoveltyInfo()); - } else if (sceneType == 9) {//触发他人发起道路求助事件 - V2XMessageEntity> v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioSeekHelpData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 10) {//触发事件UGC - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioRoadEventUGCData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 11) {//触发违章停车事件 - V2XMessageEntity> v2XMessageEntity = - TestOnLineCarUtils.getV2XIllegalParkData(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 12) {//车路云场景预警-右侧 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 13) {//车路云场景预警-左侧 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 14) {//行人预警,行人路线预测 车路云预警-前方行人 - V2XMessageEntity messageEntity = TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("pedestrians"); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } /*else if (sceneType == 16) {//触发基于目的地预测的线路推荐 - V2XRefreshModel model = BridgeApi.INSTANCE.refreshModel(); - model. - V2XServiceManager.getV2XRefreshModel().queryRoadData("F803EB2046PZD00149"); - } */ else if (sceneType == 17) {//最优路线推荐 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XOptimalRoute(); - - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - } else if (sceneType == 18) {// 自车求助 - V2XMessageEntity v2XMessageEntity = - TestOnLineCarUtils.getV2XScenarioCarForHelpEventData(); - Intent intent = new Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION); - intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity); - LocalBroadcastManager.getInstance(mContext).sendBroadcast(intent); - MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true); - } else if (sceneType == 20) {// 小地图绘制线 - List coordinates = TestOnLineCarUtils.getTestCoordinates(); - CallerSmpManager.drawablePolyline(coordinates); - } else if (sceneType == 21) {// 小地图清除绘制线 - CallerSmpManager.clearPolyline(); - } - } - - - /** - * 存储本地数据 - * - * @param v2XRoadEventEntity 要存储的场景 - */ - public void saveLocalStory(int scenarioType, MarkerExploreWay v2XRoadEventEntity) { - try { - V2XSQLiteUtils.saveLocalStory(scenarioType, v2XRoadEventEntity, v2XRoadEventEntity.hashCode()); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt new file mode 100644 index 0000000000..ae4d340a99 --- /dev/null +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/receiver/TestPanelBroadcastReceiver.kt @@ -0,0 +1,236 @@ +package com.mogo.eagle.core.function.v2x.events.receiver + +import android.content.BroadcastReceiver +import android.content.Context +import android.content.Intent +import android.util.Log +import androidx.localbroadcastmanager.content.LocalBroadcastManager +import com.mogo.commons.module.status.MogoStatusManager +import com.mogo.eagle.core.data.enums.EventTypeEnum +import com.mogo.eagle.core.data.map.entity.MarkerExploreWay +import com.mogo.eagle.core.data.map.entity.V2XMessageEntity +import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity +import com.mogo.eagle.core.function.call.chat.CallerChatManager.call +import com.mogo.eagle.core.function.call.map.CallerSmpManager.clearPolyline +import com.mogo.eagle.core.function.call.map.CallerSmpManager.drawablePolyline +import com.mogo.eagle.core.function.v2x.events.consts.V2XConst +import com.mogo.eagle.core.function.v2x.events.scenario.impl.V2XScenarioManager +import com.mogo.eagle.core.function.v2x.events.utils.* +import com.mogo.eagle.core.utilcode.util.Utils +import mogo.telematics.pad.MessagePad + +/** + * V2X 测试面板广播接收,目的是可以通过广播调用起来面板 + * + * @author donghongyu + */ +class TestPanelBroadcastReceiver : BroadcastReceiver() { + private var mContext: Context? = null + override fun onReceive(context: Context, intent: Intent) { + try { + mContext = context + val sceneType = + intent.getIntExtra(V2XConst.BROADCAST_TEST_PANEL_CONTROL_TYPE_EXTRA_KEY, 0) + + // 分发场景 + dispatchSceneTest(sceneType) + } catch (e: Exception) { + e.printStackTrace() + } + } + + /** + * 分发处理场景 + * + * @param sceneType 场景类型 + */ + private fun dispatchSceneTest(sceneType: Int) { + when (sceneType) { + 0 -> {//打开用户信息 + call(Utils.getApp(), "X20202111230C01") + } + 1 -> { // 触发道路事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioRoadEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + + // 存储本地,出行动态作展示 + saveLocalStory( + V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, + v2XMessageEntity.content.noveltyInfo + ) + } + 2 -> { // 触发AI道路施工事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioAIRoadEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + + // 存储本地,出行动态作展示 + saveLocalStory( + V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING, + v2XMessageEntity.content.noveltyInfo + ) + } + 9 -> { //触发他人发起道路求助事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioSeekHelpData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 10 -> { //触发事件UGC + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioRoadEventUGCData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 11 -> { //触发违章停车事件 + val v2XMessageEntity = TestOnLineCarUtils.getV2XIllegalParkData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 12 -> { //车路云场景预警-右侧 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("right") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 13 -> { //车路云场景预警-左侧 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("left") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 14 -> { //行人预警,行人路线预测 车路云预警-前方行人 + val messageEntity = + TestOnLineCarUtils.getV2XScenarioPushFrontWarningEventData("pedestrians") + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, messageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } /*else if (sceneType == 16) {//触发基于目的地预测的线路推荐 + V2XRefreshModel model = BridgeApi.INSTANCE.refreshModel(); + model. + V2XServiceManager.getV2XRefreshModel().queryRoadData("F803EB2046PZD00149"); + } */ + 17 -> { //最优路线推荐 + val v2XMessageEntity = TestOnLineCarUtils.getV2XOptimalRoute() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + } + 18 -> { // 自车求助 + val v2XMessageEntity = TestOnLineCarUtils.getV2XScenarioCarForHelpEventData() + val intent = Intent(V2XConst.BROADCAST_SCENE_HANDLER_ACTION) + intent.putExtra(V2XConst.BROADCAST_SCENE_EXTRA_KEY, v2XMessageEntity) + LocalBroadcastManager.getInstance(mContext!!).sendBroadcast(intent) + MogoStatusManager.getInstance().setSeekHelping(V2XConst.MODULE_NAME, true) + } + 20 -> { // 小地图绘制线 + val coordinates = TestOnLineCarUtils.getTestCoordinates() + drawablePolyline(coordinates) + } + 21 -> { // 小地图清除绘制线 + clearPolyline() + } + 22 -> { //mock工控发来的预警事件 + mockAngle() + } + 23 -> { //mock工控发来的预警事件 + mockRoad() + } + } + } + + + private fun mockAngle() { + Log.d("emArrow", "触发三角牌") + val trackedObj = MessagePad.TrackedObject.newBuilder().setLatitude(26.819352799999997) + .setLongitude(112.575119).setType(13).setSatelliteTime(1671094475.0523846) + .setSystemTime(1671528008.4332187).setUuid(89295).setHeading(90.0) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819359199999997) + .setLongitude(112.5751322).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.8191217).setLongitude(112.5752108) + .build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819182899999998) + .setLongitude(112.5751816).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819275899999997) + .setLongitude(112.5751375).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.8193457) + .setLongitude(112.57510409999999).build() + ) + .build() + TrackUtils.trackV2xRoadProduceEvent(1) + val v2XMessageEntity = V2XMessageEntity() + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.content = + trackedObj.toRoadMarker(EventTypeEnum.FOURS_ACCIDENT.poiType).toV2XRoadEventEntity() + v2XMessageEntity.isShowState = true + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) + } + + private fun mockRoad() { + Log.d("emArrow", "触发道路事件") + val trackedObj = MessagePad.TrackedObject.newBuilder().setLatitude(26.819352799999997) + .setLongitude(112.575119).setType(502).setSatelliteTime(1671094475.0523846) + .setSystemTime(1671528008.4332187).setUuid(89295).setHeading(90.0) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819359199999997) + .setLongitude(112.5751322).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.8191217).setLongitude(112.5752108) + .build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819182899999998) + .setLongitude(112.5751816).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.819275899999997) + .setLongitude(112.5751375).build() + ) + .addPolygon( + MessagePad.Location.newBuilder().setLatitude(26.8193457) + .setLongitude(112.57510409999999).build() + ) + .build() + TrackUtils.trackV2xRoadProduceEvent(1) + val v2XMessageEntity = V2XMessageEntity() + v2XMessageEntity.type = V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING + v2XMessageEntity.content = + trackedObj.toRoadMarker(EventTypeEnum.AI_ROAD_WORK.poiType).toV2XRoadEventEntity() + v2XMessageEntity.isShowState = true + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity) + } + + /** + * 存储本地数据 + * + * @param v2XRoadEventEntity 要存储的场景 + */ + private fun saveLocalStory(scenarioType: Int, v2XRoadEventEntity: MarkerExploreWay) { + try { + V2XSQLiteUtils.saveLocalStory( + scenarioType, + v2XRoadEventEntity, + v2XRoadEventEntity.hashCode() + ) + } catch (e: Exception) { + e.printStackTrace() + } + } + +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt index 753b04d1ce..d5a2485bf7 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/pnc/PncActionsHelper.kt @@ -13,7 +13,7 @@ class PncActionsHelper { } // 车道保持 driving_action: 1:车道保持状态,2:跟车状态 LANKE_KEEP_VALUE -> { - if(driveAction == 2) "正在跟随车辆行驶" else "" + if (driveAction == 2) "正在跟随车辆行驶" else "" } // 红绿灯通行状态 driving_action:1 表示停止动作;driving_action:2 表示通行动作 TRAFFIC_LIGHT_VALUE -> { @@ -43,6 +43,18 @@ class PncActionsHelper { PULL_OVER_VALUE -> { if (driveAction == 1) "正在进站" else if (driveAction == 2) "正在等待进站" else "" } + // 同 AUTO_LANE_CHANGE_LEFT_VALUE 、AUTO_LANE_CHANGE_RIGHT_VALUE + AUTO_LANE_CHANGE_LEFT_V2N_VALUE, AUTO_LANE_CHANGE_RIGHT_V2N_VALUE -> { + if (driveAction == 2) "正在绕过前方施工" else "" + } + // 同 LANE_AVOID_LEFT_VALUE 、LANE_AVOID_RIGHT_VALUE + LANE_AVOID_LEFT_V2N_VALUE, LANE_AVOID_RIGHT_V2N_VALUE -> { + if (driveAction == 2) "正在避让前方施工" else "" + } + // 正在等待变道避让施工场景 driving_action:1 表示正在等待;driving_action:2 表示等待超时请求平行驾驶; + WAITING_V2N_VALUE -> { + if (driveAction == 1) "正在尝试绕过前方施工" else if (driveAction == 2) "正在请求远程协助" else "" + } else -> "" } }