diff --git a/gradle.properties b/gradle.properties index 7fe3560a5d..059ed2ba16 100644 --- a/gradle.properties +++ b/gradle.properties @@ -181,7 +181,7 @@ MOGO_AICLOUD_SERVICES_APK_VERSION=1.0.0-SNAPSHOT # mogoAiCloud sdk services MOGO_AICLOUD_SERVICES_SDK_VERSION=1.0.0-SNAPSHOT # 自研地图 -MAP_SDK_VERSION=1.0.0-vr-8.5.66 +MAP_SDK_VERSION=1.0.0-vr-8.5.67 ## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级 diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java index 26c4baf2eb..3262caa27f 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/IMogoMarkerManager.java @@ -56,6 +56,12 @@ public interface IMogoMarkerManager { */ void inVisibleAllMarkers(); + /** + * 隐藏除了某些类别的所有marker {@link MogoMarkerOptions Owner} + * @param owner + */ + void inVisibleWithoutMarkers(String owner); //todo 后续需要把Owner类别统一起来,基类下沉,此接口为临时方案,应该设计为隐藏某一类元素 + /** * 获取某种类型的全部marker。 * diff --git a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkersHandler.java b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkersHandler.java index 4eede46dcb..92985315ef 100644 --- a/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkersHandler.java +++ b/libraries/mogo-map-api/src/main/java/com/mogo/map/marker/MogoMarkersHandler.java @@ -61,6 +61,17 @@ public class MogoMarkersHandler implements IMogoMarkerClickListener, IMogoMarker .forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> mogoMarker.setVisible(false))); } + @SuppressLint("NewApi") + public synchronized void inVisibleMarkers(String owner){ + mServicesMarkers.values().stream() + .filter(mogoMarkerList -> mogoMarkerList != null && !mogoMarkerList.isEmpty()) + .forEach(mogoMarkerList -> mogoMarkerList.forEach(mogoMarker -> { + if(TextUtils.isEmpty(mogoMarker.getOwner()) || !mogoMarker.getOwner().equals(owner)){ + mogoMarker.setVisible(false); + } + })); + } + public synchronized void removeAll() { final Collection< List< IMogoMarker > > mogoMarkers = mServicesMarkers.values(); for ( List< IMogoMarker > mogoMarkerList : mogoMarkers ) { diff --git a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java index 96ec236ebf..01c96ff02d 100644 --- a/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java +++ b/libraries/mogo-map/src/main/java/com/mogo/map/MogoMarkerManager.java @@ -84,6 +84,11 @@ public class MogoMarkerManager implements IMogoMarkerManager { MogoMarkersHandler.getInstance().inVisibleAll(); } + @Override + public void inVisibleWithoutMarkers(String owner) { + MogoMarkersHandler.getInstance().inVisibleMarkers(owner); + } + @Override public List< IMogoMarker > getMarkers( String tag ) { return MogoMarkersHandler.getInstance().getMarkers( tag ); 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 6fb73ffa0b..5232c05e8e 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 @@ -217,7 +217,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer { while (iterator.hasNext()) { ADASRecognizedResult result = iterator.next(); long internal = result.satelliteTime - getCurSatelliteTime(); - if (internal > 300) { + if (internal > 3000) { //防止帧率过低导致误删除上一个节点对象,从而出现跳跃现象 iterator.remove(); } } @@ -270,11 +270,13 @@ class AdasRecognizedResultDrawer extends BaseDrawer { // Log.d(TAG, "使用缓存 id : " + uniqueKey); long interval = 45; if (lastPosition != null) { - interval = computeAnimDuration(lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime); + interval = computeAnimDuration(lastPosition.satelliteTime, recognizedListResult.satelliteTime); } final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon); - long cost = System.currentTimeMillis() - start; + long cost = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start); + Log.d("ADAS动画数据","cost : " + cost); final long intervalRef = interval - cost; + Log.d("ADAS动画数据", "最终赋值 : " + intervalRef + " 两帧间隔 : " + interval + " uuid : " + recognizedListResult.uuid); marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef); String carColor = recognizedListResult.color; if (TextUtils.isEmpty(carColor)) { diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java index ad8b10d3d5..a3d84391b8 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/BaseDrawer.java @@ -28,7 +28,6 @@ import java.util.concurrent.ConcurrentHashMap; import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ADAS; import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_MY_LOCATION; -import static com.mogo.cloud.socket.entity.SocketDownDataHelper.FROM_ROAD_UNIT; import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_ADAS; import static com.mogo.module.common.constants.DataTypes.TYPE_MARKER_CLOUD_DATA; import static java.lang.Math.PI; @@ -306,7 +305,6 @@ class BaseDrawer { Dangerous_Visual("#FF91B7F1"), Dangerous_Cloud("#FF260FEC"); - private int fromType; private final String color; Car3DModelColor(String color) { @@ -315,47 +313,6 @@ class BaseDrawer { } - public static final int Waring_Normal = 0; - public static final int Waring_Close = 1; - public static final int Waring_Dangerous = 2; - - /** - * 模型颜色 - */ - public enum Car3DTestModelColor { - - Normal_Type(FROM_MY_LOCATION, Waring_Normal, "#D8D8D8FF"), - Normal_Type_Visual(FROM_ADAS, Waring_Normal, "#D8CFF8BD"), - Normal_Type_Cloud(FROM_ROAD_UNIT, Waring_Normal, "#D8F83F94"), - - Warming_Type(FROM_MY_LOCATION, Waring_Close, "#FFD53EFF"), - Warming_Type_Visual(FROM_ADAS, Waring_Close, "#FFC192F1"), - Warming_Type_Cloud(FROM_ROAD_UNIT, Waring_Close, "#FFEF09AD"), - - Dangerous_Type(FROM_MY_LOCATION, Waring_Dangerous, "#FF3C45FF"), - Dangerous_Type_Visual(FROM_ADAS, Waring_Dangerous, "#FF91B7F1"), - Dangerous_Type_Cloud(FROM_ROAD_UNIT, Waring_Dangerous, "#FF260FEC"); - - private final int fromType; - private final int waringType; - private final String color; - - Car3DTestModelColor(int fromType, int waringType, String color) { - this.fromType = fromType; - this.waringType = waringType; - this.color = color; - } - - public static String getTestModelColor(int fromType, int waringType) { - for (Car3DTestModelColor value : Car3DTestModelColor.values()) { - if (value.fromType == fromType && value.waringType == waringType) { - return value.color; - } - } - return Normal_Type.color; - } - } - /** * 展示车辆速度 * @@ -378,7 +335,8 @@ class BaseDrawer { return; } mogoMarker.setInfoWindowOffset(0, 20); - String text = "speed : " + speedIntVal + "\n" + uuid + "\n" + "type : " + type + "\n" + "heading : " + heading; +// String text = "speed : " + speedIntVal + "\n" + uuid + "\n" + "type : " + type + "\n" + "heading : " + heading; + String text = uuid + " , " + (int) heading; mSpeedView.setText(text); mogoMarker.updateInfoWindowView(mSpeedView); } @@ -455,16 +413,18 @@ class BaseDrawer { /** * 使用系统时间或卫星时间计算出动画的运动时间,最小值45,防止两个点距离过近设置的最小动画执行时间 * - * @param lastSystemTime 上一个点系统时间,误差值 - * @param curSystemTime 当前点系统时间,误差值 * @param lastSatelliteTime 上一个点SNTP时间,精确值 * @param curSatelliteTime 当前点SNTP时间,精确值 * @return 动画运动时间 */ - public long computeAnimDuration(long lastSystemTime, long curSystemTime, long lastSatelliteTime, long curSatelliteTime) { - long systemTimeInterval = curSystemTime - lastSystemTime; - long satelliteTimeInterval = curSatelliteTime - lastSatelliteTime; - long interval = systemTimeInterval < satelliteTimeInterval || satelliteTimeInterval == 0 ? systemTimeInterval : satelliteTimeInterval; + public long computeAnimDuration(long lastSatelliteTime, long curSatelliteTime) { + if (lastSatelliteTime == 0 || curSatelliteTime == 0) { + Log.d("ADAS动画数据", "卫星时间存在错误"); + return 45; + } + long interval = curSatelliteTime - lastSatelliteTime; + Log.d("ADAS动画数据", "lastSatelliteTime : " + lastSatelliteTime + + " ---- curSatelliteTime : " + curSatelliteTime + " ===== 插值 : " + interval); if (interval < 45) { interval = 45; } 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 ba97aa5ac5..26d0d1942b 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 @@ -265,7 +265,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic while (iterator.hasNext()) { SocketDownData.CloudRoadDataProto result = iterator.next(); long internal = result.getSatelliteTime() - Long.parseLong(adasControllerApi.getSatelliteTime()); - if (internal > 300) { + if (internal > 3000) { iterator.remove(); } } @@ -320,7 +320,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic mLastPositions.put(uniqueKey, cloudRoadData); if (useCache) { - long interval = computeAnimDuration(lastPosition.getSystemTime(), cloudRoadData.getSystemTime(), lastPosition.getSatelliteTime(), cloudRoadData.getSatelliteTime()); + long interval = computeAnimDuration(lastPosition.getSatelliteTime(), cloudRoadData.getSatelliteTime()); final MogoLatLng point = new MogoLatLng(cloudRoadData.getWgslat(), cloudRoadData.getWgslon()); long cost = System.currentTimeMillis() - start; diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index aea4d25e86..e9240cbd8a 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -49,6 +49,7 @@ import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.map.uicontroller.IMogoMapUIController; import com.mogo.map.uicontroller.VisualAngleMode; import com.mogo.module.common.MogoApisHandler; +import com.mogo.module.common.constants.DataTypes; import com.mogo.module.common.dialog.WMDialog; import com.mogo.module.common.glide.SkinAbleBitmapTarget; import com.mogo.module.common.map.CustomNaviInterrupter; @@ -963,7 +964,7 @@ public class EntranceFragment extends MvpFragment