From f406171026e75165853506ed0c3a05ff5dd52eed Mon Sep 17 00:00:00 2001 From: liujing Date: Sun, 20 Dec 2020 11:39:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=BF=9D=E7=AB=A0=E5=81=9C=E8=BD=A6vr?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E6=B7=BB=E5=8A=A0=E6=89=93=E7=82=B9,?= =?UTF-8?q?=E8=87=AA=E7=A0=942d=E6=A8=A1=E5=BC=8F=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A4=AA=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/impl/MoGoV2XMarkerManager.java | 2 ++ .../scene/park/V2XIllegalParkMarker.java | 25 +++++++++++++++- .../src/main/res/raw/illegal_park_data.json | 4 +-- .../raw/scenario_fatigue_driving_data.json | 8 ++--- .../res/raw/scenario_road_event_data.json | 8 ++--- .../src/main/res/raw/scenario_seek_help.json | 30 +++++++++---------- 6 files changed, 51 insertions(+), 26 deletions(-) diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java index 9e3b9b2ad7..e1156aeb49 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XMarkerManager.java @@ -9,6 +9,7 @@ import com.mogo.map.MogoLatLng; import com.mogo.map.location.MogoLocation; import com.mogo.map.marker.IMogoMarker; import com.mogo.map.marker.IMogoMarkerClickListener; +import com.mogo.map.marker.IMogoMarkerManager; import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.map.uicontroller.EnumMapUI; import com.mogo.module.common.drawer.MarkerDrawer; @@ -554,6 +555,7 @@ public class MoGoV2XMarkerManager implements IMoGoV2XMarkerManager { mAlarmInfoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mAlarmInfoMarker.getMogoMarkerOptions())); mAlarmInfoMarker.showInfoWindow(); } else { + IMogoMarkerManager i = V2XServiceManager.getMarkerManager(); mAlarmInfoMarker = V2XServiceManager.getMarkerManager().addMarker(V2X_EVENT_ALARM_POI, optionsRipple); } // 当前Marker设置为最上面 diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java index cc940e252e..9d42604e53 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/park/V2XIllegalParkMarker.java @@ -4,12 +4,19 @@ import android.os.Handler; import android.view.animation.AccelerateInterpolator; import android.view.animation.LinearInterpolator; +import com.mogo.commons.AbsMogoApplication; import com.mogo.map.marker.IMogoMarker; +import com.mogo.map.marker.IMogoMarkerManager; +import com.mogo.map.marker.MogoMarkerOptions; import com.mogo.map.marker.anim.OnMarkerAnimationListener; +import com.mogo.module.common.drawer.MarkerDrawer; +import com.mogo.module.common.drawer.marker.RoadConditionInfoWindow3DAdapter; import com.mogo.module.common.entity.MarkerExploreWay; import com.mogo.module.common.entity.MarkerShowEntity; +import com.mogo.module.common.utils.CarSeries; import com.mogo.module.service.ServiceConst; import com.mogo.module.v2x.V2XServiceManager; +import com.mogo.module.v2x.marker.V2XMarkerAdapter; import com.mogo.module.v2x.scenario.view.IV2XMarker; import com.mogo.module.v2x.utils.MarkerUtils; import com.mogo.utils.WorkThreadHandler; @@ -19,6 +26,7 @@ import java.util.ArrayList; import java.util.List; import static com.mogo.module.v2x.V2XConst.MODULE_NAME; +import static com.mogo.module.v2x.V2XConst.V2X_EVENT_ALARM_POI; /** * author : donghongyu @@ -46,6 +54,14 @@ public class V2XIllegalParkMarker implements IV2XMarker> if (entityList != null) { for (int i = 0; i < entityList.size(); i++) { MarkerExploreWay markerExploreWay = entityList.get(i); + + // 道路事件,或者水波纹扩散效果 + MogoMarkerOptions optionsRipple = new MogoMarkerOptions() + .object(markerExploreWay) + .latitude(markerExploreWay.getLocation().getLat()) + .longitude(markerExploreWay.getLocation().getLon()); + optionsRipple.anchor(0.5f, 0.5f); + MarkerShowEntity markerShowEntity = new MarkerShowEntity(); markerShowEntity.setBindObj(markerExploreWay); markerShowEntity.setChecked(false); @@ -54,7 +70,14 @@ public class V2XIllegalParkMarker implements IV2XMarker> markerShowEntity.setMarkerType(ServiceConst.CARD_TYPE_NOVELTY); WorkThreadHandler.getInstance().postDelayed(() -> { - IMogoMarker mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity); + IMogoMarker mogoMarker; + if (V2XServiceManager.getMoGoStatusManager().isVrMode()) { + mogoMarker = MarkerDrawer.getInstance().drawMapMarkerImpl(markerShowEntity, MarkerDrawer.MARKER_Z_INDEX_HIGH, null); + mogoMarker.setInfoWindowAdapter(new RoadConditionInfoWindow3DAdapter(markerShowEntity, AbsMogoApplication.getApp(), mogoMarker.getMogoMarkerOptions())); + mogoMarker.showInfoWindow(); + } else { + mogoMarker = V2XServiceManager.getIMogoMarkerService().drawMarker(markerShowEntity); + } // 点击监听,天际弹窗展示详情 if (mogoMarker != null) { mogoMarker.startScaleAnimation(0, 1.2f, 0, 1.2f, 300, new AccelerateInterpolator(), new OnMarkerAnimationListener() { diff --git a/modules/mogo-module-v2x/src/main/res/raw/illegal_park_data.json b/modules/mogo-module-v2x/src/main/res/raw/illegal_park_data.json index aa78a935f3..0bd143d281 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/illegal_park_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/illegal_park_data.json @@ -18,8 +18,8 @@ "location":{ "address":"北三环麻家什字", "angle":0, - "lat":39.968598, - "lon":116.411121 + "lat":39.969057, + "lon":116.417831 }, "generateTime":0, "distance":0, diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json index e6612d5f41..e825678c42 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_fatigue_driving_data.json @@ -14,11 +14,11 @@ "zoom": true, "zoomScale": 15, "location": { - "lat":39.969088, - "lon":116.41808 + "lat":39.968738, + "lon":116.411288 }, - "lat":39.969088, - "lon":116.41808, + "lat":39.968738, + "lon":116.411288, "userHead": "https://yycp-static-1255510688.cos.ap-beijing.myqcloud.com/defaultUserHeadImg/5.png", "msgImgUrl": "https://upload.jianshu.io/users/upload_avatars/7663825/7c28763e-002b-4e89-8dea-5b8da210ef2c.jpg" } \ No newline at end of file diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json index ce7f84f44f..e9ab6a1b79 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_road_event_data.json @@ -5,8 +5,8 @@ "location":{ "address":"北三环环球贸易中心", "angle":270, - "lat":39.969088, - "lon":116.41808 + "lat":39.969057, + "lon":116.417831 }, "noveltyInfo":{ "addr":"北三环环球贸易中心", @@ -27,8 +27,8 @@ "location":{ "address":"北三环环球贸易中心", "angle":270, - "lat":39.969088, - "lon":116.41808 + "lat":39.969057, + "lon":116.417831 }, "poiType":"10003", "type":"CARD_TYPE_ROAD_CONDITION", diff --git a/modules/mogo-module-v2x/src/main/res/raw/scenario_seek_help.json b/modules/mogo-module-v2x/src/main/res/raw/scenario_seek_help.json index 58853e2a6f..f7316d824e 100644 --- a/modules/mogo-module-v2x/src/main/res/raw/scenario_seek_help.json +++ b/modules/mogo-module-v2x/src/main/res/raw/scenario_seek_help.json @@ -1,20 +1,20 @@ { - "coordinates":[ + "coordinates": [ { - "createTime":1593678359872, - "distance":1100, - "lat":39.969088, - "lon":116.41808, - "sn":"ZD801B1932L00041", - "targetId":20007, - "targetName":"故障车", - "userInfo":{ - "age":33, - "displayName":"小叮当", - "headImgUrl":"http://img.zhidaohulian.com/fileServer/api/qa/user_info/1243669495923/7c476a0515aa51ae355d10d7f21c898e.jpg", - "sex":1, - "sn":"ZD801B1932L00041", - "userId":1243669495923 + "createTime": 1593678359872, + "distance": 1100, + "lat":39.969057, + "lon":116.417831, + "sn": "ZD801B1932L00041", + "targetId": 20007, + "targetName": "故障车", + "userInfo": { + "age": 33, + "displayName": "小叮当", + "headImgUrl": "http://img.zhidaohulian.com/fileServer/api/qa/user_info/1243669495923/7c476a0515aa51ae355d10d7f21c898e.jpg", + "sex": 1, + "sn": "ZD801B1932L00041", + "userId": 1243669495923 } } ] From 6e551a0203625c6613bccc1710ad8aebf20b1e4b Mon Sep 17 00:00:00 2001 From: tongchenfei Date: Sun, 20 Dec 2020 12:00:39 +0800 Subject: [PATCH 2/4] opt cityCode --- .../main/java/com/mogo/base/websocket/WebSocketManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketManager.java b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketManager.java index f80e249d3e..eafa6edacf 100644 --- a/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketManager.java +++ b/foudations/mogo-base-websocket-sdk/src/main/java/com/mogo/base/websocket/WebSocketManager.java @@ -142,8 +142,10 @@ public class WebSocketManager implements IMogoWebSocketManager, ISocketMsgSettin webSocketData.setSn(Utils.getSn()); webSocketData.setData(GsonUtil.jsonFromObject(body)); MogoLocation lastKnown = MogoApisHandler.getInstance().getApis().getMapServiceApi().getSingletonLocationClient(context).getLastKnowLocation(); - if (lastKnown != null) { + if (lastKnown != null&&!lastKnown.getCityCode().isEmpty()) { webSocketData.setCityCode(lastKnown.getCityCode()); + }else{ + webSocketData.setCityCode(null); } String msg = GsonUtil.jsonFromObject(webSocketData); Logger.d(TAG,"sendMsg : " + msg); From a0721705cf0f04e185e7fcbbe019cf7e76fe248d Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Sun, 20 Dec 2020 12:21:31 +0800 Subject: [PATCH 3/4] opt --- .../extensions/entrance/EntranceFragment.java | 1 + .../utils/CameraLiveNoticeHelper.java | 44 +++++++++++-------- .../mogo/module/main/EventDispatchCenter.java | 8 +--- .../com/mogo/module/service/MogoServices.java | 1 + 4 files changed, 29 insertions(+), 25 deletions(-) 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 c711775c99..473a491c0a 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 @@ -6,6 +6,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.SystemClock; import android.text.TextUtils; +import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.MotionEvent; diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java index 89cb188fba..9496d677b9 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java @@ -66,7 +66,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener>>>mCurretnUuid = " + mCurretnUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid()); - if (mCurretnUuid != null && mCurretnUuid.equals(mCloudRoadData.getUuid())) { + Log.e(TAG, "onMsgReceived getRtmpUrl = " + mCloudRoadData.getRtmpUrl() + "--- isVrMode = " + isVrMode + ">>>>mCurrentUuid = " + mCurrentUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid()); + if (mCurrentUuid != null && mCurrentUuid.equals(mCloudRoadData.getUuid())) { Log.d(TAG, "isLoadVr = " + isLoadVr + "....isLoadNormal = " + isLoadNormal); if (isVrMode) { if (!isLoadVr) { - addVrCameraMarker(mCloudRoadData); isLoadVr = true; isLoadNormal = false; + Log.d(TAG, "addVrCameraMarker1 ------------1-------- "); + addVrCameraMarker(mCloudRoadData); + } else { + Log.e(TAG, "isVrMode not need add marker"); } } else { if (!isLoadNormal) { - addNormalCameraMarker(mCloudRoadData); isLoadNormal = true; isLoadVr = false; + Log.d(TAG, "addNormalCameraMarker1------------2-------- "); + addNormalCameraMarker(mCloudRoadData); + } else { + Log.e(TAG, "isNormalMode not need add marker"); } } } else { + mCurrentUuid = mCloudRoadData.getUuid(); + Log.e(TAG, "mCurrentUuid == null " + "-----isVrMode = " + isVrMode); if (isVrMode) { + Log.d(TAG, "addVrCameraMarker1 ------------11111-------- "); addVrCameraMarker(mCloudRoadData); } else { + Log.d(TAG, "addNormalCameraMarker1 ------------22222-------- "); addNormalCameraMarker(mCloudRoadData); } - mCurretnUuid = mCloudRoadData.getUuid(); } } else { //删除marker - removeCameraMarker(); - -// Log.e(TAG, "onMsgReceived mCloudRoadData == null "); -// UiThreadHandler.postDelayed(() -> { -// -// }, 1_000); + Log.e(TAG, "onMsgReceived mCloudRoadData == null "); + UiThreadHandler.postDelayed(() -> { + removeCameraMarker(); + }, 2_000); } } else { Logger.e(TAG, "onMsgReceived obj == null "); diff --git a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java index efbc64f845..f9c9b3e85f 100644 --- a/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java +++ b/modules/mogo-module-main/src/main/java/com/mogo/module/main/EventDispatchCenter.java @@ -1,6 +1,7 @@ package com.mogo.module.main; import android.location.Location; +import android.util.Log; import android.view.MotionEvent; import com.mogo.map.MogoLatLng; @@ -275,13 +276,6 @@ public class EventDispatchCenter implements } } } - if ( ui == EnumMapUI.Type_VR ) { - MogoApisHandler.getInstance().getApis().getStatusManagerApi() - .setVrMode( TAG, true ); - } else { - MogoApisHandler.getInstance().getApis().getStatusManagerApi() - .setVrMode( TAG, false ); - } } @Override diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java index 6fc36fbb25..07d1a81d12 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MogoServices.java @@ -10,6 +10,7 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.text.TextUtils; +import android.util.Log; import android.view.MotionEvent; import androidx.annotation.NonNull; From c5584d0a549acb42868551bc3bb2d76056d2bb7a Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Sun, 20 Dec 2020 14:16:34 +0800 Subject: [PATCH 4/4] opt --- .../utils/CameraLiveNoticeHelper.java | 24 ++++++++++++++++--- .../service/location/MogoRTKLocation.java | 1 - 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java index 9496d677b9..9b6b78f872 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/utils/CameraLiveNoticeHelper.java @@ -53,27 +53,45 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener>>>mCurrentUuid = " + mCurrentUuid + ">>>mCloudRoadData.getUuid() = " + mCloudRoadData.getUuid()); if (mCurrentUuid != null && mCurrentUuid.equals(mCloudRoadData.getUuid())) { @@ -181,7 +199,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener>>>long = " + location.getLongitude()); cacheList.add(cloudLocationInfo); } else { Logger.e(TAG, "location == null");