[minibus320][adas] 添加MAP版本常量,鹰眼下发红绿灯数据到工控机接口加入版本判断<MAP290发送,>MAP290将停止发送

This commit is contained in:
xinfengkun
2023-05-19 14:57:39 +08:00
parent 8d146f4263
commit 4e59a0b07c
3 changed files with 23 additions and 1 deletions

View File

@@ -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)
}
}

View File

@@ -66,6 +66,10 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

View File

@@ -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;
}
/**