extends realTimeProvider
This commit is contained in:
@@ -46,4 +46,9 @@ class SPIRealTimeTestClass implements IRealTimeProvider {
|
||||
list.add(info);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLocationAccuracy() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,13 @@ public interface IRealTimeProvider {
|
||||
List<ADASRecognizedResult> getLastADASRecognizedResult();
|
||||
|
||||
/**
|
||||
* 发送消息,由外部传入
|
||||
* 发送自车定位信息,由外部传入
|
||||
*/
|
||||
List<CloudLocationInfo> getLocationMsg();
|
||||
|
||||
/**
|
||||
* 自车定位信息 精度
|
||||
* @see com.mogo.realtime.entity.LocationResult dataAccuracy 字段
|
||||
*/
|
||||
int getLocationAccuracy();
|
||||
}
|
||||
|
||||
@@ -154,15 +154,8 @@ public class SocketHandler {
|
||||
}
|
||||
locationResult.coordinates = new ArrayList<>();
|
||||
locationResult.sn = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn();
|
||||
boolean isAccuracyDevice = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getIsAccuracyDevice();
|
||||
locationResult.coordinates.addAll(cloudLocationInfo);
|
||||
if (isAccuracyDevice) {
|
||||
if (cloudLocationInfo.size() > 2) {
|
||||
locationResult.dataAccuracy = 1;
|
||||
} else {
|
||||
Logger.w(TAG, "MoGoAiCloudClient setAccuracyDevice is true , but the amount of data does not meet the requirements");
|
||||
}
|
||||
}
|
||||
locationResult.dataAccuracy = RealTimeProviderImp.getInstance().getLocationAccuracy();//SPI接口返回
|
||||
}
|
||||
List<ADASRecognizedResult> recognizedResults = RealTimeProviderImp.getInstance().getLastADASRecognizedResult();//SPI接口返回
|
||||
OnePerSecondSendContent content = new OnePerSecondSendContent();
|
||||
@@ -182,8 +175,9 @@ public class SocketHandler {
|
||||
webSocketData.setData(GsonUtil.jsonFromObject(content));
|
||||
String msg = GsonUtil.jsonFromObject(webSocketData);
|
||||
|
||||
boolean isAccuracyDevice = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getIsAccuracyDevice();
|
||||
int msgType = LOW_FREQUENCY_CHANNEL_ID;
|
||||
if (cloudLocationInfo.size() > 2) {
|
||||
if (isAccuracyDevice && cloudLocationInfo.size() > 2) {
|
||||
msgType = HIGH_FREQUENCY_CHANNEL_ID;
|
||||
}
|
||||
MsgBody msgBody = new MsgBody();
|
||||
|
||||
@@ -45,4 +45,12 @@ public class RealTimeProviderImp implements IRealTimeProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLocationAccuracy() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationAccuracy();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user