去掉老obu的功能,合并EventTypeEnumNew

This commit is contained in:
lixiaopeng
2023-01-30 17:49:17 +08:00
parent 73ce6b667c
commit fa04ed406e
28 changed files with 156 additions and 1311 deletions

View File

@@ -1,15 +1,17 @@
package com.mogo.eagle.core.function.v2x.events.alarm;
import android.util.Log;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerLocation;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import io.netty.util.internal.ConcurrentSet;
import android.util.Log;
/**
* @author donghongyu
@@ -64,7 +66,7 @@ public class V2XAlarmServer {
double distance = v2XRoadEventEntity.getDistance();
Log.d("RWJ", "distance:" + distance);
if (distance <= 500) {
if (EventTypeEnum.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (EventTypeEnumNew.GHOST_PROBE.getPoiType().equals(v2XRoadEventEntity.getPoiType())) {
if (distance > 25) {
continue;
}

View File

@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.module.status.MogoStatusManager;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.data.map.entity.MarkerExploreWay;
@@ -26,16 +27,15 @@ import com.mogo.eagle.core.function.v2x.events.manager.V2XStatusManager;
import com.mogo.eagle.core.function.v2x.events.marker.V2XMarkerAdapter;
import com.mogo.eagle.core.function.v2x.events.utils.EntityUtilsKt;
import com.mogo.eagle.core.function.v2x.events.utils.MapUtils;
import com.mogo.eagle.core.function.v2x.internal.V2XManager;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.marker.IMogoMarker;
import com.mogo.map.marker.IMogoMarkerClickListener;
import com.mogo.map.marker.IMogoMarkerManager;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.function.v2x.internal.V2XManager;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerCardResult;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerExploreWay;
import com.mogo.eagle.core.function.v2x.internal.data.V2XMarkerLocation;
import java.util.List;
import java.util.Objects;
@@ -110,7 +110,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager {
List<V2XMarkerExploreWay> exploreWayList = markerCardResult.getExploreWay();
if (exploreWayList != null) {
for (V2XMarkerExploreWay markerExploreWay : exploreWayList) {
if (EventTypeEnum.isRoadEvent(markerExploreWay.getPoiType())) {
if (EventTypeEnumNew.isRoadEvent(markerExploreWay.getPoiType())) {
V2XMarkerLocation markerLocation = markerExploreWay.getLocation();
// 记录道路事件
V2XRoadEventEntity v2XRoadEventEntity = new V2XRoadEventEntity();

View File

@@ -3,9 +3,9 @@ package com.mogo.eagle.core.function.v2x.events.marker;
import android.content.Context;
import android.graphics.Bitmap;
import com.mogo.eagle.core.data.enums.EventTypeEnumNew;
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity;
import com.mogo.eagle.core.function.v2x.R;
import com.mogo.eagle.core.data.enums.EventTypeEnum;
import com.mogo.eagle.core.function.v2x.events.view.V2XMarkerRoadEventView;
import java.util.ArrayList;
@@ -31,10 +31,10 @@ public class V2XMarkerAdapter {
*/
public static Bitmap getV2XRoadEventViewPng(Context context, V2XRoadEventEntity alarmInfo) {
Bitmap bitmap;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmap = getV2XRoadEventMarkerView(
context,
alarmInfo,
@@ -53,10 +53,10 @@ public class V2XMarkerAdapter {
*/
public static ArrayList<Bitmap> getV2XRoadEventViewGif(Context context, V2XRoadEventEntity alarmInfo) {
ArrayList<Bitmap> bitmapArrayList;
if (EventTypeEnum.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
if (EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_SUGGEST.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_TRAFFIC_LIGHT_WARNING.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.FOURS_BLOCK_UP.getPoiType().equals(alarmInfo.getPoiType())
|| EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.getPoiType().equals(alarmInfo.getPoiType())) {
bitmapArrayList = getV2XRoadEventOrangeMarkerView(context, alarmInfo);
} else {
bitmapArrayList = getV2XRoadEventRedMarkerView(context, alarmInfo);

View File

@@ -5,10 +5,10 @@ import android.content.Context
import android.graphics.Bitmap
import android.view.LayoutInflater
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
import com.mogo.eagle.core.function.v2x.R
import com.mogo.eagle.core.utilcode.util.ViewUtils
import com.mogo.eagle.core.data.enums.EventTypeEnum
import kotlinx.android.synthetic.main.view_marker_event_car.view.*
/**
@@ -33,8 +33,8 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
fun initView(context: Context, alarmInfo: V2XRoadEventEntity) {
if (alarmInfo.poiType == EventTypeEnum.ALERT_FRONT_CAR.poiType ||
alarmInfo.poiType == EventTypeEnum.ALERT_CAR_TROUBLE_WARNING.poiType
if (alarmInfo.poiType == EventTypeEnumNew.ALERT_FRONT_CAR.poiType ||
alarmInfo.poiType == EventTypeEnumNew.ALERT_CAR_TROUBLE_WARNING.poiType
) {
LayoutInflater.from(context)
.inflate(R.layout.view_marker_event_car, this)
@@ -46,11 +46,11 @@ class V2XMarkerRoadEventView(context: Context, alarmInfo: V2XRoadEventEntity) :
}
/**
* @see EventTypeEnum
* @see EventTypeEnumNew
*/
private fun updateIcon(alarmInfo: V2XRoadEventEntity) {
// 道路施工、积水、路面结冰、浓雾、事故、拥堵
val iconResId = EventTypeEnum.getUpdateIconRes(alarmInfo.poiType)
val iconResId = EventTypeEnumNew.getUpdateIconRes(alarmInfo.poiType)
if (iconResId != 0) {
ivCar.setImageResource(iconResId)
}