[change]点云接口 开启新线程转发
This commit is contained in:
@@ -68,6 +68,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
private RawUnpack rawUnpack;//业务数据拆包
|
||||
private RawPack rawPack;//数据打包
|
||||
private DispatchHandler dispatchHandler;//分发
|
||||
private DispatchHandler dispatchHandlerPointCloud;//点云分发
|
||||
private Timer checkCompatibilityTimer;//检查版本兼容性定时器 连接成功后5秒内等待工控机发送配置信息
|
||||
/**
|
||||
* 与工控机链接状态
|
||||
@@ -161,6 +162,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
//司机端以及启用线程分发时
|
||||
if (!adasOptions.isClient() && ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER) {
|
||||
dispatchHandler = new DispatchHandler(this);
|
||||
dispatchHandlerPointCloud = new DispatchHandler(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,8 +271,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
// CupidLogUtils.w("--->websocket byte read header = " + messageType.toString());
|
||||
//判断是否是司机屏幕,是否切换分发线程
|
||||
if (!adasOptions.isClient() && ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER) {
|
||||
if (dispatchHandler != null)
|
||||
dispatchHandler.sendRawMessage(raw);
|
||||
if (header.getMsgType() == MessageType.TYPE_RECEIVE_POINT_CLOUD.typeCode) {
|
||||
if (dispatchHandlerPointCloud != null)
|
||||
dispatchHandlerPointCloud.sendRawMessage(raw);
|
||||
} else {
|
||||
if (dispatchHandler != null)
|
||||
dispatchHandler.sendRawMessage(raw);
|
||||
}
|
||||
} else {
|
||||
dispatchRaw(raw);
|
||||
}
|
||||
@@ -471,8 +478,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
adasConnectStatusListener.onConnectionIPCStatus(ipcConnectionStatus.get(), reason);
|
||||
}
|
||||
if (status == Constants.IPC_CONNECTION_STATUS.CONNECTED) {
|
||||
if (ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER && dispatchHandler != null) {
|
||||
dispatchHandler.start();
|
||||
if (ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER) {
|
||||
if (dispatchHandler != null) {
|
||||
dispatchHandler.start();
|
||||
}
|
||||
if (dispatchHandlerPointCloud != null) {
|
||||
dispatchHandlerPointCloud.start();
|
||||
}
|
||||
}
|
||||
startCheckCompatibility();
|
||||
} else {
|
||||
@@ -480,8 +492,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
}
|
||||
if (status == Constants.IPC_CONNECTION_STATUS.DISCONNECTED) {
|
||||
AdasManager.getInstance().setCarConfig(null);
|
||||
if (ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER && dispatchHandler != null) {
|
||||
dispatchHandler.stop();
|
||||
if (ADAS_CHANNEL_IS_USE_DISPATCH_HANDLER) {
|
||||
if (dispatchHandler != null) {
|
||||
dispatchHandler.stop();
|
||||
}
|
||||
if (dispatchHandlerPointCloud != null) {
|
||||
dispatchHandlerPointCloud.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
CupidLogUtils.i(TAG, "工控机连接状态 status=" + status + " reason=" + reason);
|
||||
|
||||
Reference in New Issue
Block a user