优化显示逻辑
This commit is contained in:
@@ -34,6 +34,7 @@ import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.common.entity.MarkerResponse;
|
||||
import com.mogo.module.common.map.MapCenterPointStrategy;
|
||||
import com.mogo.module.common.map.Scene;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.service.autopilot.AutoPilotRemoteController;
|
||||
import com.mogo.module.service.handler.MainLooperHandler;
|
||||
import com.mogo.module.service.handler.RefreshWorkThreadHandler;
|
||||
@@ -47,7 +48,6 @@ import com.mogo.module.service.refresh.CustomRefreshStrategy;
|
||||
import com.mogo.module.service.refresh.RefreshObject;
|
||||
import com.mogo.module.service.strategy.CarIconDisplayStrategy;
|
||||
import com.mogo.module.service.ttsConfig.TtsConfigModleData;
|
||||
import com.mogo.module.service.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.api.MoGoAiCloudRealTime;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.adas.IMogoAdasCarDataCallback;
|
||||
@@ -945,7 +945,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, true );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" );
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "已开启鹰眼模式" );
|
||||
mLastStatusIsVr = true;
|
||||
}
|
||||
} else {
|
||||
@@ -954,7 +954,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已离开鹰眼模式" );
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "已退出鹰眼模式" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.module.service.carinfo.CarStateInfo;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.module.service.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
|
||||
|
||||
@@ -32,10 +32,10 @@ import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.module.common.dialog.WMDialog;
|
||||
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
|
||||
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.status.EnvStatusManager;
|
||||
import com.mogo.module.service.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudRoadData;
|
||||
import com.mogo.realtime.entity.MogoSnapshotSetData;
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.service.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.module.common.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/27
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class AdasRecognizedType {
|
||||
//背景
|
||||
public static final int classIdBackground = 0;
|
||||
//人
|
||||
public static final int classIdPerson = 1;
|
||||
//自行车
|
||||
public static final int classIdBicycle = 2;
|
||||
//小轿车
|
||||
public static final int classIdCar = 3;
|
||||
//摩托车
|
||||
public static final int classIdMoto = 4;
|
||||
//红绿灯
|
||||
public static final int classIdTrafficSign = 5;
|
||||
//bus
|
||||
public static final int classIdTrafficBus = 6;
|
||||
//track
|
||||
public static final int classIdTrafficTruck = 8;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
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.module.service.uploadintime.SnapshotLocationController;
|
||||
import com.mogo.realtime.api.IRealTimeProvider;
|
||||
import com.mogo.realtime.entity.ADASRecognizedResult;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.mogo.module.service.uploadintime;
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.realtime.entity.CloudLocationInfo;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 实时坐标
|
||||
*/
|
||||
class SnapshotLocationController {
|
||||
|
||||
private static final String TAG = "SnapshotLocationController";
|
||||
|
||||
private static volatile SnapshotLocationController sInstance;
|
||||
|
||||
private SnapshotLocationController() {
|
||||
}
|
||||
|
||||
public static SnapshotLocationController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SnapshotLocationController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new SnapshotLocationController();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private CloudLocationInfo mLastLocationInfo = null;
|
||||
|
||||
private List< CloudLocationInfo > mLocationList = new ArrayList<>();
|
||||
private int mDataAccuracy = 0;
|
||||
|
||||
/**
|
||||
* 同步从定位来的数据(也可能是rtk)
|
||||
*
|
||||
* @param cli
|
||||
*/
|
||||
public void syncLocationInfo( CloudLocationInfo cli ) {
|
||||
if ( cli == null ) {
|
||||
return;
|
||||
}
|
||||
mLastLocationInfo = cli;
|
||||
mLocationList.add( cli );
|
||||
}
|
||||
|
||||
// adda 工控机数据缓存
|
||||
private List< CloudLocationInfo > mMachineCacheList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 同步从工控机来的数据
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void syncAdasLocationInfo( JSONObject data ) {
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
DebugConfig.setStatus( DebugConfig.sLocation, true );
|
||||
Logger.d( TAG, "同步到rtk数据" );
|
||||
double lon = data.optDouble( "lon", -1 );
|
||||
double lat = data.optDouble( "lat", -1 );
|
||||
double alt = data.optDouble( "alt", -1 );
|
||||
double heading = data.optDouble( "heading", -1 );
|
||||
double acceleration = data.optDouble( "acceleration", -1 );
|
||||
double yawRate = data.optDouble( "yawRate", -1 );
|
||||
double speed = data.optDouble( "speed", -1 );
|
||||
long satelliteTime = data.optLong( "satelliteTime" );
|
||||
long systemTime = data.optLong( "systemTime" );
|
||||
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
cloudLocationInfo.setAlt( alt );
|
||||
cloudLocationInfo.setHeading( heading );
|
||||
cloudLocationInfo.setLat( lat );
|
||||
cloudLocationInfo.setLon( lon );
|
||||
cloudLocationInfo.setSpeed( speed );
|
||||
cloudLocationInfo.setSatelliteTime( satelliteTime );
|
||||
cloudLocationInfo.setSystemTime( systemTime );
|
||||
mLastLocationInfo = cloudLocationInfo;
|
||||
mMachineCacheList.add( cloudLocationInfo );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某一段时间内的坐标集合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List< CloudLocationInfo > getSendLocationData() {
|
||||
|
||||
List< CloudLocationInfo > list = null;
|
||||
if ( mMachineCacheList != null ) {
|
||||
mDataAccuracy = 1;
|
||||
list = new ArrayList<>( mMachineCacheList );
|
||||
mMachineCacheList.clear();
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
mDataAccuracy = 0;
|
||||
if ( mLocationList != null ) {
|
||||
list = new ArrayList<>( mLocationList );
|
||||
mLocationList.clear();
|
||||
}
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
if ( mLastLocationInfo != null ) {
|
||||
list = new ArrayList();
|
||||
list.add( mLastLocationInfo );
|
||||
mLastLocationInfo = null;
|
||||
}
|
||||
}
|
||||
Logger.d( TAG, "upload loc size = %s", list == null ? 0 : list.size() );
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据精度类型,目前按照数据来源标志
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getDataAccuracy() {
|
||||
Logger.d( TAG, "upload loc accuracy = %s", mDataAccuracy );
|
||||
return mDataAccuracy;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user