no message

This commit is contained in:
liujing
2021-04-13 14:40:55 +08:00
parent d4abe8c2d2
commit 63a9f79360

View File

@@ -116,20 +116,19 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
*/
private void drawStopLine(V2XWarningEntity info, MogoLatLng mogoLatLng) {
IMogoPolyline polyLine = V2XServiceManager.getMoGoStopPolylineManager().getMogoStopPolyline();
MogoLatLng startLatlng = new MogoLatLng(carLocation.lat, carLocation.lon);
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
Log.d(V2XConst.LOG_NAME_WARN, " drawStopLine endLatlng lon =" + endLatlng.lon + "--lat =" + endLatlng.lat
+ "--startLatlng lon = " + startLatlng.lon + "-lat = " + startLatlng.lat);
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
if (info != null) {
if (polyLine != null) {
Log.d(V2XConst.LOG_NAME_WARN, "drawStopLine polyLine != null");
polyLine.setPoints(Arrays.asList(new MogoLatLng(carLocation.lat, carLocation.lon),
new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon)));
polyLine.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
polyLine.setTransparency(0.5f);
} else {
DrawLineInfo lineInfo = new DrawLineInfo();
MogoLatLng startLatlng = new MogoLatLng(carLocation.lat, carLocation.lon);
MogoLatLng endLatlng = new MogoLatLng(mogoLatLng.lat, mogoLatLng.lon);
Log.d(V2XConst.LOG_NAME_WARN, " drawStopLine endLatlng lon =" + endLatlng.lon + "--lat =" + endLatlng.lat
+ "--startLatlng lon = " + startLatlng.lon + "-lat = " + startLatlng.lat);
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
List locations = new ArrayList();
locations.add(startLatlng);
locations.add(addMiddleLoc);
@@ -152,19 +151,18 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
*/
private void drawOtherObjectLine(V2XWarningEntity info) {
IMogoPolyline polyLine = V2XServiceManager.getMoGoPersonWarnPolylineManager().getMogoPersonWarnPolyline();
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
if (info != null) {
if (polyLine != null) {
Log.d(V2XConst.LOG_NAME_WARN, "polyLine != null");
polyLine.setPoints(Arrays.asList(new MogoLatLng(info.getLat(), info.getLon()),
new MogoLatLng(info.getCollisionLat(), info.getCollisionLon())));
polyLine.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
polyLine.setTransparency(0.5f);
} else {
DrawLineInfo lineInfo = new DrawLineInfo();
MogoLatLng startLatlng = new MogoLatLng(info.getLat(), info.getLon());
MogoLatLng endLatlng = new MogoLatLng(info.getCollisionLat(), info.getCollisionLon());
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(TAG,"目标物与预碰撞点画线点为"+"起点:"+startLatlng+"中间点:"+addMiddleLoc+"终点:"+endLatlng);
Log.d(TAG, "目标物与预碰撞点画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
List locations = new ArrayList();
locations.add(startLatlng);
locations.add(addMiddleLoc);
@@ -209,24 +207,25 @@ public class MoGoV2XCloundDataManager implements IMoGoV2XCloundDataManager, IMog
if (!isSelfLineClear) {
IMogoPolyline mogoPolyline = V2XServiceManager.getMoGoWarnPolylineManager().getMogoWarnPolyline();
if (mCloundWarningInfo != null) {
MogoLatLng startLatlng = null;
MogoLatLng endLatlng = null;
MogoLatLng addMiddleLoc = null;
if (!isFirstLocation) {
startLatlng = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
carLocation = getMogoLat(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()));
endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? carLocation.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == 1 ? carLocation.lon : mCloundWarningInfo.getCollisionLon());
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(V2XConst.LOG_NAME_WARN, "drawSlefCarLine lon = " + carLocation.lon + "---lat = " + carLocation.lat);
isFirstLocation = true;
}
if (mogoPolyline != null) {
mogoPolyline.setPoints(Arrays.asList(new MogoLatLng(latLng.getLatitude(), latLng.getLongitude()),
new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? carLocation.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == 1 ? carLocation.lon : mCloundWarningInfo.getCollisionLon())));
mogoPolyline.setPoints(Arrays.asList(startLatlng, addMiddleLoc, endLatlng));
mogoPolyline.setTransparency(0.5f);
} else {
DrawLineInfo info = new DrawLineInfo(); // 对象
MogoLatLng startLatlng = new MogoLatLng(latLng.getLatitude(), latLng.getLongitude());
MogoLatLng endLatlng = new MogoLatLng(mCloundWarningInfo.getDirection() == 1 ? carLocation.lat : mCloundWarningInfo.getCollisionLat(),
mCloundWarningInfo.getDirection() == 1 ? carLocation.lon : mCloundWarningInfo.getCollisionLon());
float distance = CoordinateUtils.calculateLineDistance(startLatlng.lon, startLatlng.lat, endLatlng.lon, endLatlng.lat);
MogoLatLng addMiddleLoc = LocationUtils.getNewLocation(startLatlng, distance / 2, mCloundWarningInfo.getAngle());
Log.d(TAG,"安全区域的画线点为"+"起点:"+startLatlng+"中间点:"+addMiddleLoc+"终点:"+endLatlng);
Log.d(TAG, "安全区域的画线点为" + "起点:" + startLatlng + "中间点:" + addMiddleLoc + "终点:" + endLatlng);
List locations = new ArrayList();
locations.add(startLatlng);
locations.add(addMiddleLoc);