[minibus320][adas] 添加MAP版本常量,鹰眼下发红绿灯数据到工控机接口加入版本判断<MAP290发送,>MAP290将停止发送
This commit is contained in:
@@ -4,6 +4,7 @@ import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -26,6 +27,8 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
|
||||
val version = AdasManager.getInstance().mapVersion
|
||||
if (version > -1 && version < 290)
|
||||
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,10 @@ android {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
*/
|
||||
private static final int PROTOCOL_VERSION = MessagePad.ProtocolVersion.CurrentVersion.getNumber();
|
||||
private volatile MessagePad.CarConfigResp carConfig;
|
||||
private int mapVersion = -1;//当前连接的MAP版本,断开连接会置为-1
|
||||
private static final String ADAS_VERSION = BuildConfig.VERSION_NAME;
|
||||
private final Pattern pattern = Pattern.compile("\\d+\\.\\d+\\.\\d+");
|
||||
|
||||
@@ -64,6 +65,20 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
|
||||
public synchronized void setCarConfig(MessagePad.CarConfigResp carConfig) {
|
||||
this.carConfig = carConfig;
|
||||
if (carConfig != null) {
|
||||
mapVersion = parseVersion(carConfig.getDockVersion());
|
||||
} else {
|
||||
mapVersion = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前连接的MAP版本,断开连接会置为-1
|
||||
*
|
||||
* @return 版本
|
||||
*/
|
||||
public int getMapVersion() {
|
||||
return mapVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user