[Change]
完成mogo-module-adas合并到MoGoEagleEye.core.function-impl.mogo-core-function-autopilot Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package com.mogo.module.common.datacenter;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.location.CloudLocationInfo;
|
||||
@@ -38,36 +38,13 @@ public class SnapshotLocationDataCenter {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private CloudLocationInfo mLastLocationInfo = null;
|
||||
|
||||
// GPS(1s1次) RTK(OS侧)缓存数据,
|
||||
private final List<CloudLocationInfo> mLocationList = new ArrayList<>();
|
||||
|
||||
// adda 工控机数据缓存
|
||||
private final List<CloudLocationInfo> mMachineCacheList = new ArrayList<>();
|
||||
|
||||
private int mDataAccuracy = 0;
|
||||
private double mCurSpeed;
|
||||
private double mCurLon;
|
||||
private double mCurLat;
|
||||
private long mSatelliteTime = 0;
|
||||
|
||||
/**
|
||||
* 同步从定位来的数据(也可能是rtk)
|
||||
*
|
||||
* @param cli {@link CloudLocationInfo}
|
||||
*/
|
||||
public void syncLocationInfo(CloudLocationInfo cli) {
|
||||
if (cli == null) {
|
||||
return;
|
||||
}
|
||||
mLastLocationInfo = cli;
|
||||
mCurSpeed = cli.getSpeed();
|
||||
mCurLon = cli.getLon();
|
||||
mCurLat = cli.getLat();
|
||||
mLocationList.add(cli);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步从工控机来的数据
|
||||
*
|
||||
@@ -113,62 +90,14 @@ public class SnapshotLocationDataCenter {
|
||||
cloudLocationInfo.setSatelliteTime(satelliteTime);
|
||||
cloudLocationInfo.setSystemTime(systemTime);
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getTileId(lon, lat)));
|
||||
mLastLocationInfo = cloudLocationInfo;
|
||||
mMachineCacheList.add(cloudLocationInfo);
|
||||
|
||||
mCurSpeed = cloudLocationInfo.getSpeed();
|
||||
mCurLon = cloudLocationInfo.getLon();
|
||||
mCurLat = cloudLocationInfo.getLat();
|
||||
mSatelliteTime = cloudLocationInfo.getSatelliteTime();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某一段时间内的坐标集合
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据精度类型,目前按照数据来源标志
|
||||
*
|
||||
* @return 精度
|
||||
*/
|
||||
public int getDataAccuracy() {
|
||||
return mDataAccuracy;
|
||||
}
|
||||
|
||||
public double getCurSpeed() {
|
||||
return mCurSpeed;
|
||||
}
|
||||
|
||||
public double getCurLon() {
|
||||
return mCurLon;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user