[3.4.0-map-sdk] code safe
This commit is contained in:
@@ -60,11 +60,11 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
|
||||
//清除缓存
|
||||
for (data in resultList) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.uuid)) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains(data.uuid.toString())) {
|
||||
if (TrackerSourceFilterHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
trafficDataUuidList.remove("" + data.uuid)
|
||||
trafficDataUuidList.remove(data.uuid.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
continue
|
||||
}
|
||||
var temp: TrackedObject = data
|
||||
val uuid = "" + data.uuid
|
||||
val uuid = data.uuid.toString()
|
||||
val cacheData = mMarkersCaches[uuid]
|
||||
if (cacheData != null) {
|
||||
val color = TrackerSourceFilterHelper.getDefaultColor(data)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.mogo.eagle.core.function.business.identify;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.util.ArraySet;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||
@@ -71,13 +73,13 @@ public class TrackManager {
|
||||
public HashMap<String, MessagePad.TrackedObject> filterTrafficData(List<MessagePad.TrackedObject> trafficData) {
|
||||
//清空上次返回数据,做到缓存复用
|
||||
mFilterTrafficData.clear();
|
||||
long cost = System.currentTimeMillis();
|
||||
// long cost = System.currentTimeMillis();
|
||||
//进入过滤机制的感知物体,首先从缓存队列中进行查找 uuid
|
||||
for (MessagePad.TrackedObject data : trafficData) {
|
||||
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
|
||||
continue;
|
||||
}
|
||||
String uuid = "" + data.getUuid();
|
||||
String uuid = Integer.toString(data.getUuid());
|
||||
TrackObj trackObj = mMarkersCaches.get(uuid);
|
||||
|
||||
String color = TrackerSourceFilterHelper.INSTANCE.getDefaultColor(data);
|
||||
@@ -93,24 +95,26 @@ public class TrackManager {
|
||||
if (cellIdCaches.containsValue(pos)) {
|
||||
String findSameValue = cellIdCaches.inverse().get(pos);
|
||||
//uuid处理
|
||||
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
|
||||
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
|
||||
if (cacheTrack != null) {
|
||||
trackObj = cacheTrack;
|
||||
MessagePad.TrackedObject cache = cacheTrack.getCache();
|
||||
if (cache != null) {
|
||||
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
|
||||
if (cacheTrack.relativeStatic()) {
|
||||
if (data.getColor() != null && !data.getColor().isEmpty()) {
|
||||
cache = cache.toBuilder().setColor(data.getColor()).build();
|
||||
if(findSameValue != null && !findSameValue.isEmpty()){
|
||||
data = data.toBuilder().setUuid(Integer.parseInt(findSameValue)).build();
|
||||
TrackObj cacheTrack = mMarkersCaches.get(findSameValue);
|
||||
if (cacheTrack != null) {
|
||||
trackObj = cacheTrack;
|
||||
MessagePad.TrackedObject cache = cacheTrack.getCache();
|
||||
if (cache != null) {
|
||||
//相对静止物体 感知融合同位置物体,使用缓存数据做覆盖
|
||||
if (cacheTrack.relativeStatic()) {
|
||||
if (data.getColor() != null && !data.getColor().isEmpty()) {
|
||||
cache = cache.toBuilder().setColor(data.getColor()).build();
|
||||
}
|
||||
data = cache;
|
||||
}
|
||||
data = cache;
|
||||
}
|
||||
uuid = findSameValue;
|
||||
trackObj.updateObj(data);
|
||||
} else {
|
||||
trackObj = new TrackObj(data,s2CellId,s2LatLng);
|
||||
}
|
||||
uuid = findSameValue;
|
||||
trackObj.updateObj(data);
|
||||
} else {
|
||||
trackObj = new TrackObj(data,s2CellId,s2LatLng);
|
||||
}
|
||||
} else {
|
||||
trackObj = new TrackObj(data,s2CellId,s2LatLng);
|
||||
@@ -128,7 +132,7 @@ public class TrackManager {
|
||||
public void clearCache(List<MessagePad.TrackedObject> resultList) {
|
||||
//过滤现有元素
|
||||
for (MessagePad.TrackedObject data : resultList) {
|
||||
String uuid = "" + data.getUuid();
|
||||
String uuid = Integer.toString(data.getUuid());
|
||||
if (trafficDataUuid.size() > 0 && trafficDataUuid.contains(uuid)) {
|
||||
if (TrackerSourceFilterHelper.INSTANCE.filterData(data)) {
|
||||
continue;
|
||||
@@ -154,6 +158,7 @@ public class TrackManager {
|
||||
.removeMarker(key);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public void clearAll() {
|
||||
cellIdCaches.clear();
|
||||
trafficDataUuid.clear();
|
||||
|
||||
@@ -41,7 +41,7 @@ object WarningHelper {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
|
||||
val trackId = "" + planningObj.uuid
|
||||
val trackId = planningObj.uuid.toString()
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
mMarkersCaches[trackId] ?: return@Consumer
|
||||
if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示
|
||||
@@ -72,7 +72,7 @@ object WarningHelper {
|
||||
return
|
||||
}
|
||||
planningObjects.forEach(Consumer { planningObj: PlanningObject ->
|
||||
val trackId = "" + planningObj.uuid
|
||||
val trackId = planningObj.uuid.toString()
|
||||
if (mMarkersCaches.containsKey(trackId)) {
|
||||
mMarkersCaches[trackId] ?: return@Consumer
|
||||
if (planningObj.type == 0) { //0是leading障碍物,障碍物车身红色提示
|
||||
|
||||
Reference in New Issue
Block a user