wait to finish
This commit is contained in:
@@ -111,36 +111,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
removeUselessMarker(mMarkersCaches);
|
||||
removeUselessLastRecord();
|
||||
|
||||
// 能复用的 marker 数量
|
||||
// int cachedMarkerSize = mMarkersCaches.size();
|
||||
// 需要新增的 marker 数量
|
||||
int newDiffSetSize = newDiffSet.size();
|
||||
Log.d(TAG, "原数据量 : " + resultList.size() + " 新增marker数量 : " + newDiffSetSize);
|
||||
// 能复用的数量
|
||||
// int size = Math.min(cachedMarkerSize, newDiffSetSize);
|
||||
|
||||
// 复用过期 marker
|
||||
if (newDiffSetSize > 0) {
|
||||
// Iterator<Map.Entry<String, IMogoMarker>> entryIterator = mMarkersCaches.entrySet().iterator();
|
||||
// for (int i = 0; i < size; i++) {
|
||||
// ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
|
||||
// String uniqueKey = recognizedListResult.uuid;
|
||||
// Map.Entry<String, IMogoMarker> entry = entryIterator.next();
|
||||
// entryIterator.remove();
|
||||
// ADASRecognizedResult old = mLastPositions.remove(entry.getKey());
|
||||
// IMogoMarker marker = entry.getValue();
|
||||
// if (marker == null) {
|
||||
// continue;
|
||||
// }
|
||||
// // 复用,更新marker 3D资源
|
||||
// if (old == null || old.type != recognizedListResult.type) {
|
||||
// updateCacheMarkerRes(marker, recognizedListResult);
|
||||
// }
|
||||
// Log.d(TAG,"复用marker id : " + uniqueKey);
|
||||
// renderAdasOneFrame(false, marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
// }
|
||||
// 复用过后还需新增的 marker
|
||||
// for (int i = size; i < newDiffSetSize; i++) {
|
||||
for (int i = 0; i < newDiffSetSize; i++) {
|
||||
ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
@@ -152,10 +126,6 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
renderAdasOneFrame(false, marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
}
|
||||
}
|
||||
// if (cachedMarkerSize - size > 0) {
|
||||
// sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
// }
|
||||
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches.clear();
|
||||
mMarkersCaches = newAdasRecognizedMarkersCaches;
|
||||
@@ -279,6 +249,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
final long start = System.currentTimeMillis();
|
||||
Log.d(TAG, "renderAdasOneFrame uuid : " + uniqueKey + " type : " + recognizedListResult.type);
|
||||
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey);
|
||||
// 道路吸附
|
||||
// double lastLon = -1;
|
||||
// double lastLat = -1;
|
||||
// if (lastPosition != null) {
|
||||
@@ -294,8 +265,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
mLastPositions.put(uniqueKey, recognizedListResult);
|
||||
if (useCache) {
|
||||
Log.d(TAG, "使用缓存 id : " + uniqueKey);
|
||||
long interval = computeAnimDuration(lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime);
|
||||
|
||||
long interval = 45;
|
||||
if(lastPosition != null){
|
||||
interval = computeAnimDuration(lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime);
|
||||
}
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon);
|
||||
long cost = System.currentTimeMillis() - start;
|
||||
final long intervalRef = interval - cost;
|
||||
|
||||
@@ -199,9 +199,9 @@ class BaseDrawer {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据速度、经纬度计算距离判断车辆颜色
|
||||
* 根据数据源判断车辆预警颜色
|
||||
*
|
||||
* @param speed 车速 TODO 这里很可能是adas的策略
|
||||
* @param speed 车速
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @return 实际车辆颜色
|
||||
|
||||
Reference in New Issue
Block a user