diff --git a/gradle.properties b/gradle.properties index 56816ef0a3..3dd63025f6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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' diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java index 71ef7df9c9..b47e91b9db 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/AdasRecognizedResultDrawer.java @@ -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 allDatumsList = new ArrayList<>(); + prepareData(resultList, allDatumsList); + Map newAdasRecognizedMarkersCaches = new ConcurrentHashMap<>(); List 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 in, List out) { + foreCastPoint(in); + out.addAll(in); + } + + /** + * 预测补点 + * + * @param data 道路数据集合 + */ + private void foreCastPoint(List data) { +// if (data == null || data.isEmpty()) { +// return; +// } +// List newList = new ArrayList<>(); +// for (ADASRecognizedResult adasRecognizedResult : data) { +// //todo 补点 +// newList.add(adasRecognizedResult); +// } +// data.clear(); +// data.addAll(newList); + } + /** * todo 后面涉及到此类变化的数据均改动 * diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java index 5aba41dad6..b829256bbd 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/SnapshotSetDataDrawer.java @@ -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 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 in, List out) { - filterData(in); +// in.stream(). +// filterData(in); +// foreCastPoint(in); out.addAll(in); } diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java index 473d3e3344..c59c133bbd 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerManager.java @@ -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); }