From dfaabd36a2b7a71737672ec12f1defa766cebb74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 23 Nov 2020 17:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=88=E5=AF=B9M1=E5=85=B3=E9=97=AD=E4=BA=86?= =?UTF-8?q?=E7=96=B2=E5=8A=B3=E9=A9=BE=E9=A9=B6=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/listener/V2XLocationListener.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java index c70ac2c702..584671293c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/listener/V2XLocationListener.java @@ -126,22 +126,25 @@ public class V2XLocationListener implements IMogoLocationListener, CarStatusList } } - // 只有自研车机才有疲劳驾驶检测 - if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) { - V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> { - Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity)); + // M1 不基于地图的版本没有疲劳检测,原因是车机内置地图版本不一样 + if (DebugConfig.isMapBased()) { + // 只有自研车机才有疲劳驾驶检测 + if (DebugConfig.getCarMachineType() == DebugConfig.CAR_MACHINE_TYPE_SELF_INNOVATE) { + V2XAlarmServer.getFatigueDrivingShow(location, drivingShowEntity -> { + Logger.i(V2XConst.MODULE_NAME, "疲劳驾驶POI查询结果为: " + GsonUtil.jsonFromObject(drivingShowEntity)); - String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2"; - trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style); + String style = V2XServiceManager.getMoGoStatusManager().isMainPageOnResume() ? "1" : "2"; + trackWithType(V2XPoiTypeEnum.ALERT_FATIGUE_DRIVING, drivingShowEntity.getLon(), drivingShowEntity.getLat(), style); - V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>(); - v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING); - v2XMessageEntity.setContent(drivingShowEntity); - v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow()); - // 广播给ADAS Launcher - ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity); - V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity); - }); + V2XMessageEntity v2XMessageEntity = new V2XMessageEntity<>(); + v2XMessageEntity.setType(V2XMessageEntity.V2XTypeEnum.ALERT_FATIGUE_DRIVING); + v2XMessageEntity.setContent(drivingShowEntity); + v2XMessageEntity.setShowState(drivingShowEntity.isShowWindow()); + // 广播给ADAS Launcher + ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), drivingShowEntity); + V2XScenarioManager.getInstance().handlerMessage(v2XMessageEntity); + }); + } } // 巡航处理