add new func of obu track data color
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
@@ -12,7 +14,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.telematics.pad.MessagePad.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
@@ -140,6 +142,7 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
*
|
||||
* @return 过滤后的数据集合
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
private fun filterTrafficData(trafficData: List<TrackedObject>): HashMap<String, TrackedObject> {
|
||||
mFilterTrafficData.clear()
|
||||
trafficDataUuidList.clear()
|
||||
@@ -153,6 +156,8 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
//首次过来的数据不添加,首次未添加的感知物在调用完绘制方法后再塞入cache map
|
||||
val cacheData = mMarkersCaches[uuid]
|
||||
if (cacheData != null) {
|
||||
|
||||
//预警颜色变化
|
||||
if (colorTrafficData.containsKey(uuid)) {
|
||||
val planningTrack = colorTrafficData[uuid]
|
||||
if (!timeOut(planningTrack!!.time)) {
|
||||
@@ -161,6 +166,24 @@ class IdentifyOriginDataDrawer : Identify, IMoGoAutopilotStatusListener {
|
||||
colorTrafficData.remove(uuid)
|
||||
}
|
||||
}
|
||||
|
||||
//OBU数据颜色标记
|
||||
val first = data.trackedSourceList.stream()
|
||||
.filter { trackedSource: TrackedSource -> trackedSource.source == 4 }
|
||||
.findFirst()
|
||||
if (first.isPresent) {
|
||||
val subFirst = first.get().subSourceList.stream()
|
||||
.filter { subSource: SubSource -> subSource.source == 1 }
|
||||
.findFirst()
|
||||
if (subFirst.isPresent) {
|
||||
val subID = subFirst.get().id
|
||||
if (!TextUtils.isEmpty(subID)) {
|
||||
Log.d("emarrow", "存在subsource为obu的数据")
|
||||
temp = data.toBuilder().setColor("FF1493").build()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mFilterTrafficData[uuid] = temp
|
||||
}
|
||||
mMarkersCaches[uuid] = temp
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.map.identify;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -20,6 +21,7 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -122,6 +124,19 @@ public class TrackManager {
|
||||
}
|
||||
}
|
||||
|
||||
Optional<MessagePad.TrackedSource> first = data.getTrackedSourceList().stream()
|
||||
.filter(trackedSource -> trackedSource.getSource() == 4).findFirst();
|
||||
if (first.isPresent()) {
|
||||
Optional<MessagePad.SubSource> subFirst = first.get().getSubSourceList().stream().filter(subSource -> subSource.getSource() == 1).findFirst();
|
||||
if (subFirst.isPresent()) {
|
||||
String subID = subFirst.get().getId();
|
||||
if (!TextUtils.isEmpty(subID)) {
|
||||
Log.d("emarrow","存在subsource为obu的数据");
|
||||
data = data.toBuilder().setColor("FF1493").build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trackObj != null) {
|
||||
trackObj.updateObj(data);
|
||||
} else {
|
||||
@@ -152,7 +167,7 @@ public class TrackManager {
|
||||
trackObj = new TrackObj(data);
|
||||
}
|
||||
}
|
||||
Log.d("0823-arrow","uuid : " + uuid);
|
||||
Log.d("0823-arrow", "uuid : " + uuid);
|
||||
mFilterTrafficData.put(uuid, trackObj.getCache());
|
||||
cellIdCaches.forcePut(uuid, trackObj.getCellIdPos());
|
||||
mMarkersCaches.put(uuid, trackObj);
|
||||
|
||||
@@ -83,7 +83,7 @@ message Trajectory
|
||||
// message definition for MsgTypeTrackedObjects
|
||||
message SubSource
|
||||
{
|
||||
uint32 source = 1; //[default = 0] v2v_bsm = 1 v2i_rsm = 2 v2v_ssm = 3 v2n_rsm = 4
|
||||
uint32 source = 1; //[default = 0] v2v_bsm = 1(v2x他车自车信息) v2i_rsm = 2(v2x路侧感知交通参与者信息) v2v_ssm = 3(v2x他车感知信息) v2n_cloud = 4(v2x云端感知信息)
|
||||
string id = 2; //HEX_string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user