wait to rebuild code
This commit is contained in:
@@ -157,19 +157,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.1.4
|
||||
MOGO_NETWORK_VERSION=1.1.8
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.1.4
|
||||
MOGO_PASSPORT_VERSION=1.1.8
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.1.4
|
||||
MOGO_SOCKET_VERSION=1.1.8
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.1.4
|
||||
MOGO_REALTIME_VERSION=1.1.8
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.1.4
|
||||
MOGO_TANLU_VERSION=1.1.8
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.1.4
|
||||
MOGO_LIVE_VERSION=1.1.8
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.4
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.8
|
||||
#ADAS HIGHT
|
||||
MOGO_ADASHIGH_VERSION = '1.1.3'
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.cloud.socket.entity.SocketDownDataHelper;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -79,6 +80,9 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return;
|
||||
}
|
||||
|
||||
List<ADASRecognizedResult> allDatumsList = new ArrayList<>();
|
||||
prepareData(resultList, allDatumsList);
|
||||
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
List<ADASRecognizedResult> newDiffSet = new ArrayList<>();
|
||||
for (ADASRecognizedResult recognizedListResult : resultList) {
|
||||
@@ -144,9 +148,39 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
if (cachedMarkerSize - size > 0) {
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
}
|
||||
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches = newAdasRecognizedMarkersCaches;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对数据补点 //todo 重构
|
||||
* @param in
|
||||
* @param out
|
||||
*/
|
||||
private void prepareData(List<ADASRecognizedResult> in, List<ADASRecognizedResult> out) {
|
||||
foreCastPoint(in);
|
||||
out.addAll(in);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预测补点
|
||||
*
|
||||
* @param data 道路数据集合
|
||||
*/
|
||||
private void foreCastPoint(List<ADASRecognizedResult> data) {
|
||||
// if (data == null || data.isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
// List<ADASRecognizedResult> newList = new ArrayList<>();
|
||||
// for (ADASRecognizedResult adasRecognizedResult : data) {
|
||||
// //todo 补点
|
||||
// newList.add(adasRecognizedResult);
|
||||
// }
|
||||
// data.clear();
|
||||
// data.addAll(newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 后面涉及到此类变化的数据均改动
|
||||
*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.common.drawer;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -16,6 +17,8 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
@@ -155,13 +158,14 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
String uniqueKey = cloudRoadData.getUuid();
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
updateCacheMarkerRes(marker, cloudRoadData);
|
||||
renderSnapshotOneFrame(marker, uniqueKey, cloudRoadData, newMarkersCaches);
|
||||
} else {
|
||||
newDiffSet.add(cloudRoadData);
|
||||
}
|
||||
}
|
||||
|
||||
removeUselessMarker();
|
||||
removeUselessLastRecord();
|
||||
|
||||
// 能复用的 marker 数量
|
||||
int cachedMarkerSize = mMarkersCaches.size();
|
||||
@@ -186,20 +190,8 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
|
||||
// 更新资源内容
|
||||
if (old == null || old.getType() != cloudRoadData.getType()) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes(cloudRoadData.getType());
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get(resIdVal);
|
||||
if (!TextUtils.isEmpty(resName)) {
|
||||
if (!TextUtils.equals(resName, marker.getMarkerResName())) {
|
||||
marker.use3DResource(resName);
|
||||
}
|
||||
} else {
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
updateCacheMarkerRes(marker, cloudRoadData);
|
||||
}
|
||||
|
||||
renderSnapshotOneFrame(marker, uniqueKey, cloudRoadData, newMarkersCaches);
|
||||
}
|
||||
|
||||
@@ -224,6 +216,46 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* todo 后面涉及到此类变化的数据均改动
|
||||
*
|
||||
* @param marker
|
||||
* @param cloudRoadDataProto
|
||||
*/
|
||||
private void updateCacheMarkerRes(IMogoMarker marker, SocketDownData.CloudRoadDataProto cloudRoadDataProto) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes(cloudRoadDataProto.getType());
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get(resIdVal);
|
||||
if (!TextUtils.isEmpty(resName)) {
|
||||
if (!TextUtils.equals(resName, marker.getMarkerResName())) {
|
||||
marker.use3DResource(resName);
|
||||
}
|
||||
} else {
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
}
|
||||
|
||||
private void removeUselessLastRecord() { // todo 最好重新设计一个数据结构,用于多线程数据过期失效的场景,参见redis数据过期
|
||||
if (mLastPositions == null || mLastPositions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
IMogoADASController adasControllerApi = MogoApisHandler.getInstance().getApis().getAdasControllerApi();
|
||||
if (TextUtils.isEmpty(adasControllerApi.getSatelliteTime()) || adasControllerApi.getSatelliteTime().equals("0")) {
|
||||
return;
|
||||
}
|
||||
Iterator<SocketDownData.CloudRoadDataProto> iterator = mLastPositions.values().iterator();
|
||||
Log.d("EmArrow","removeUselessLastRecord size : " + mLastPositions.size());
|
||||
while (iterator.hasNext()) {
|
||||
SocketDownData.CloudRoadDataProto result = iterator.next();
|
||||
long internal = result.getSatelliteTime() - Long.parseLong(adasControllerApi.getSatelliteTime());
|
||||
if (internal > 1000) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断类型、uuid 等
|
||||
*
|
||||
@@ -290,13 +322,15 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤数据
|
||||
* 过滤数据,对数据补点 //todo 重构
|
||||
*
|
||||
* @param in 输入集合
|
||||
* @param out 输出集合
|
||||
*/
|
||||
private void prepareData(List<SocketDownData.CloudRoadDataProto> in, List<SocketDownData.CloudRoadDataProto> out) {
|
||||
filterData(in);
|
||||
// in.stream().
|
||||
// filterData(in);
|
||||
// foreCastPoint(in);
|
||||
out.addAll(in);
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
switch (msg.what) {
|
||||
case MSG_SNAPSHOT:
|
||||
if (msg.obj instanceof SocketDownData.LauncherSnapshotProto) {
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(((SocketDownData.LauncherSnapshotProto) msg.obj));
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(((SocketDownData.LauncherSnapshotProto) msg.obj));
|
||||
} else {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user