opt
This commit is contained in:
@@ -60,23 +60,26 @@ public class MogoRTKLocation {
|
||||
}
|
||||
|
||||
public interface RTKLocationListener {
|
||||
void onLocationChanged(List<CloudLocationInfo> cloudLocationInfos);
|
||||
void onLocationChanged(int dataAccuracy, List<CloudLocationInfo> cloudLocationInfos);
|
||||
}
|
||||
|
||||
private void sendLocationData() {
|
||||
|
||||
List<CloudLocationInfo> list = null;
|
||||
int dataAccuracy = 0;
|
||||
if ( DebugConfig.isUseAdasRtkLocationInfo() ) {
|
||||
dataAccuracy = 1;
|
||||
list = new ArrayList<>(SnapshotUploadInTime.getInstance().getSendLocationData());
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
dataAccuracy = 0;
|
||||
list = new ArrayList<>(cacheList);
|
||||
}
|
||||
if (cacheList != null && cacheList.size() > 0) {
|
||||
cacheList.clear();
|
||||
}
|
||||
if (rtkLocationListener != null) {
|
||||
rtkLocationListener.onLocationChanged(list);
|
||||
rtkLocationListener.onLocationChanged(dataAccuracy, list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged( List< CloudLocationInfo > cloudLocationInfos ) {
|
||||
startSendCarLocationAndAdasRecognizedResult2Server( cloudLocationInfos );
|
||||
public void onLocationChanged( int dataAccuracy, List< CloudLocationInfo > cloudLocationInfos ) {
|
||||
startSendCarLocationAndAdasRecognizedResult2Server( dataAccuracy, cloudLocationInfos );
|
||||
}
|
||||
|
||||
private CloudLocationInfo mLastInfo;
|
||||
|
||||
private void startSendCarLocationAndAdasRecognizedResult2Server( List< CloudLocationInfo > cloudLocationInfo ) {
|
||||
private void startSendCarLocationAndAdasRecognizedResult2Server( int dataAccuracy, List< CloudLocationInfo > cloudLocationInfo ) {
|
||||
CloudLocationInfo lastInfo = null;
|
||||
// 如果数组内容不为空,就用数组最后一个值
|
||||
if ( cloudLocationInfo != null && !cloudLocationInfo.isEmpty() ) {
|
||||
@@ -88,6 +88,7 @@ class SnapshotUploadInTime implements MogoRTKLocation.RTKLocationListener {
|
||||
// 定位点预测纠偏
|
||||
lastInfo = SimpleLocationCorrectStrategy.getInstance().correct( lastInfo );
|
||||
locationResult = new LocationResult();
|
||||
locationResult.dataAccuracy = dataAccuracy;
|
||||
if ( lastInfo != null ) {
|
||||
locationResult.lastCoordinate = lastInfo;
|
||||
locationResult.mortonCode = MortonCode.wrapEncodeMorton( lastInfo.getLon(), lastInfo.getLat() );
|
||||
|
||||
@@ -29,7 +29,12 @@ class LocationResult {
|
||||
public CloudLocationInfo lastCoordinate;
|
||||
|
||||
/**
|
||||
* 1s 内的连续定位点
|
||||
* 连续定位点
|
||||
*/
|
||||
public List< CloudLocationInfo > coordinates;
|
||||
|
||||
/**
|
||||
* 数据来源精度 0 - 普通定位、1 - 高精定位
|
||||
*/
|
||||
public int dataAccuracy = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user