From 69885374ebae08b654ee8b4cf7ac86517679eb1d Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Tue, 13 Apr 2021 12:21:42 +0800 Subject: [PATCH] opt --- .../v2x/manager/impl/MoGoV2XCloundDataManager.java | 12 +++++------- .../main/res/raw/scenario_warning_event_data.json | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java index 3550dad486..4ebd7bea6a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XCloundDataManager.java @@ -49,7 +49,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog private List fillPoints = new ArrayList();//停止线经纬度合集 private boolean isFirstLocation = false; private MogoLatLng mNewLocation; - private static long showTime = 0; @Override @@ -81,7 +80,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog //绘制识别物与交汇点连线,并且更新连线数据 drawStopLine(cloundWarningInfo, newLocation); //添加停止线marker - handleStopLine(); +// handleStopLine(); }, 800); UiThreadHandler.postDelayed(() -> { @@ -172,7 +171,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog lineInfo.setEndLocation(endLatlng); lineInfo.setHeading(info.heading); Log.d(V2XConst.LOG_NAME_WARN, "drawStopLine width = " + info.getRoadwidth()); - lineInfo.setWidth(info.getRoadwidth()); + lineInfo.setWidth(info.getRoadwidth() * 10 + 5); V2XServiceManager.getMoGoStopPolylineManager().drawStopPolyline(getContext(), lineInfo); } } else { @@ -201,7 +200,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog lineInfo.setEndLocation(endLatlng); lineInfo.setHeading(info.heading); Log.d(V2XConst.LOG_NAME_WARN, "drawOtherObjectLine width = " + info.getRoadwidth()); - lineInfo.setWidth(info.getRoadwidth()); + lineInfo.setWidth(info.getRoadwidth() * 10 + 5); V2XServiceManager.getMoGoPersonWarnPolylineManager().drawPersonWarnPolyline(getContext(), lineInfo); } } else { @@ -249,7 +248,6 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog mCloundWarningInfo.getDirection() == 1 ? mNewLocation.lon : mCloundWarningInfo.getCollisionLon()))); mogoPolyline.setTransparency(0.5f); } else { -// Log.e(V2XConst.LOG_NAME_WARN, "onCarLocationChanged2 mogoPolyline == null width = " + mCloundWarningInfo.getRoadwidth()); DrawLineInfo info = new DrawLineInfo(); // 对象 MogoLatLng startLatlng = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()); MogoLatLng endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? mNewLocation.lat : mCloundWarningInfo.getCollisionLat(), @@ -257,7 +255,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog info.setHeading(latLng.getBearing()); info.setStartLocation(startLatlng); info.setEndLocation(endLatlng); - info.setWidth(mCloundWarningInfo.getRoadwidth()); //TODO 还需要转换比例尺 + info.setWidth(mCloundWarningInfo.getRoadwidth() * 10 + 5); info.setDirection(mCloundWarningInfo.getDirection()); V2XServiceManager.getMoGoWarnPolylineManager().drawWarnPolyline(getContext(), info); } @@ -297,7 +295,7 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog } private MogoLatLng getMogoLat(MogoLatLng latlng) { - MogoLatLng newLocation = LocationUtils.getNewLocation(latlng, mCloundWarningInfo.getDistance(), mCloundWarningInfo.getDirection()); + MogoLatLng newLocation = LocationUtils.getNewLocation(latlng, mCloundWarningInfo.getStopLineDistance(), mCloundWarningInfo.getDirection()); return newLocation; } diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json index c9530e4ff2..dd781a966a 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_warning_event_data.json @@ -20,11 +20,11 @@ "direction": 1, "speed": 11.108121, "targetColor": "#FF4040", - "stopLineDistance": 3000, + "stopLineDistance": 60, "warningContent": "小心行人", "heading": 0, "showTime": 8000, - "roadwidth": 60.0, + "roadwidth": 4.0, "carLocation": { "lat": 39.97665425, "lon": 116.41769983