[3.2.0] add func of track loc opt has under the 310 verision
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
package com.mogo.eagle.core.function.business.identify;
|
package com.mogo.eagle.core.function.business.identify;
|
||||||
|
|
||||||
|
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA;
|
||||||
|
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_ADAS;
|
||||||
|
import static com.mogo.eagle.core.data.deva.chain.ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED;
|
||||||
import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED;
|
import static com.mogo.eagle.core.function.business.identify.TrackManager.LIMIT_SPEED;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
|
||||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
import com.mogo.eagle.core.data.enums.TrafficTypeEnum;
|
||||||
|
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||||
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
import com.mogo.eagle.core.utilcode.geometry.S2CellId;
|
||||||
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
import com.mogo.eagle.core.utilcode.geometry.S2LatLng;
|
||||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
|
||||||
|
import com.mogo.eagle.core.utilcode.util.ParseVersionUtils;
|
||||||
|
import com.zhjt.service.chain.ChainLog;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@@ -45,9 +51,30 @@ public class TrackObj {
|
|||||||
|
|
||||||
private void correct() {
|
private void correct() {
|
||||||
calAverageSpeedAndType();
|
calAverageSpeedAndType();
|
||||||
|
String dockerVersion = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getDockVersion();
|
||||||
|
if (dockerVersion != null && !dockerVersion.isEmpty()) {
|
||||||
|
try {
|
||||||
|
int version = ParseVersionUtils.parseVersion(true, dockerVersion);
|
||||||
|
if (version >= 310) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logErrorOfVersion(dockerVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
calLoc();
|
calLoc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ChainLog(linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_DATA_TRACKED,
|
||||||
|
linkCode = CHAIN_LINK_ADAS,
|
||||||
|
endpoint = 4,
|
||||||
|
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_RECT_DATA,
|
||||||
|
paramIndexes = {0},
|
||||||
|
clientPkFileName = "sn")
|
||||||
|
private void logErrorOfVersion(String version) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
private void calAverageSpeedAndType() {
|
private void calAverageSpeedAndType() {
|
||||||
if (circleQueue.size() >= 3) {
|
if (circleQueue.size() >= 3) {
|
||||||
@@ -68,7 +95,7 @@ public class TrackObj {
|
|||||||
}
|
}
|
||||||
speedAverage = cal / objQueueList.size();
|
speedAverage = cal / objQueueList.size();
|
||||||
}
|
}
|
||||||
if(typeArray.length > 0){
|
if (typeArray.length > 0) {
|
||||||
typeArray = Arrays.stream(typeArray).sorted().toArray();
|
typeArray = Arrays.stream(typeArray).sorted().toArray();
|
||||||
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
|
typeWeight = typeArray[typeArray.length / 2] == 0 ? cacheData.getType() : typeArray[typeArray.length / 2];
|
||||||
}
|
}
|
||||||
@@ -166,7 +193,7 @@ public class TrackObj {
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear(){
|
public void clear() {
|
||||||
circleQueue.clear();
|
circleQueue.clear();
|
||||||
s2CellId = null;
|
s2CellId = null;
|
||||||
s2LatLng = null;
|
s2LatLng = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user