1、测试:2410207的基站用TCP推数据
This commit is contained in:
parent
99438b4da4
commit
7713a335bc
@ -3,7 +3,6 @@ package com.imdroid.sideslope.executor;
|
|||||||
import com.imdroid.secapi.client.BeidouClient;
|
import com.imdroid.secapi.client.BeidouClient;
|
||||||
import com.imdroid.secapi.dto.GnssDevice;
|
import com.imdroid.secapi.dto.GnssDevice;
|
||||||
import com.imdroid.sideslope.bd.Gga;
|
import com.imdroid.sideslope.bd.Gga;
|
||||||
import com.imdroid.sideslope.calc.GNSSDataCalcService;
|
|
||||||
import com.imdroid.sideslope.message.D331RtcmMessage;
|
import com.imdroid.sideslope.message.D331RtcmMessage;
|
||||||
import com.imdroid.sideslope.sal.Device;
|
import com.imdroid.sideslope.sal.Device;
|
||||||
import com.imdroid.sideslope.sal.DeviceService;
|
import com.imdroid.sideslope.sal.DeviceService;
|
||||||
@ -45,12 +44,16 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
|||||||
|
|
||||||
if(device1.getOpMode() == GnssDevice.OP_MODE_USE) {
|
if(device1.getOpMode() == GnssDevice.OP_MODE_USE) {
|
||||||
byte[] forwardBytes = message.getSrcData();
|
byte[] forwardBytes = message.getSrcData();
|
||||||
|
boolean useUDPChannel = true;
|
||||||
|
if(device1.getDeviceId().equals("2410207")) useUDPChannel = false;
|
||||||
// 要求快速转发,因此用缓存,不要每次都查数据库
|
// 要求快速转发,因此用缓存,不要每次都查数据库
|
||||||
List<Device> deviceList = deviceService.findByParentId(id);
|
List<Device> deviceList = deviceService.findByParentId(id);
|
||||||
for (Device device : deviceList) {
|
for (Device device : deviceList) {
|
||||||
if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue;
|
if (device.getOpMode() != GnssDevice.OP_MODE_USE) continue;
|
||||||
String deviceId = device.getDeviceId();
|
String deviceId = device.getDeviceId();
|
||||||
OnlineChannels.INSTANCE.get(deviceId).ifPresent(deviceChannel -> {
|
DeviceChannel deviceChannel =
|
||||||
|
useUDPChannel?OnlineChannels.INSTANCE.getDataChannel(deviceId):OnlineChannels.INSTANCE.getConfigChannel(deviceId);
|
||||||
|
if(deviceChannel!=null) {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("forward d331 rtcm message to device {}", deviceId);
|
logger.debug("forward d331 rtcm message to device {}", deviceId);
|
||||||
}
|
}
|
||||||
@ -60,7 +63,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
|
|||||||
ByteBuf buf = Unpooled.buffer();
|
ByteBuf buf = Unpooled.buffer();
|
||||||
buf.writeBytes(forwardBytes);
|
buf.writeBytes(forwardBytes);
|
||||||
deviceChannel.writeAndFlush(buf);
|
deviceChannel.writeAndFlush(buf);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user