remix the aiCloudSocketData
This commit is contained in:
@@ -250,8 +250,6 @@ public class MogoApplication extends AbsMogoApplication {
|
||||
clientConfig.setThirdPartyDeviceId(Utils.getSn());
|
||||
// 设置循环检测间隔时间
|
||||
clientConfig.setLoopCheckDelay(15 * 1000);
|
||||
// 设置是否使用MoGoAiCloud SDK内部定位进行实时数据上报
|
||||
clientConfig.setIsUseExternalLocation(true);
|
||||
|
||||
// 设置DNS经纬度位置
|
||||
clientConfig.setIHttpDnsCurrentLocation(new IHttpDnsCurrentLocation() {
|
||||
|
||||
@@ -7,10 +7,10 @@ import androidx.annotation.Keep;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketMsgAckListener;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
|
||||
import com.mogo.cloud.socket.SocketManager;
|
||||
import com.mogo.cloud.socket.entity.MsgBody;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.connection.MsgBody;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class MogoAiCloudSocketManager implements IMogoSocketManager {
|
||||
public void sendMsg(MsgBody body, IMogoMsgAckListener listener) {
|
||||
Logger.d(TAG, "sendMsg.");
|
||||
mAckListeners.put(body.getMsgId(), listener);
|
||||
com.mogo.cloud.socket.MsgBody msgBody = new com.mogo.cloud.socket.MsgBody();
|
||||
MsgBody msgBody = new MsgBody();
|
||||
msgBody.msgType(body.getMsgType());
|
||||
msgBody.ack(body.isAck());
|
||||
msgBody.content(body.getContent());
|
||||
|
||||
@@ -7,10 +7,10 @@ import androidx.annotation.Keep;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketMsgAckListener;
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener;
|
||||
import com.mogo.cloud.socket.SocketManager;
|
||||
import com.mogo.cloud.socket.entity.MsgBody;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.connection.MsgBody;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.zhidao.ptech.connsvr.commom.protocol.MogoCommon;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class MogoAiCloudSocketManager implements IMogoSocketManager {
|
||||
public void sendMsg(MsgBody body, IMogoMsgAckListener listener) {
|
||||
Logger.d(TAG, "sendMsg.");
|
||||
mAckListeners.put(body.getMsgId(), listener);
|
||||
com.mogo.cloud.socket.MsgBody msgBody = new com.mogo.cloud.socket.MsgBody();
|
||||
MsgBody msgBody = new MsgBody();
|
||||
msgBody.msgType(body.getMsgType());
|
||||
msgBody.ack(body.isAck());
|
||||
msgBody.content(body.getContent());
|
||||
|
||||
@@ -156,19 +156,19 @@ LOGLIB_VERSION = 1.0.4
|
||||
|
||||
######## MogoAiCloudSDK Version
|
||||
# 网络请求
|
||||
MOGO_NETWORK_VERSION=1.0.84
|
||||
MOGO_NETWORK_VERSION=1.1.4
|
||||
# 鉴权
|
||||
MOGO_PASSPORT_VERSION=1.0.84
|
||||
MOGO_PASSPORT_VERSION=1.1.4
|
||||
# 常链接
|
||||
MOGO_SOCKET_VERSION=1.0.84
|
||||
MOGO_SOCKET_VERSION=1.1.4
|
||||
# 数据采集
|
||||
MOGO_REALTIME_VERSION=1.0.84
|
||||
MOGO_REALTIME_VERSION=1.1.4
|
||||
# 探路,道路事件发布,获取
|
||||
MOGO_TANLU_VERSION=1.0.84
|
||||
MOGO_TANLU_VERSION=1.1.4
|
||||
# 直播推流
|
||||
MOGO_LIVE_VERSION=1.0.84
|
||||
MOGO_LIVE_VERSION=1.1.4
|
||||
# 直播拉流
|
||||
MOGO_TRAFFICLIVE_VERSION=1.0.84
|
||||
MOGO_TRAFFICLIVE_VERSION=1.1.4
|
||||
|
||||
######## Foundation MogoAiCloud Module
|
||||
# mogoAiCloud apk services
|
||||
|
||||
@@ -51,7 +51,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -1052,11 +1051,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
@Override
|
||||
public long getTileId(double lon, double lat) {
|
||||
return getMap().getUIController().getTileId(lon,lat);
|
||||
return getMap().getUIController().getTileId(lon, lat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.NetworkUtils;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -826,8 +825,4 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return getMap().getUIController().getTileId(lon,lat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.List;
|
||||
@@ -48,11 +47,11 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
public void initClient(IMogoMapUIController client) {
|
||||
Logger.d( "whatthefuck-AMapUIController", "init %s", this );
|
||||
Logger.d("whatthefuck-AMapUIController", "init %s", this);
|
||||
this.mClient = client;
|
||||
}
|
||||
|
||||
public synchronized void destroy(){
|
||||
public synchronized void destroy() {
|
||||
mClient = null;
|
||||
}
|
||||
|
||||
@@ -69,7 +68,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom( boolean zoom) {
|
||||
public MapControlResult changeZoom(boolean zoom) {
|
||||
if (mClient != null) {
|
||||
return mClient.changeZoom(zoom);
|
||||
}
|
||||
@@ -86,7 +85,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
Logger.d( "whatthefuck-AMapUIController", "%s", this );
|
||||
Logger.d("whatthefuck-AMapUIController", "%s", this);
|
||||
if (mClient != null) {
|
||||
mClient.changeMapMode(mode);
|
||||
}
|
||||
@@ -118,15 +117,15 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void emphasizeMyLocation() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.emphasizeMyLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( View view ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.showMyLocation( view );
|
||||
public void showMyLocation(View view) {
|
||||
if (mClient != null) {
|
||||
mClient.showMyLocation(view);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +138,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void loseLockMode() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.loseLockMode();
|
||||
}
|
||||
}
|
||||
@@ -152,7 +151,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
public void displayOverview(Rect bounds) {
|
||||
if (mClient != null) {
|
||||
mClient.displayOverview(bounds);
|
||||
}
|
||||
@@ -198,7 +197,8 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public MogoLatLng getWindowCenterLocation() {
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
if (mClient != null) {
|
||||
return mClient.getWindowCenterLocation();
|
||||
}
|
||||
@@ -230,7 +230,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
|
||||
long duration) {
|
||||
long duration) {
|
||||
if (mClient != null) {
|
||||
mClient.startJumpAnimation(marker, high, interpolator, duration);
|
||||
}
|
||||
@@ -244,9 +244,9 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBounds( String tag, MogoLatLng carPosition, List< MogoLatLng > lonLats, Rect bound, boolean lockCarPosition ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.showBounds( tag, carPosition, lonLats, bound, lockCarPosition );
|
||||
public void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition) {
|
||||
if (mClient != null) {
|
||||
mClient.showBounds(tag, carPosition, lonLats, bound, lockCarPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,62 +258,55 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateLineDistance( MogoLatLng p1, MogoLatLng p2 ) throws Exception {
|
||||
if ( mClient != null ) {
|
||||
return mClient.calculateLineDistance( p1, p2 );
|
||||
public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception {
|
||||
if (mClient != null) {
|
||||
return mClient.calculateLineDistance(p1, p2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getCurrentUiMode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMyLocation( Location location ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeMyLocation( location );
|
||||
public void changeMyLocation(Location location) {
|
||||
if (mClient != null) {
|
||||
mClient.changeMyLocation(location);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarLocked() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.isCarLocked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption( CarCursorOption option ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setCarCursorOption( option );
|
||||
public void setCarCursorOption(CarCursorOption option) {
|
||||
if (mClient != null) {
|
||||
mClient.setCarCursorOption(option);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCameraPosition getMapCameraPosition() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getMapCameraPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeBearing( float bearing ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeBearing( bearing );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setAdasRecognizedResult(result);
|
||||
public void changeBearing(float bearing) {
|
||||
if (mClient != null) {
|
||||
mClient.changeBearing(bearing);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -815,14 +814,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
showSelfSpeed(location.getSpeed());
|
||||
}
|
||||
|
||||
private ADASRecognizedResult mAdasResult;
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
mAdasResult = result;
|
||||
}
|
||||
|
||||
|
||||
private TextView mSpeedView = null;
|
||||
private int mLastYOffset = 20;
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -375,10 +374,4 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
if (mClient != null) {
|
||||
mClient.setAdasRecognizedResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -251,8 +250,6 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void changeBearing(float bearing);
|
||||
|
||||
void setAdasRecognizedResult(ADASRecognizedResult result);
|
||||
|
||||
/**
|
||||
* 获取瓦片id
|
||||
*
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -421,11 +420,4 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdasRecognizedResult(ADASRecognizedResult result) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setAdasRecognizedResult(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mogo.module.common.drawer;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -10,8 +11,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.utils.SimpleHandlerThreadPool;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -37,12 +37,12 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
super();
|
||||
}
|
||||
|
||||
private final Map< String, ADASRecognizedResult > mLastPositions = new ConcurrentHashMap<>();
|
||||
private final Map<String, ADASRecognizedResult> mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AdasRecognizedResultDrawer.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (AdasRecognizedResultDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new AdasRecognizedResultDrawer();
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,8 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public boolean hasCached( String uniqueKey ) {
|
||||
return mMarkersCaches.containsKey( uniqueKey );
|
||||
public boolean hasCached(String uniqueKey) {
|
||||
return mMarkersCaches.containsKey(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,33 +68,33 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
*
|
||||
* @param resultList
|
||||
*/
|
||||
public void renderAdasRecognizedResult( List< ADASRecognizedResult > resultList ) {
|
||||
if ( resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize() ) {
|
||||
public void renderAdasRecognizedResult(List<ADASRecognizedResult> resultList) {
|
||||
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
|
||||
clearOldMarker();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
clearOldMarker();
|
||||
return;
|
||||
}
|
||||
|
||||
Map< String, IMogoMarker > newAdasRecognizedMarkersCaches = new HashMap<>();
|
||||
List< ADASRecognizedResult > newDiffSet = new ArrayList<>();
|
||||
for ( ADASRecognizedResult recognizedListResult : resultList ) {
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches = new HashMap<>();
|
||||
List<ADASRecognizedResult> newDiffSet = new ArrayList<>();
|
||||
for (ADASRecognizedResult recognizedListResult : resultList) {
|
||||
|
||||
if ( isUselessValue( recognizedListResult ) ) {
|
||||
if (isUselessValue(recognizedListResult)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 复用之前存在的 marker
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
IMogoMarker marker = mMarkersCaches.remove( uniqueKey );
|
||||
if ( marker != null && !marker.isDestroyed() ) {
|
||||
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
} else {
|
||||
// 新增差集
|
||||
newDiffSet.add( recognizedListResult );
|
||||
newDiffSet.add(recognizedListResult);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,66 +108,66 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
int size = cachedMarkerSize >= newDiffSetSize ? newDiffSetSize : cachedMarkerSize;
|
||||
|
||||
// 复用过期 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 );
|
||||
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();
|
||||
Map.Entry<String, IMogoMarker> entry = entryIterator.next();
|
||||
entryIterator.remove();
|
||||
ADASRecognizedResult old = mLastPositions.remove( entry.getKey() );
|
||||
ADASRecognizedResult old = mLastPositions.remove(entry.getKey());
|
||||
IMogoMarker marker = entry.getValue();
|
||||
if ( marker == null ) {
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 更新资源内容
|
||||
if ( old == null || old.type != recognizedListResult.type ) {
|
||||
if (old == null || old.type != recognizedListResult.type) {
|
||||
String resIdVal = null;
|
||||
int resId = getModelRes( recognizedListResult.type );
|
||||
int resId = getModelRes(recognizedListResult.type);
|
||||
resIdVal = resId + "";
|
||||
String resName = mMarkerCachesResMd5Values.get( resIdVal );
|
||||
if ( !TextUtils.isEmpty( resName ) ) {
|
||||
if ( !TextUtils.equals( resName, marker.getMarkerResName() ) ) {
|
||||
marker.use3DResource( resName );
|
||||
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 );
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
}
|
||||
|
||||
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
}
|
||||
|
||||
// 复用过后还需新增的 marker
|
||||
|
||||
for ( int i = size; i < newDiffSetSize; i++ ) {
|
||||
ADASRecognizedResult recognizedListResult = newDiffSet.get( i );
|
||||
for (int i = size; i < newDiffSetSize; i++) {
|
||||
ADASRecognizedResult recognizedListResult = newDiffSet.get(i);
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
IMogoMarker marker = drawAdasRecognizedDataMarker( recognizedListResult );
|
||||
if ( marker == null ) {
|
||||
IMogoMarker marker = drawAdasRecognizedDataMarker(recognizedListResult);
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
renderAdasOneFrame( marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches );
|
||||
renderAdasOneFrame(marker, uniqueKey, recognizedListResult, newAdasRecognizedMarkersCaches);
|
||||
}
|
||||
}
|
||||
if ( cachedMarkerSize - size > 0 ) {
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches );
|
||||
if (cachedMarkerSize - size > 0) {
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
}
|
||||
mMarkersCaches = newAdasRecognizedMarkersCaches;
|
||||
}
|
||||
|
||||
private boolean isUselessValue( ADASRecognizedResult recognizedListResult ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
private boolean isUselessValue(ADASRecognizedResult recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
return true;
|
||||
}
|
||||
if ( !isRenderType( recognizedListResult.type ) ) {
|
||||
if (!isRenderType(recognizedListResult.type)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
if ( TextUtils.isEmpty( uniqueKey ) ) {
|
||||
if (TextUtils.isEmpty(uniqueKey)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -179,49 +179,49 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
* @param recognizedListResult
|
||||
* @param newAdasRecognizedMarkersCaches
|
||||
*/
|
||||
private void renderAdasOneFrame( IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
ADASRecognizedResult recognizedListResult,
|
||||
Map< String, IMogoMarker > newAdasRecognizedMarkersCaches ) {
|
||||
private void renderAdasOneFrame(IMogoMarker marker,
|
||||
String uniqueKey,
|
||||
ADASRecognizedResult recognizedListResult,
|
||||
Map<String, IMogoMarker> newAdasRecognizedMarkersCaches) {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
ADASRecognizedResult lastPosition = mLastPositions.remove( uniqueKey );
|
||||
ADASRecognizedResult lastPosition = mLastPositions.remove(uniqueKey);
|
||||
double lastLon = -1;
|
||||
double lastLat = -1;
|
||||
if ( lastPosition != null ) {
|
||||
if (lastPosition != null) {
|
||||
lastLon = lastPosition.lon;
|
||||
lastLat = lastPosition.lat;
|
||||
}
|
||||
double[] matchLonLat = getMatchLonLat( recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat );
|
||||
double[] matchLonLat = getMatchLonLat(recognizedListResult.uuid, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading, lastLon, lastLat);
|
||||
|
||||
recognizedListResult.lon = matchLonLat[0];
|
||||
recognizedListResult.lat = matchLonLat[1];
|
||||
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
mLastPositions.put(uniqueKey, recognizedListResult);
|
||||
// Logger.d( "matchRoad", "cost = %s", System.currentTimeMillis() - start );
|
||||
|
||||
newAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
if ( lastPosition != null ) {
|
||||
long interval = computeAnimDuration( lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime );
|
||||
newAdasRecognizedMarkersCaches.put(uniqueKey, marker);
|
||||
if (lastPosition != null) {
|
||||
long interval = computeAnimDuration(lastPosition.systemTime, recognizedListResult.systemTime, lastPosition.satelliteTime, recognizedListResult.satelliteTime);
|
||||
|
||||
final MogoLatLng renderLoc = new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon );
|
||||
final MogoLatLng renderLoc = new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon);
|
||||
long cost = System.currentTimeMillis() - start;
|
||||
final long intervalRef = interval - cost;
|
||||
SimpleHandlerThreadPool.getInstance().postRender( () -> {
|
||||
marker.addDynamicAnchorPosition( renderLoc, ( float ) recognizedListResult.heading, intervalRef );
|
||||
} );
|
||||
SimpleHandlerThreadPool.getInstance().postRender(() -> {
|
||||
marker.addDynamicAnchorPosition(renderLoc, (float) recognizedListResult.heading, intervalRef);
|
||||
});
|
||||
} else {
|
||||
marker.setRotateAngle( ( ( float ) recognizedListResult.heading ) );
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
marker.setRotateAngle(((float) recognizedListResult.heading));
|
||||
marker.setPosition(recognizedListResult.lat, recognizedListResult.lon);
|
||||
}
|
||||
String carColor = recognizedListResult.color;
|
||||
if ( TextUtils.isEmpty( carColor ) ) {
|
||||
carColor = getModelRenderColor( recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading );
|
||||
if (TextUtils.isEmpty(carColor)) {
|
||||
carColor = getModelRenderColor(recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading);
|
||||
}
|
||||
marker.setAnchorColor( carColor );
|
||||
marker.setAnchorColor(carColor);
|
||||
|
||||
if ( shouldShowSpeed( recognizedListResult.type ) ) {
|
||||
if (shouldShowSpeed(recognizedListResult.type)) {
|
||||
Message msg = mRenderThreadHandler.obtainMessage();
|
||||
SpeedData obj = new SpeedData();
|
||||
obj.context = mContext;
|
||||
@@ -239,32 +239,32 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
* @param recognizedListResult
|
||||
* @return
|
||||
*/
|
||||
private IMogoMarker drawAdasRecognizedDataMarker( ADASRecognizedResult recognizedListResult ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
private IMogoMarker drawAdasRecognizedDataMarker(ADASRecognizedResult recognizedListResult) {
|
||||
if (recognizedListResult == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String resIdVal = null;
|
||||
int resId = getModelRes( recognizedListResult.type );
|
||||
int resId = getModelRes(recognizedListResult.type);
|
||||
resIdVal = resId + "";
|
||||
|
||||
String carColor = recognizedListResult.color;
|
||||
if ( TextUtils.isEmpty( carColor ) ) {
|
||||
carColor = getModelRenderColor( recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading );
|
||||
if (TextUtils.isEmpty(carColor)) {
|
||||
carColor = getModelRenderColor(recognizedListResult.type, recognizedListResult.speed, recognizedListResult.lon, recognizedListResult.lat, recognizedListResult.heading);
|
||||
}
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( DataTypes.TYPE_MARKER_ADAS )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
.set3DMode( true )
|
||||
.gps( true )
|
||||
.anchorColor( carColor )
|
||||
.controlAngle( true )
|
||||
.resName( mMarkerCachesResMd5Values.get( resIdVal ) )
|
||||
.icon3DRes( resId )
|
||||
.rotate( ( float ) recognizedListResult.heading )
|
||||
.position( new MogoLatLng( recognizedListResult.lat, recognizedListResult.lon ) );
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_ADAS, options );
|
||||
cacheMarkerIconResMd5Val( resIdVal, marker );
|
||||
.owner(DataTypes.TYPE_MARKER_ADAS)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.set3DMode(true)
|
||||
.gps(true)
|
||||
.anchorColor(carColor)
|
||||
.controlAngle(true)
|
||||
.resName(mMarkerCachesResMd5Values.get(resIdVal))
|
||||
.icon3DRes(resId)
|
||||
.rotate((float) recognizedListResult.heading)
|
||||
.position(new MogoLatLng(recognizedListResult.lat, recognizedListResult.lon));
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(DataTypes.TYPE_MARKER_ADAS, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
return marker;
|
||||
}
|
||||
|
||||
@@ -279,12 +279,12 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
* 清除旧的 marker 数据
|
||||
*/
|
||||
public void clearOldMarker() {
|
||||
if ( mMarkersCaches != null ) {
|
||||
if (mMarkersCaches != null) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
if ( mLastPositions != null ) {
|
||||
if (mLastPositions != null) {
|
||||
mLastPositions.clear();
|
||||
}
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS );
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_ADAS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.cloud.socket.entity.SocketDownDataHelper;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
@@ -16,8 +18,6 @@ import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.utils.SimpleHandlerThreadPool;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.ViewUtils;
|
||||
@@ -50,13 +50,13 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
super();
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, this );
|
||||
.registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, this);
|
||||
}
|
||||
|
||||
public static SnapshotSetDataDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SnapshotSetDataDrawer.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (SnapshotSetDataDrawer.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SnapshotSetDataDrawer();
|
||||
}
|
||||
}
|
||||
@@ -73,24 +73,23 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private final Map< String, CloudRoadData > mLastPositions = new ConcurrentHashMap<>();
|
||||
private final Map<String, SocketDownData.CloudRoadDataProto> mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
private boolean mIsVrMode = false;
|
||||
|
||||
/**
|
||||
* 注册StatusDescriptor.VR_MODE类型,VR_MODE状态改变回调
|
||||
*
|
||||
* @param descriptor 状态类型
|
||||
* @param isTrue true - accOn、adas ui show、voice ui show、push ui show、v2x ui show
|
||||
*/
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
Logger.d( TAG, "%s - %s", descriptor, isTrue );
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
Logger.d(TAG, "%s - %s", descriptor, isTrue);
|
||||
mChangeCarModeStatus = true;
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches );
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches = new HashMap<>();
|
||||
if ( mLastPositions != null ) {
|
||||
mLastPositions.clear();
|
||||
}
|
||||
mLastPositions.clear();
|
||||
AdasRecognizedResultDrawer.getInstance().notifyVrModeChanged(); //清除ADAS old marker data
|
||||
}
|
||||
|
||||
@@ -102,7 +101,7 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
return mChangeCarModeStatus;
|
||||
}
|
||||
|
||||
public void setChangeCarModeStatus( boolean mChangeCarModeStatus ) {
|
||||
public void setChangeCarModeStatus(boolean mChangeCarModeStatus) {
|
||||
this.mChangeCarModeStatus = mChangeCarModeStatus;
|
||||
}
|
||||
|
||||
@@ -112,30 +111,24 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
* @param data 自车周边数据
|
||||
* @return 清除结果
|
||||
*/
|
||||
private boolean clear( MogoSnapshotSetData data ) {
|
||||
if ( !MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched() ) {
|
||||
if ( mMarkersCaches == null ) {
|
||||
private boolean clear(SocketDownData.LauncherSnapshotProto data) {
|
||||
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isMainPageLaunched()) {
|
||||
if (mMarkersCaches == null) {
|
||||
return false;
|
||||
}
|
||||
if ( mMarkersCaches != null ) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
if ( mLastPositions != null ) {
|
||||
mLastPositions.clear();
|
||||
}
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_CLOUD_DATA );
|
||||
mMarkersCaches.clear();
|
||||
mLastPositions.clear();
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_CLOUD_DATA);
|
||||
return true;
|
||||
}
|
||||
if ( data == null || (
|
||||
( data.getAllList() == null || data.getAllList().isEmpty() ) &&
|
||||
( data.getNearList() == null || data.getNearList().isEmpty() ) ) ) {
|
||||
if ( mMarkersCaches != null ) {
|
||||
if (data == null || (
|
||||
(data.getAllListList() == null || data.getAllListList().isEmpty()) &&
|
||||
(data.getNearListList() == null || data.getNearListList().isEmpty()))) {
|
||||
if (mMarkersCaches != null) {
|
||||
mMarkersCaches.clear();
|
||||
}
|
||||
if ( mLastPositions != null ) {
|
||||
mLastPositions.clear();
|
||||
}
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_CLOUD_DATA );
|
||||
mLastPositions.clear();
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, DataTypes.TYPE_MARKER_CLOUD_DATA);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -146,28 +139,28 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
*
|
||||
* @param data 自车周边数据
|
||||
*/
|
||||
public void renderSnapshotData( MogoSnapshotSetData data ) {
|
||||
public void renderSnapshotData(SocketDownData.LauncherSnapshotProto data) {
|
||||
|
||||
if ( clear( data ) ) {
|
||||
if (clear(data)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List< CloudRoadData > allDatumsList = new ArrayList<>();
|
||||
prepareData( data.getAllList(), allDatumsList );
|
||||
List<SocketDownData.CloudRoadDataProto> allDatumsList = new ArrayList<>();
|
||||
prepareData(data.getAllListList(), allDatumsList);
|
||||
|
||||
Map< String, IMogoMarker > newMarkersCaches = new HashMap<>( allDatumsList.size() );
|
||||
List< CloudRoadData > newDiffSet = new ArrayList<>();
|
||||
Map<String, IMogoMarker> newMarkersCaches = new HashMap<>(allDatumsList.size());
|
||||
List<SocketDownData.CloudRoadDataProto> newDiffSet = new ArrayList<>();
|
||||
|
||||
for ( CloudRoadData cloudRoadData : allDatumsList ) {
|
||||
if ( isUselessValue( cloudRoadData ) ) {
|
||||
for (SocketDownData.CloudRoadDataProto cloudRoadData : allDatumsList) {
|
||||
if (isUselessValue(cloudRoadData)) {
|
||||
continue;
|
||||
}
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
IMogoMarker marker = mMarkersCaches.remove( uniqueKey );
|
||||
if ( marker != null && !marker.isDestroyed() ) {
|
||||
renderSnapshotOneFrame( marker, uniqueKey, cloudRoadData, newMarkersCaches );
|
||||
String uniqueKey = cloudRoadData.getUuid();
|
||||
IMogoMarker marker = mMarkersCaches.remove(uniqueKey);
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
renderSnapshotOneFrame(marker, uniqueKey, cloudRoadData, newMarkersCaches);
|
||||
} else {
|
||||
newDiffSet.add( cloudRoadData );
|
||||
newDiffSet.add(cloudRoadData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,55 +174,55 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
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++ ) {
|
||||
CloudRoadData cloudRoadData = newDiffSet.get( i );
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
Map.Entry< String, IMogoMarker > entry = entryIterator.next();
|
||||
if (newDiffSetSize > 0) {
|
||||
Iterator<Map.Entry<String, IMogoMarker>> entryIterator = mMarkersCaches.entrySet().iterator();
|
||||
for (int i = 0; i < size; i++) {
|
||||
SocketDownData.CloudRoadDataProto cloudRoadData = newDiffSet.get(i);
|
||||
String uniqueKey = cloudRoadData.getUuid();
|
||||
Map.Entry<String, IMogoMarker> entry = entryIterator.next();
|
||||
entryIterator.remove();
|
||||
CloudRoadData old = mLastPositions.remove( entry.getKey() );
|
||||
SocketDownData.CloudRoadDataProto old = mLastPositions.remove(entry.getKey());
|
||||
IMogoMarker marker = entry.getValue();
|
||||
if ( marker == null ) {
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 更新资源内容
|
||||
if ( old == null || old.getType() != cloudRoadData.getType() ) {
|
||||
if (old == null || old.getType() != cloudRoadData.getType()) {
|
||||
String resIdVal;
|
||||
int resId = getModelRes( cloudRoadData.getType() );
|
||||
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 );
|
||||
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 );
|
||||
resName = marker.use3DResource(resId);
|
||||
mMarkerCachesResMd5Values.put(resIdVal, resName);
|
||||
}
|
||||
}
|
||||
|
||||
renderSnapshotOneFrame( marker, uniqueKey, cloudRoadData, newMarkersCaches );
|
||||
renderSnapshotOneFrame(marker, uniqueKey, cloudRoadData, newMarkersCaches);
|
||||
}
|
||||
|
||||
// 复用过后还需新增的 marker
|
||||
|
||||
for ( int i = size; i < newDiffSetSize; i++ ) {
|
||||
CloudRoadData cloudRoadData = newDiffSet.get( i );
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
IMogoMarker marker = drawSnapshotDataMarker( cloudRoadData );
|
||||
if ( marker == null ) {
|
||||
for (int i = size; i < newDiffSetSize; i++) {
|
||||
SocketDownData.CloudRoadDataProto cloudRoadData = newDiffSet.get(i);
|
||||
String uniqueKey = cloudRoadData.getUuid();
|
||||
IMogoMarker marker = drawSnapshotDataMarker(cloudRoadData);
|
||||
if (marker == null) {
|
||||
continue;
|
||||
}
|
||||
renderSnapshotOneFrame( marker, uniqueKey, cloudRoadData, newMarkersCaches );
|
||||
renderSnapshotOneFrame(marker, uniqueKey, cloudRoadData, newMarkersCaches);
|
||||
}
|
||||
}
|
||||
if ( cachedMarkerSize - size > 0 ) {
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches );
|
||||
if (cachedMarkerSize - size > 0) {
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
}
|
||||
|
||||
sendMessage( MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches );
|
||||
sendMessage(MSG_REMOVE_DIRTY_MARKERS, mMarkersCaches);
|
||||
mMarkersCaches = newMarkersCaches;
|
||||
|
||||
}
|
||||
@@ -237,62 +230,68 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
/**
|
||||
* 判断类型、uuid 等
|
||||
*
|
||||
* @param cloudRoadData {@link CloudRoadData}
|
||||
* @param cloudRoadData {@link SocketDownData.CloudRoadDataProto}
|
||||
* @return isUselessValue
|
||||
*/
|
||||
private boolean isUselessValue( CloudRoadData cloudRoadData ) {
|
||||
if ( cloudRoadData == null ) {
|
||||
private boolean isUselessValue(SocketDownData.CloudRoadDataProto cloudRoadData) {
|
||||
if (cloudRoadData == null) {
|
||||
return true;
|
||||
}
|
||||
if ( !isRenderType( cloudRoadData.getType() ) ) {
|
||||
if (!isRenderType(cloudRoadData.getType())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
String uniqueKey = cloudRoadData.getUuid();
|
||||
return TextUtils.isEmpty(uniqueKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制某个物体的一个数据
|
||||
*
|
||||
* @param cloudRoadData {@link CloudRoadData}
|
||||
* @param cloudRoadData {@link SocketDownData.CloudRoadDataProto}
|
||||
* @param newSnapshotCaches 缓存数据
|
||||
*/
|
||||
private void renderSnapshotOneFrame( IMogoMarker marker, String uniqueKey, final CloudRoadData cloudRoadData, Map< String, IMogoMarker > newSnapshotCaches ) {
|
||||
private void renderSnapshotOneFrame(IMogoMarker marker, String uniqueKey, SocketDownData.CloudRoadDataProto cloudRoadData, Map<String, IMogoMarker> newSnapshotCaches) {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
CloudRoadData lastPosition = mLastPositions.remove( uniqueKey );
|
||||
SocketDownData.CloudRoadDataProto lastPosition = mLastPositions.remove(uniqueKey);
|
||||
|
||||
double lastLon = -1;
|
||||
double lastLat = -1;
|
||||
if ( lastPosition != null ) {
|
||||
if (lastPosition != null) {
|
||||
lastLon = lastPosition.getWgslon();
|
||||
lastLat = lastPosition.getWgslat();
|
||||
}
|
||||
double[] matchLonLat = getMatchLonLat( cloudRoadData.getUniqueKey(), cloudRoadData.getWgslon(), cloudRoadData.getWgslat(), cloudRoadData.getHeading(), lastLon, lastLat );
|
||||
cloudRoadData.setWgslon( matchLonLat[0] );
|
||||
cloudRoadData.setWgslat( matchLonLat[1] );
|
||||
|
||||
mLastPositions.put( uniqueKey, cloudRoadData );
|
||||
double[] matchLonLat = getMatchLonLat(cloudRoadData.getUuid(), cloudRoadData.getWgslon(), cloudRoadData.getWgslat(), cloudRoadData.getHeading(), lastLon, lastLat);
|
||||
|
||||
newSnapshotCaches.put( uniqueKey, marker );
|
||||
if ( lastPosition != null ) {
|
||||
long interval = computeAnimDuration( lastPosition.getSystemTime(), cloudRoadData.getSystemTime(), lastPosition.getSatelliteTime(), cloudRoadData.getSatelliteTime() );
|
||||
SocketDownData.CloudRoadDataProto.Builder builder = cloudRoadData.toBuilder();
|
||||
builder.setWgslon(matchLonLat[0]);
|
||||
builder.setWgslat(matchLonLat[1]);
|
||||
|
||||
final MogoLatLng point = new MogoLatLng( cloudRoadData.getWgslat(), cloudRoadData.getWgslon() );
|
||||
cloudRoadData = builder.build(); //todo 验证值是否改变
|
||||
|
||||
mLastPositions.put(uniqueKey, cloudRoadData);
|
||||
|
||||
newSnapshotCaches.put(uniqueKey, marker);
|
||||
if (lastPosition != null) {
|
||||
long interval = computeAnimDuration(lastPosition.getSystemTime(), cloudRoadData.getSystemTime(), lastPosition.getSatelliteTime(), cloudRoadData.getSatelliteTime());
|
||||
|
||||
final MogoLatLng point = new MogoLatLng(cloudRoadData.getWgslat(), cloudRoadData.getWgslon());
|
||||
long cost = System.currentTimeMillis() - start;
|
||||
final long intervalRef = interval - cost;
|
||||
|
||||
SimpleHandlerThreadPool.getInstance().postRender( () -> marker.addDynamicAnchorPosition( point, ( float ) cloudRoadData.getHeading(), intervalRef ));
|
||||
SocketDownData.CloudRoadDataProto finalCloudRoadData = cloudRoadData;
|
||||
SimpleHandlerThreadPool.getInstance().postRender(() -> marker.addDynamicAnchorPosition(point, (float) finalCloudRoadData.getHeading(), intervalRef));
|
||||
} else {
|
||||
marker.setRotateAngle( ( ( float ) cloudRoadData.getHeading() ) );
|
||||
marker.setPosition( cloudRoadData.getWgslat(), cloudRoadData.getWgslon() );
|
||||
marker.setRotateAngle(((float) cloudRoadData.getHeading()));
|
||||
marker.setPosition(cloudRoadData.getWgslat(), cloudRoadData.getWgslon());
|
||||
}
|
||||
|
||||
marker.setAnchorColor( getModelRenderColor( cloudRoadData.getType(), cloudRoadData.getSpeed(), cloudRoadData.getWgslon(), cloudRoadData.getWgslat(), cloudRoadData.getHeading() ) );
|
||||
marker.setAnchorColor(getModelRenderColor(cloudRoadData.getType(), cloudRoadData.getSpeed(), cloudRoadData.getWgslon(), cloudRoadData.getWgslat(), cloudRoadData.getHeading()));
|
||||
|
||||
if ( shouldShowSpeed( cloudRoadData.getType() ) ) {
|
||||
if (shouldShowSpeed(cloudRoadData.getType())) {
|
||||
Message msg = mRenderThreadHandler.obtainMessage();
|
||||
SpeedData obj = new SpeedData();
|
||||
obj.context = mContext;
|
||||
@@ -310,9 +309,9 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
* @param in 输入集合
|
||||
* @param out 输出集合
|
||||
*/
|
||||
private void prepareData( List< CloudRoadData > in, List< CloudRoadData > out ) {
|
||||
filterData( in );
|
||||
out.addAll( in );
|
||||
private void prepareData(List<SocketDownData.CloudRoadDataProto> in, List<SocketDownData.CloudRoadDataProto> out) {
|
||||
filterData(in);
|
||||
out.addAll(in);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,32 +319,32 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
*
|
||||
* @param data 道路数据集合
|
||||
*/
|
||||
private void filterData( List< CloudRoadData > data ) {
|
||||
if ( data == null || data.isEmpty() ) {
|
||||
private void filterData(List<SocketDownData.CloudRoadDataProto> data) {
|
||||
if (data == null || data.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
return;
|
||||
}
|
||||
List< CloudRoadData > newList = new ArrayList<>();
|
||||
for ( CloudRoadData cloudRoadData : data ) {
|
||||
if ( cloudRoadData.getFromType() != CloudRoadData.FROM_MY_LOCATION ) {
|
||||
List<SocketDownData.CloudRoadDataProto> newList = new ArrayList<>();
|
||||
for (SocketDownData.CloudRoadDataProto cloudRoadData : data) {
|
||||
if (cloudRoadData.getFromType() != SocketDownDataHelper.FROM_MY_LOCATION) {
|
||||
continue;
|
||||
}
|
||||
newList.add( cloudRoadData );
|
||||
newList.add(cloudRoadData);
|
||||
}
|
||||
data.clear();
|
||||
data.addAll( newList );
|
||||
data.addAll(newList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定点击事件
|
||||
*/
|
||||
public void bindClickListener( IMogoMarker marker ) {
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
public void bindClickListener(IMogoMarker marker) {
|
||||
if (marker == null || marker.isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
marker.setOnMarkerClickListener( this );
|
||||
marker.setOnMarkerClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -354,45 +353,45 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
* @param data 道路数据
|
||||
* @return {@link IMogoMarker}
|
||||
*/
|
||||
public IMogoMarker drawSnapshotDataMarker( CloudRoadData data ) {
|
||||
if ( data == null ) {
|
||||
public IMogoMarker drawSnapshotDataMarker(SocketDownData.CloudRoadDataProto data) {
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( DataTypes.TYPE_MARKER_CLOUD_DATA )
|
||||
.anchor( 0.5f, 0.5f )
|
||||
.rotate( ( float ) data.getHeading() )
|
||||
.object( data )
|
||||
.gps( true )
|
||||
.controlAngle( true )
|
||||
.position( new MogoLatLng( data.getWgslat(), data.getWgslon() ) );
|
||||
.owner(DataTypes.TYPE_MARKER_CLOUD_DATA)
|
||||
.anchor(0.5f, 0.5f)
|
||||
.rotate((float) data.getHeading())
|
||||
.object(data)
|
||||
.gps(true)
|
||||
.controlAngle(true)
|
||||
.position(new MogoLatLng(data.getWgslat(), data.getWgslon()));
|
||||
String resIdVal;
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
options.set3DMode( true );
|
||||
options.anchorColor( getModelRenderColor( data.getType(), data.getSpeed(), data.getWgslon(), data.getWgslat(), data.getHeading() ) );
|
||||
int resId = getModelRes( data.getType() );
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
options.set3DMode(true);
|
||||
options.anchorColor(getModelRenderColor(data.getType(), data.getSpeed(), data.getWgslon(), data.getWgslat(), data.getHeading()));
|
||||
int resId = getModelRes(data.getType());
|
||||
resIdVal = resId + "";
|
||||
options.resName( mMarkerCachesResMd5Values.get( resIdVal ) );
|
||||
options.icon3DRes( resId );
|
||||
options.resName(mMarkerCachesResMd5Values.get(resIdVal));
|
||||
options.icon3DRes(resId);
|
||||
} else {
|
||||
options.set3DMode( false );
|
||||
View view = inflateView( data );
|
||||
options.icon( view );
|
||||
options.set3DMode(false);
|
||||
View view = inflateView(data);
|
||||
options.icon(view);
|
||||
resIdVal = view.getId() + "";
|
||||
}
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).addMarker( DataTypes.TYPE_MARKER_CLOUD_DATA, options );
|
||||
cacheMarkerIconResMd5Val( resIdVal, marker );
|
||||
IMogoMarker marker = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager(mContext).addMarker(DataTypes.TYPE_MARKER_CLOUD_DATA, options);
|
||||
cacheMarkerIconResMd5Val(resIdVal, marker);
|
||||
|
||||
if ( !TextUtils.isEmpty( data.getSn() ) ) {
|
||||
bindClickListener( marker );
|
||||
if (!TextUtils.isEmpty(data.getSn())) {
|
||||
bindClickListener(marker);
|
||||
}
|
||||
|
||||
return marker;
|
||||
}
|
||||
|
||||
public String get3DCacheId( String resIdVal ) {
|
||||
return mMarkerCachesResMd5Values.get( resIdVal );
|
||||
public String get3DCacheId(String resIdVal) {
|
||||
return mMarkerCachesResMd5Values.get(resIdVal);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,12 +400,12 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
* @param data 道路数据
|
||||
* @return marker
|
||||
*/
|
||||
public View inflateView( CloudRoadData data ) {
|
||||
View rootView = LayoutInflater.from( AbsMogoApplication.getApp() ).inflate( R.layout.module_commons_layout_car, null );
|
||||
ImageView iv = rootView.findViewById( R.id.module_commons_marker_car_model );
|
||||
int viewIdLike = get2DModel( data );
|
||||
iv.setImageResource( viewIdLike );
|
||||
rootView.setId( viewIdLike );
|
||||
public View inflateView(SocketDownData.CloudRoadDataProto data) {
|
||||
View rootView = LayoutInflater.from(AbsMogoApplication.getApp()).inflate(R.layout.module_commons_layout_car, null);
|
||||
ImageView iv = rootView.findViewById(R.id.module_commons_marker_car_model);
|
||||
int viewIdLike = get2DModel(data);
|
||||
iv.setImageResource(viewIdLike);
|
||||
rootView.setId(viewIdLike);
|
||||
return rootView;
|
||||
}
|
||||
|
||||
@@ -416,21 +415,21 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
* @param data 道路数据
|
||||
* @return 2D贴图id
|
||||
*/
|
||||
private int get2DModel( CloudRoadData data ) {
|
||||
switch ( data.getFromType() ) {
|
||||
case CloudRoadData.FROM_ADAS:
|
||||
case CloudRoadData.FROM_ROAD_UNIT:
|
||||
case CloudRoadData.FROM_MY_LOCATION:
|
||||
private int get2DModel(SocketDownData.CloudRoadDataProto data) {
|
||||
switch (data.getFromType()) {
|
||||
case SocketDownDataHelper.FROM_ADAS:
|
||||
case SocketDownDataHelper.FROM_ROAD_UNIT:
|
||||
case SocketDownDataHelper.FROM_MY_LOCATION:
|
||||
default:
|
||||
return R.drawable.icon_map_marker_car_gray;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMarkerClicked( IMogoMarker marker ) {
|
||||
if ( marker != null && !marker.isDestroyed() ) {
|
||||
if ( marker.getObject() instanceof CloudRoadData ) {
|
||||
showCarCallPanel( ( ( CloudRoadData ) marker.getObject() ) );
|
||||
public boolean onMarkerClicked(IMogoMarker marker) {
|
||||
if (marker != null && !marker.isDestroyed()) {
|
||||
if (marker.getObject() instanceof SocketDownData.CloudRoadDataProto) {
|
||||
showCarCallPanel(((SocketDownData.CloudRoadDataProto) marker.getObject()));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -441,46 +440,46 @@ public class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClic
|
||||
*
|
||||
* @param data 道路数据
|
||||
*/
|
||||
private void showCarCallPanel( CloudRoadData data ) {
|
||||
private void showCarCallPanel(SocketDownData.CloudRoadDataProto data) {
|
||||
|
||||
MogoDriverInfo driverInfo = new MogoDriverInfo();
|
||||
driverInfo.setLat( data.getLat() );
|
||||
driverInfo.setLon( data.getLon() );
|
||||
driverInfo.setSn( data.getSn() );
|
||||
driverInfo.setLat(data.getLat());
|
||||
driverInfo.setLon(data.getLon());
|
||||
driverInfo.setSn(data.getSn());
|
||||
ICarsChattingProvider carChatting = CallChatApi.getInstance().getApiProvider();
|
||||
|
||||
if ( carChatting != null ) {
|
||||
if (carChatting != null) {
|
||||
try {
|
||||
carChatting.showUserWindow( TAG, driverInfo, mContext );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e( TAG, e, "showCarCallPanel" );
|
||||
carChatting.showUserWindow(TAG, driverInfo, mContext);
|
||||
} catch (Exception e) {
|
||||
Logger.e(TAG, e, "showCarCallPanel");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void changeIconResourceIfNecessary( CloudRoadData cloudRoadData, IMogoMarker marker ) {
|
||||
if ( isChangeCarModeStatus() ) {
|
||||
setChangeCarModeStatus( false );
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
marker.getMogoMarkerOptions().set3DMode( true );
|
||||
int resId = getModelRes( cloudRoadData.getType() );
|
||||
String resName = get3DCacheId( resId + "" );
|
||||
if ( TextUtils.isEmpty( resName ) ) {
|
||||
marker.use3DResource( resId );
|
||||
cacheMarkerIconResMd5Val( resId + "", marker );
|
||||
public void changeIconResourceIfNecessary(SocketDownData.CloudRoadDataProto cloudRoadData, IMogoMarker marker) {
|
||||
if (isChangeCarModeStatus()) {
|
||||
setChangeCarModeStatus(false);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
marker.getMogoMarkerOptions().set3DMode(true);
|
||||
int resId = getModelRes(cloudRoadData.getType());
|
||||
String resName = get3DCacheId(resId + "");
|
||||
if (TextUtils.isEmpty(resName)) {
|
||||
marker.use3DResource(resId);
|
||||
cacheMarkerIconResMd5Val(resId + "", marker);
|
||||
} else {
|
||||
marker.use3DResource( resName );
|
||||
marker.use3DResource(resName);
|
||||
}
|
||||
} else {
|
||||
marker.getMogoMarkerOptions().set3DMode( false );
|
||||
View view = inflateView( cloudRoadData );
|
||||
marker.getMogoMarkerOptions().set3DMode(false);
|
||||
View view = inflateView(cloudRoadData);
|
||||
int resId = view.getId();
|
||||
String resName = get3DCacheId( resId + "" );
|
||||
if ( TextUtils.isEmpty( resName ) ) {
|
||||
marker.setIcon( ViewUtils.fromView( view ) );
|
||||
cacheMarkerIconResMd5Val( resId + "", marker );
|
||||
String resName = get3DCacheId(resId + "");
|
||||
if (TextUtils.isEmpty(resName)) {
|
||||
marker.setIcon(ViewUtils.fromView(view));
|
||||
cacheMarkerIconResMd5Val(resId + "", marker);
|
||||
} else {
|
||||
marker.use2DResource( resName );
|
||||
marker.use2DResource(resName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.module.common.uploadintime;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -6,18 +6,18 @@ import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.live.impl.AbsCameraScenario;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.service.windowview.IMogoTopViewStatusListener;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* 路边摄像头直播控制 V2XPushLiveCarScenario
|
||||
*/
|
||||
public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implements IMogoTopViewStatusListener {
|
||||
public class CameraLiveManager extends AbsCameraScenario<SocketDownData.CloudRoadDataProto> implements IMogoTopViewStatusListener {
|
||||
private static final String TAG = "CameraLiveManager";
|
||||
private static CameraLiveManager mCameraLiveManager;
|
||||
private boolean isShowWindow;
|
||||
@@ -38,7 +38,7 @@ public class CameraLiveManager extends AbsCameraScenario<CloudRoadData> implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(@Nullable CloudRoadData cloudRoadData) {
|
||||
public void init(@Nullable SocketDownData.CloudRoadDataProto cloudRoadData) {
|
||||
Log.d(TAG, "CameraLiveManager init -----> isShowWindow = " + isShowWindow);
|
||||
if (isShowWindow) {
|
||||
close();
|
||||
|
||||
@@ -9,10 +9,10 @@ import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.live.impl.ICameraWindow;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.service.imageloader.MogoImageView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.mogo.utils.logger.Logger;
|
||||
* 点击摄像头 marker
|
||||
* vr路边摄像头弹窗 V2XPushLiveCarWindow
|
||||
*/
|
||||
public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindow<CloudRoadData> {
|
||||
public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindow<SocketDownData.CloudRoadDataProto> {
|
||||
private static final String TAG = "PushCameraLiveWindow";
|
||||
private CameraLiveGSYVideoView mLiveGSYVideoView;
|
||||
private MogoImageView mIvReportHead;
|
||||
@@ -65,7 +65,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
* 展示直播Windows
|
||||
*/
|
||||
@Override
|
||||
public void show(CloudRoadData entity) {
|
||||
public void show(SocketDownData.CloudRoadDataProto entity) {
|
||||
if (entity != null) {
|
||||
Logger.w(TAG, "更新直播信息 show entity = " + entity);
|
||||
if (!TextUtils.isEmpty(entity.getRtmpUrl())) {
|
||||
@@ -76,7 +76,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
mLiveGSYVideoView.startLive(entity.getRtmpUrl());
|
||||
}
|
||||
|
||||
countDownV2XEvent(entity);
|
||||
countDownV2XEvent();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class PushCameraLiveWindow extends RelativeLayout implements ICameraWindo
|
||||
/**
|
||||
* 窗体倒计时
|
||||
*/
|
||||
public void countDownV2XEvent(CloudRoadData data) {
|
||||
public void countDownV2XEvent() {
|
||||
// 倒计时
|
||||
if (runnableV2XEvent == null) {
|
||||
runnableV2XEvent = () -> {
|
||||
|
||||
@@ -2,15 +2,15 @@ package com.mogo.module.extensions.live.impl;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
|
||||
|
||||
public abstract class AbsCameraScenario<T> implements ICameraScenario {
|
||||
protected String TAG = "AbsCameraScenario";
|
||||
private ICameraWindow mV2XWindow;
|
||||
private CloudRoadData mCloudRoadData;
|
||||
private SocketDownData.CloudRoadDataProto mCloudRoadData;
|
||||
|
||||
public abstract void init(@Nullable CloudRoadData cloudRoadData);
|
||||
public abstract void init(@Nullable SocketDownData.CloudRoadDataProto cloudRoadData);
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
@@ -27,11 +27,11 @@ public abstract class AbsCameraScenario<T> implements ICameraScenario {
|
||||
this.mV2XWindow = mV2XWindow;
|
||||
}
|
||||
|
||||
public CloudRoadData getmCloudRoadData() {
|
||||
public SocketDownData.CloudRoadDataProto getmCloudRoadData() {
|
||||
return mCloudRoadData;
|
||||
}
|
||||
|
||||
public void setmCloudRoadData(CloudRoadData mCloudRoadData) {
|
||||
public void setmCloudRoadData(SocketDownData.CloudRoadDataProto mCloudRoadData) {
|
||||
this.mCloudRoadData = mCloudRoadData;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,11 @@ import android.content.IntentFilter;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.map.location.IMogoLocationListener;
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.extensions.navi.VrModeNavInfoView;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.adas.MogoADASWarnType;
|
||||
@@ -41,7 +40,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
private static final long STRATEGY_DELAY = 1000L;
|
||||
|
||||
private Context context;
|
||||
private AdasNoticeReceiver adasReceiver = new AdasNoticeReceiver();
|
||||
private final AdasNoticeReceiver adasReceiver = new AdasNoticeReceiver();
|
||||
|
||||
private volatile boolean isVrMode = false;
|
||||
|
||||
@@ -203,7 +202,8 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData obj) {
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.graphics.BitmapFactory;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
@@ -16,8 +17,6 @@ import com.mogo.module.extensions.live.CameraLiveManager;
|
||||
import com.mogo.module.extensions.live.CameraWindow3DAdapter;
|
||||
import com.mogo.module.extensions.live.PushDataType;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -30,7 +29,7 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
private static final String TAG = "CameraLiveNoticeHelper";
|
||||
private Context mContext;
|
||||
private static IMogoMarker mMogoMarker;
|
||||
private CloudRoadData mCloudRoadData;
|
||||
private SocketDownData.CloudRoadDataProto mCloudRoadData;
|
||||
private volatile boolean isVrMode;
|
||||
private volatile boolean isVrModeMarker;
|
||||
private volatile String mCurrentUuid;
|
||||
@@ -81,7 +80,7 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
*
|
||||
* @param roadData 道路数据
|
||||
*/
|
||||
private void addVrCameraMarker(CloudRoadData roadData) {
|
||||
private void addVrCameraMarker(SocketDownData.CloudRoadDataProto roadData) {
|
||||
Log.e(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
@@ -108,7 +107,7 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
*
|
||||
* @param roadData 道路数据
|
||||
*/
|
||||
private void addNormalCameraMarker(CloudRoadData roadData) {
|
||||
private void addNormalCameraMarker(SocketDownData.CloudRoadDataProto roadData) {
|
||||
Log.e(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
@@ -137,7 +136,7 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void renderMarker(MogoSnapshotSetData obj) {
|
||||
private void renderMarker(SocketDownData.LauncherSnapshotProto obj) {
|
||||
if (obj != null) {
|
||||
if (obj.getCamera() != null && !TextUtils.isEmpty(obj.getCamera().getRtmpUrl())) {
|
||||
mCloudRoadData = obj.getCamera();
|
||||
@@ -189,8 +188,8 @@ public class CameraLiveNoticeHelper implements IMogoCloudOnMsgListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
//Logger.d(TAG, "onMsgReceived mogoSnapshotSetData : " + mogoSnapshotSetData);
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
renderMarker(mogoSnapshotSetData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
implementation rootProject.ext.dependencies.callchatprovider
|
||||
implementation rootProject.ext.dependencies.androidxrecyclerview
|
||||
annotationProcessor 'com.elegant.spi:compiler:1.0.3'
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
api rootProject.ext.dependencies.mogomap
|
||||
|
||||
@@ -101,7 +101,7 @@ public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
MarkerServiceHandler.init( context );
|
||||
// if ( DebugConfig.isNeedUploadCoordinatesDurationInTime() ) {
|
||||
// }
|
||||
MogoRTKLocation.getInstance().init();
|
||||
// MogoRTKLocation.getInstance().init(); //todo RTK LOCATION Close
|
||||
MogoServices.getInstance().preInit( context );
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.cloud.socket.entity.SocketDownDataHelper;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
@@ -36,11 +38,9 @@ import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.status.EnvStatusManager;
|
||||
import com.mogo.module.service.timedelay.TimeDelayUploadManager;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.service.adas.RemoteControlAutoPilotParameters;
|
||||
import com.mogo.service.adas.entity.ADASCarStateInfo;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.entrance.ButtonIndex;
|
||||
import com.mogo.utils.TipToast;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -543,8 +543,8 @@ public class MockIntentHandler implements IntentHandler {
|
||||
.openVrMode(false);
|
||||
break;
|
||||
case 46:// 模拟 自车周边数据
|
||||
String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(GsonUtil.objectFromJson(json, MogoSnapshotSetData.class));
|
||||
// String json = "{\"allList\":[{\"type\":3,\"uuid\":\"10009-5152\",\"lat\":40.1990809296,\"lon\":116.7393252195,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0},{\"type\":3,\"uuid\":\"10009-5161\",\"lat\":40.1990827227,\"lon\":116.739325826,\"speed\":0.0,\"heading\":0.0,\"systemTime\":1614329151909,\"vehicleType\":0,\"distance\":576.0,\"fromType\":3,\"isOnline\":0}],\"nearList\":[],\"time\":1614329152238}";
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(GsonUtil.objectFromJson(json, MogoSnapshotSetData.class)); //todo 需要重新模拟一个test数据
|
||||
break;
|
||||
case 47:// 模拟鹰眼模式下绘制车辆周边的数据
|
||||
mTimeTickHandler.sendEmptyMessageDelayed(1, 0L);
|
||||
@@ -647,18 +647,22 @@ public class MockIntentHandler implements IntentHandler {
|
||||
*/
|
||||
private void handleRoadSideMockDataIntent() throws Exception {
|
||||
if (roadSizeBr == null) {
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt")));
|
||||
roadSizeBr = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("roadSide.txt"))); //todo 需要重新模拟一个test数据
|
||||
}
|
||||
String carsLine = roadSizeBr.readLine();
|
||||
MogoSnapshotSetData data = new MogoSnapshotSetData();
|
||||
List<CloudRoadData> allList = GsonUtil.arrayFromJson(carsLine, CloudRoadData.class);
|
||||
for (CloudRoadData cloudRoadData : allList) {
|
||||
cloudRoadData.setWgslat(cloudRoadData.getLat());
|
||||
cloudRoadData.setWgslon(cloudRoadData.getLon());
|
||||
cloudRoadData.setFromType(CloudRoadData.FROM_ROAD_UNIT);
|
||||
SocketDownData.LauncherSnapshotProto.Builder data = SocketDownData.LauncherSnapshotProto.newBuilder();
|
||||
List<SocketDownData.CloudRoadDataProto> allList = GsonUtil.arrayFromJson(carsLine, SocketDownData.CloudRoadDataProto.class);
|
||||
if(allList == null || allList.size() == 0){
|
||||
return;
|
||||
}
|
||||
data.setAllList(allList);
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data);
|
||||
for (SocketDownData.CloudRoadDataProto cloudRoadData : allList) {
|
||||
cloudRoadData.toBuilder()
|
||||
.setWgslat(cloudRoadData.getLon())
|
||||
.setWgslon(cloudRoadData.getLon())
|
||||
.setFromType(SocketDownDataHelper.FROM_ROAD_UNIT);
|
||||
}
|
||||
data.addAllAllList(allList);
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data.build());
|
||||
mLocationMockHandler.sendEmptyMessageDelayed(101, 100L);
|
||||
}
|
||||
|
||||
@@ -861,29 +865,30 @@ public class MockIntentHandler implements IntentHandler {
|
||||
* 模拟快照意图
|
||||
*/
|
||||
private boolean handleMockSnapshotIntent2() throws Exception {
|
||||
if (br4 == null) {
|
||||
br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt")));
|
||||
}
|
||||
String line = br4.readLine();
|
||||
if (line == null) {
|
||||
throw new Exception("end of file 2.");
|
||||
}
|
||||
MogoSnapshotSetData data = new MogoSnapshotSetData();
|
||||
List<CloudRoadData> allList = new ArrayList<>();
|
||||
CloudRoadData cloudRoadData = GsonUtil.objectFromJson(line, CloudRoadData.class);
|
||||
if (cloudRoadData == null) {
|
||||
return false;
|
||||
}
|
||||
cloudRoadData.setWgslon(cloudRoadData.getLon());
|
||||
cloudRoadData.setWgslat(cloudRoadData.getLat());
|
||||
cloudRoadData.setUuid("1_21");
|
||||
allList.add(cloudRoadData);
|
||||
data.setAllList(allList);
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(data);
|
||||
Log.i("mock-timer-snapshot", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
// mLocationMockHandler.sendEmptyMessageDelayed( 21, 100L );
|
||||
// if (br4 == null) {
|
||||
// br4 = new BufferedReader(new InputStreamReader(AbsMogoApplication.getApp().getAssets().open("snapshot.txt"))); todo 需要重新模拟一个test数据
|
||||
// }
|
||||
// String line = br4.readLine();
|
||||
// if (line == null) {
|
||||
// throw new Exception("end of file 2.");
|
||||
// }
|
||||
// SocketDownData.LauncherSnapshotProto.Builder data = SocketDownData.LauncherSnapshotProto.newBuilder();
|
||||
// List<SocketDownData.CloudRoadDataProto> allList = new ArrayList<>();
|
||||
// SocketDownData.CloudRoadDataProto cloudRoadData = GsonUtil.objectFromJson(line, SocketDownData.CloudRoadDataProto.class);
|
||||
// if (cloudRoadData == null) {
|
||||
// return false;
|
||||
// }
|
||||
// SocketDownData.CloudRoadDataProto.Builder builder = cloudRoadData.toBuilder();
|
||||
// builder.setWgslat(cloudRoadData.getLon());
|
||||
// builder.setWgslon(cloudRoadData.getLat());
|
||||
// builder.setUuid("1_21");
|
||||
// allList.add(cloudRoadData);
|
||||
// data.addAllAllList(allList);
|
||||
//
|
||||
// final long start = System.currentTimeMillis();
|
||||
// SnapshotSetDataDrawer.getInstance().renderSnapshotData(data.build());
|
||||
// Log.i("mock-timer-snapshot", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
//// mLocationMockHandler.sendEmptyMessageDelayed( 21, 100L );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.os.Bundle;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
public class MogoRTKLocation {
|
||||
|
||||
@@ -5,15 +5,14 @@ import android.graphics.Rect;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.IMogoMarkerClickListener;
|
||||
import com.mogo.map.marker.IMogoMarkerManager;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
@@ -31,16 +30,12 @@ import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.module.common.utils.CloudPoiManager;
|
||||
import com.mogo.module.common.utils.Trigonometric;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.network.RefreshCallback;
|
||||
import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.module.service.polyline.LimberCollisionPolyline;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.module.IMogoBizActionDoneListener;
|
||||
@@ -57,7 +52,6 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -147,7 +141,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
DebugConfig.setStatus(DebugConfig.sDownloadSnapshot, true);
|
||||
Message msg = mSnapshotHandler.obtainMessage();
|
||||
msg.obj = mogoSnapshotSetData;
|
||||
@@ -168,7 +162,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
//// 绘制碰撞的他车指引线,需要实时给数据更新 TODO
|
||||
// drawLimberCollisionPolyline(result);
|
||||
// //通过这个传值到 AMapViewWrapper,根据数据更新自车的模型数据
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result);
|
||||
// MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().setAdasRecognizedResult(result); todo setAdasRecognizedResult 需要拆分细粒度
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -176,39 +170,39 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 实时绘制连线
|
||||
*
|
||||
* @param result
|
||||
*/
|
||||
private void drawLimberCollisionPolyline(ADASRecognizedResult result) {
|
||||
if (result != null) {
|
||||
IMogoPolyline polyLine = LimberCollisionPolyline.getInstance().getPolyLine();
|
||||
MogoLatLng startLatLng = new MogoLatLng(result.lat, result.lon);
|
||||
MogoLatLng endLatlng = Trigonometric.getNewLocation(startLatLng, 20, result.heading);
|
||||
Log.d(TAG, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat
|
||||
+ "终点" + endLatlng.lon + "," + endLatlng.lat + "--heading =" + result.heading);
|
||||
if (polyLine != null) {
|
||||
Log.d(TAG, "drawStopLine polyLine != null");
|
||||
polyLine.setPoints(Arrays.asList(startLatLng, endLatlng));
|
||||
} else {
|
||||
List<MogoLatLng> latLngs = new ArrayList<>();
|
||||
latLngs.add(startLatLng);
|
||||
latLngs.add(endLatlng);
|
||||
LimberCollisionPolyline.getInstance().draw((float) result.roadWidth, latLngs);
|
||||
}
|
||||
} else {
|
||||
LimberCollisionPolyline.getInstance().clearLine();
|
||||
}
|
||||
}
|
||||
// /**
|
||||
// * 实时绘制连线
|
||||
// *
|
||||
// * @param result
|
||||
// */
|
||||
// private void drawLimberCollisionPolyline(ADASRecognizedResult result) {
|
||||
// if (result != null) {
|
||||
// IMogoPolyline polyLine = LimberCollisionPolyline.getInstance().getPolyLine();
|
||||
// MogoLatLng startLatLng = new MogoLatLng(result.lat, result.lon);
|
||||
// MogoLatLng endLatlng = Trigonometric.getNewLocation(startLatLng, 20, result.heading);
|
||||
// Log.d(TAG, "红色区域起始点 = " + startLatLng.lon + "," + startLatLng.lat
|
||||
// + "终点" + endLatlng.lon + "," + endLatlng.lat + "--heading =" + result.heading);
|
||||
// if (polyLine != null) {
|
||||
// Log.d(TAG, "drawStopLine polyLine != null");
|
||||
// polyLine.setPoints(Arrays.asList(startLatLng, endLatlng));
|
||||
// } else {
|
||||
// List<MogoLatLng> latLngs = new ArrayList<>();
|
||||
// latLngs.add(startLatLng);
|
||||
// latLngs.add(endLatlng);
|
||||
// LimberCollisionPolyline.getInstance().draw((float) result.roadWidth, latLngs);
|
||||
// }
|
||||
// } else {
|
||||
// LimberCollisionPolyline.getInstance().clearLine();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
private final Handler mSnapshotHandler = new Handler(WorkThreadHandler.newInstance("snapshot-thread").getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.obj instanceof MogoSnapshotSetData) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(((MogoSnapshotSetData) msg.obj));
|
||||
if (msg.obj instanceof SocketDownData.LauncherSnapshotProto) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(((SocketDownData.LauncherSnapshotProto) msg.obj));
|
||||
} else if (msg.obj == null) {
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData(null);
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.mogo.module.service.spi;
|
||||
|
||||
import com.elegant.spi.annotations.Service;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.realtime.api.IRealTimeProvider;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service(value = IRealTimeProvider.class)
|
||||
public class SPIRealTimeUpload implements IRealTimeProvider {
|
||||
|
||||
@Override
|
||||
public List<ADASRecognizedResult> getLastADASRecognizedResult() {
|
||||
return MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CloudLocationInfo> getLocationMsg() {
|
||||
return SnapshotLocationController.getInstance().getSendLocationData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLocationAccuracy() {
|
||||
return SnapshotLocationController.getInstance().getDataAccuracy();
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.os.Message;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData;
|
||||
import com.mogo.commons.data.BaseData;
|
||||
import com.mogo.commons.network.SubscribeImpl;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
@@ -15,8 +16,6 @@ import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.network.TimeDelayApiService;
|
||||
import com.mogo.module.service.network.bean.MockSocketReceiverData;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
import com.mogo.realtime.socket.IMogoCloudOnMsgListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
@@ -136,10 +135,10 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
//接收实时数据监听回调,用于给服务端上报时延
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void onMsgReceived(MogoSnapshotSetData mogoSnapshotSetData) {
|
||||
public void onMsgReceived(SocketDownData.LauncherSnapshotProto mogoSnapshotSetData) {
|
||||
if (isMockData) {
|
||||
//接口数据上报
|
||||
CloudRoadData result = mogoSnapshotSetData.getAllList()
|
||||
SocketDownData.CloudRoadDataProto result = mogoSnapshotSetData.getAllListList()
|
||||
.stream()
|
||||
.filter(cloudRoadData -> cloudRoadData.getUuid().contains("serialNumber_"))
|
||||
.findAny()
|
||||
@@ -168,4 +167,5 @@ public class TimeDelayUploadManager implements IMogoOnMessageListener<MockSocket
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.module.service.utils;
|
||||
import android.location.Location;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
|
||||
/**
|
||||
* 定位数据类型转换工具
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.os.SystemClock;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.service.locationinfo.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -4,9 +4,7 @@ import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.overlay.IMogoPolyline;
|
||||
import com.mogo.module.common.entity.V2XRoadEventEntity;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
|
||||
/**
|
||||
* 绘制可变宽度和渐变的线
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.v2x.entity.model.DrawLineInfo;
|
||||
import com.mogo.module.v2x.manager.IMoGoWarnPolylineManager;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -6,10 +6,6 @@ import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XWaringManager;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
/**
|
||||
* 单车预警,车辆盲区预警,弱势交通参与者预警
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.service.adas;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -113,7 +113,7 @@ public interface IMogoADASController extends IProvider {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List< ADASRecognizedResult > getLastADASRecognizedResult();
|
||||
List<ADASRecognizedResult> getLastADASRecognizedResult();
|
||||
|
||||
/**
|
||||
* 添加adas识别物体回调
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.service.adas;
|
||||
|
||||
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,5 +16,5 @@ public interface IMogoAdasRecognizedDataCallback {
|
||||
*
|
||||
* @param resultList 具体识别的物体数据
|
||||
*/
|
||||
void onAdasDataCallback( List<ADASRecognizedResult> resultList );
|
||||
void onAdasDataCallback(List<ADASRecognizedResult> resultList);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.mogo.service.adas.entity;
|
||||
|
||||
/*
|
||||
* adas 识别物体参数
|
||||
*/
|
||||
public class ADASRecognizedResult {
|
||||
|
||||
/**
|
||||
* 识别物体类型
|
||||
*/
|
||||
public int type;
|
||||
|
||||
/**
|
||||
* 识别物体唯一标识
|
||||
*/
|
||||
public String uuid;
|
||||
|
||||
/**
|
||||
* 红绿灯颜色
|
||||
*/
|
||||
public String color;
|
||||
|
||||
/**
|
||||
* 车ID
|
||||
*/
|
||||
public String carId;
|
||||
|
||||
/**
|
||||
* 识别物体的纬度
|
||||
*/
|
||||
public double lat;
|
||||
|
||||
/**
|
||||
* 识别物体的经度
|
||||
*/
|
||||
public double lon;
|
||||
|
||||
/**
|
||||
* 车头朝向
|
||||
*/
|
||||
public double heading;
|
||||
|
||||
/**
|
||||
* 系统时间
|
||||
*/
|
||||
public long systemTime;
|
||||
|
||||
/**
|
||||
* 定位卫星时间
|
||||
*/
|
||||
public long satelliteTime;
|
||||
|
||||
/**
|
||||
* 海拔
|
||||
*/
|
||||
public double alt;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
public double speed;
|
||||
|
||||
/**
|
||||
* 莫顿码
|
||||
*/
|
||||
public long mortonCode;
|
||||
|
||||
/**
|
||||
* 实际距离
|
||||
* 使用distanceX和distanceY计算
|
||||
*/
|
||||
public double distance;
|
||||
|
||||
/**
|
||||
* 数据来源精度
|
||||
* 0:普通定位
|
||||
* 1:高精定位
|
||||
*/
|
||||
public int dataAccuracy;
|
||||
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
public String roadId;
|
||||
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
public String laneId;
|
||||
|
||||
/**
|
||||
* 车道号:中心线编号为0,中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
public int laneNum;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
public double rateLimiting;
|
||||
|
||||
/**
|
||||
* 瓦片id
|
||||
*/
|
||||
public String tileId;
|
||||
|
||||
/**
|
||||
* 车道宽度
|
||||
*/
|
||||
public double roadWidth;
|
||||
|
||||
/**
|
||||
* 1 绿, 2 黄, 3 红
|
||||
*/
|
||||
public int drawlevel;
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.service.connection;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.cloud.socket.entity.MsgBody;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -50,5 +51,5 @@ public interface IMogoSocketManager extends IProvider {
|
||||
* @param body 消息体
|
||||
* @param listener 回执监听
|
||||
*/
|
||||
void sendMsg( MsgBody body, IMogoMsgAckListener listener );
|
||||
void sendMsg(MsgBody body, IMogoMsgAckListener listener );
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.mogo.service.connection;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-31
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class MsgBody {
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private int mMsgType;
|
||||
|
||||
// /**
|
||||
// * 服务端分发,业务线
|
||||
// */
|
||||
// private int mProductLine = MogoCommon.Product.mogoBussiness_VALUE;
|
||||
//
|
||||
// /**
|
||||
// *
|
||||
// */
|
||||
// private int mHeaderType = MogoConnsvr.MsgType.mogoMsgTypeDispatchSvrNoRspReq_VALUE;
|
||||
|
||||
/**
|
||||
* 是否回执
|
||||
*/
|
||||
private boolean mAck = false;
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
private final long mMsgId = System.currentTimeMillis();
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private byte[] mContent;
|
||||
|
||||
public MsgBody msgType( int msgType ) {
|
||||
this.mMsgType = msgType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MsgBody ack( boolean ack ) {
|
||||
this.mAck = ack;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MsgBody content( byte[] object ) {
|
||||
this.mContent = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getMsgType() {
|
||||
return mMsgType;
|
||||
}
|
||||
|
||||
public boolean isAck() {
|
||||
return mAck;
|
||||
}
|
||||
|
||||
public long getMsgId() {
|
||||
return mMsgId;
|
||||
}
|
||||
|
||||
public byte[] getContent() {
|
||||
return mContent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
package com.mogo.service.locationinfo;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 自车定位信息
|
||||
*/
|
||||
public class CloudLocationInfo implements Parcelable {
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private double lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private double lon;
|
||||
|
||||
/**
|
||||
* 车头方向
|
||||
*/
|
||||
private double heading;
|
||||
|
||||
/**
|
||||
* 系统时间
|
||||
*/
|
||||
private long systemTime;
|
||||
|
||||
/**
|
||||
* 卫星时间
|
||||
*/
|
||||
private long satelliteTime;
|
||||
|
||||
/**
|
||||
* 海拔
|
||||
*/
|
||||
private double alt;
|
||||
|
||||
/**
|
||||
* 车速
|
||||
*/
|
||||
private double speed;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* 0:普通车辆、家用车
|
||||
*/
|
||||
private int vehicleType = 0;
|
||||
|
||||
/**
|
||||
* 道路ID
|
||||
*/
|
||||
private String roadId;
|
||||
|
||||
/**
|
||||
* 车道ID-2D路段
|
||||
*/
|
||||
private String laneId;
|
||||
|
||||
/**
|
||||
* 车道号:中心线编号为0,中心线右侧编号为负数,3车道通行Road的车道编号,0,-1,-2,-3
|
||||
*/
|
||||
private int laneNum;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
*/
|
||||
private double rateLimiting;
|
||||
|
||||
/**
|
||||
* 瓦片id
|
||||
*/
|
||||
private String tileId;
|
||||
|
||||
/**
|
||||
* 车道宽度
|
||||
*/
|
||||
private double roadWidth;
|
||||
|
||||
public CloudLocationInfo() {
|
||||
}
|
||||
|
||||
public CloudLocationInfo(CloudLocationInfo info) {
|
||||
this.lat = info.getLat();
|
||||
this.lon = info.getLon();
|
||||
this.heading = info.getHeading();
|
||||
this.systemTime = System.currentTimeMillis();
|
||||
this.satelliteTime = System.currentTimeMillis();
|
||||
this.alt = info.alt;
|
||||
this.speed = info.speed;
|
||||
this.vehicleType = info.vehicleType;
|
||||
this.roadId = info.roadId;
|
||||
this.laneId = info.laneId;
|
||||
this.laneNum = info.laneNum;
|
||||
this.rateLimiting = info.rateLimiting;
|
||||
this.tileId = info.tileId;
|
||||
this.roadWidth = info.roadWidth;
|
||||
}
|
||||
|
||||
protected CloudLocationInfo(Parcel in) {
|
||||
lat = in.readDouble();
|
||||
lon = in.readDouble();
|
||||
heading = in.readDouble();
|
||||
systemTime = in.readLong();
|
||||
satelliteTime = in.readLong();
|
||||
alt = in.readDouble();
|
||||
speed = in.readDouble();
|
||||
vehicleType = in.readInt();
|
||||
roadId = in.readString();
|
||||
laneId = in.readString();
|
||||
laneNum = in.readInt();
|
||||
rateLimiting = in.readDouble();
|
||||
tileId = in.readString();
|
||||
roadWidth = in.readDouble();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeDouble(lat);
|
||||
dest.writeDouble(lon);
|
||||
dest.writeDouble(heading);
|
||||
dest.writeLong(systemTime);
|
||||
dest.writeLong(satelliteTime);
|
||||
dest.writeDouble(alt);
|
||||
dest.writeDouble(speed);
|
||||
dest.writeInt(vehicleType);
|
||||
dest.writeString(roadId);
|
||||
dest.writeString(laneId);
|
||||
dest.writeInt(laneNum);
|
||||
dest.writeDouble(rateLimiting);
|
||||
dest.writeString(tileId);
|
||||
dest.writeDouble(roadWidth);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<CloudLocationInfo> CREATOR = new Creator<CloudLocationInfo>() {
|
||||
@Override
|
||||
public CloudLocationInfo createFromParcel(Parcel in) {
|
||||
return new CloudLocationInfo(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloudLocationInfo[] newArray(int size) {
|
||||
return new CloudLocationInfo[size];
|
||||
}
|
||||
};
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public double getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public void setHeading(double heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public long getSystemTime() {
|
||||
return systemTime;
|
||||
}
|
||||
|
||||
public void setSystemTime(long systemTime) {
|
||||
this.systemTime = systemTime;
|
||||
}
|
||||
|
||||
public long getSatelliteTime() {
|
||||
return satelliteTime;
|
||||
}
|
||||
|
||||
public void setSatelliteTime(long satelliteTime) {
|
||||
this.satelliteTime = satelliteTime;
|
||||
}
|
||||
|
||||
public double getAlt() {
|
||||
return alt;
|
||||
}
|
||||
|
||||
public void setAlt(double alt) {
|
||||
this.alt = alt;
|
||||
}
|
||||
|
||||
public double getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(double speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
public int getVehicleType() {
|
||||
return vehicleType;
|
||||
}
|
||||
|
||||
public void setVehicleType(int vehicleType) {
|
||||
this.vehicleType = vehicleType;
|
||||
}
|
||||
|
||||
public String getRoadId() {
|
||||
return roadId;
|
||||
}
|
||||
|
||||
public void setRoadId(String roadId) {
|
||||
this.roadId = roadId;
|
||||
}
|
||||
|
||||
public String getLaneId() {
|
||||
return laneId;
|
||||
}
|
||||
|
||||
public void setLaneId(String laneId) {
|
||||
this.laneId = laneId;
|
||||
}
|
||||
|
||||
public int getLaneNum() {
|
||||
return laneNum;
|
||||
}
|
||||
|
||||
public void setLaneNum(int laneNum) {
|
||||
this.laneNum = laneNum;
|
||||
}
|
||||
|
||||
public double getRateLimiting() {
|
||||
return rateLimiting;
|
||||
}
|
||||
|
||||
public void setRateLimiting(double rateLimiting) {
|
||||
this.rateLimiting = rateLimiting;
|
||||
}
|
||||
|
||||
public String getTileId() {
|
||||
return tileId;
|
||||
}
|
||||
|
||||
public void setTileId(String tileId) {
|
||||
this.tileId = tileId;
|
||||
}
|
||||
|
||||
public double getRoadWidth() {
|
||||
return roadWidth;
|
||||
}
|
||||
|
||||
public void setRoadWidth(double roadWidth) {
|
||||
this.roadWidth = roadWidth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CloudLocationInfo{" +
|
||||
"lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", heading=" + heading +
|
||||
", systemTime=" + systemTime +
|
||||
", satelliteTime=" + satelliteTime +
|
||||
", alt=" + alt +
|
||||
", speed=" + speed +
|
||||
", vehicleType=" + vehicleType +
|
||||
", roadId='" + roadId + '\'' +
|
||||
", laneId='" + laneId + '\'' +
|
||||
", laneNum=" + laneNum +
|
||||
", rateLimiting=" + rateLimiting +
|
||||
", tileId=" + tileId +
|
||||
", roadWidth=" + roadWidth +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String print() {
|
||||
return "CloudLocation{ lon: " + lon + " lat: " + lat + " heading: " + heading + " speed: "
|
||||
+ speed + " vehicleType: " + vehicleType + "}";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
CloudLocationInfo that = (CloudLocationInfo) o;
|
||||
return Double.compare(that.lat, lat) == 0 &&
|
||||
Double.compare(that.lon, lon) == 0;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(lat, lon);
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package com.mogo.service.impl.adas;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.utils.MortonCode;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
import com.mogo.service.adas.entity.ADASWarnMessage;
|
||||
import com.zhidao.autopilotservice.model.AdasAIDLOwnerCarRectModel;
|
||||
import com.zhidao.support.adas.high.bean.WarnMessageInfo;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,11 +3,11 @@ package com.mogo.service.impl.connection;
|
||||
import android.content.Context;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.cloud.socket.entity.MsgBody;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.connection.IMogoMsgAckListener;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoSocketManager;
|
||||
import com.mogo.service.connection.MsgBody;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -53,7 +53,7 @@ public class MogoSocketManager implements IMogoSocketManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMsg( MsgBody body, IMogoMsgAckListener listener ) {
|
||||
public void sendMsg(MsgBody body, IMogoMsgAckListener listener ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.sendMsg( body, listener );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user