Compare commits

...

4 Commits

Author SHA1 Message Date
afdcaddf68 Revert "特定基站插入1005"
This reverts commit dd24d14d0c2f88001705a1ca75973690c3ab325e.
2025-11-17 17:53:24 +08:00
480dcf443e Revert "特定基站插入1005"
This reverts commit 16059ee5d4568be21757a1401f755ebffda70ca1.
2025-11-17 17:53:22 +08:00
404890f16f Revert "修复问题"
This reverts commit 934e82a1d33be6569e5de9c0f7658a245ce48141.
2025-11-17 17:53:20 +08:00
21da58fd8a Revert "基站数据流插入1005"
This reverts commit 68e9f63929fce404d80618f53047f1cf1a8a9d7d.
2025-11-17 17:53:11 +08:00

View File

@ -50,9 +50,6 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
@Autowired
private GNSSDataCalcService gnssCalcService;
// 指定仅对该基站启用1005插入功能请将值替换为目标基站ID
private static final String TARGET_BASE_STATION_ID_FOR_1005 = "6541918";
// 添加一个成员变量用于追踪每个测站最后一次转发D300数据的时间
private final Map<String, Long> lastD300ForwardTimeMap = new ConcurrentHashMap<>();
private static final long D300_FORWARD_INTERVAL = 5000; // 5秒单位毫秒
@ -183,34 +180,15 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
if (logger.isDebugEnabled()) {
logger.debug("forward d331 rtcm from {} to device {}", deviceBs.getDeviceId(), deviceId);
}
// 为每个设备生成独立的数据副本确保按需修改如2307不影响其他设备
byte[] perDeviceBytes = forwardBytes;
if(deviceId.startsWith("2307")){
// 处理2307型号的测站兼容不带序号的测站修改应发生在写入 ByteBuf 之前
perDeviceBytes = forwardBytes.clone();
perDeviceBytes[2] = (byte) (perDeviceBytes[2] & 0x07);
}
ByteBuf buf = Unpooled.buffer();
buf.writeBytes(perDeviceBytes);
buf.writeBytes(forwardBytes);
// 推送策略
// 1) 保持原 F9P505 博通510兼容逻辑不变
// 2) 仅对指定基站 ID 追加 1005不影响其它基站
boolean needInsert1005 = false;
//推送策略F9P基站505兼容博通510推送
if ((deviceBs.getModel()==null || deviceBs.getModel() == GnssDevice.MODEL_G505) &&
(device.getModel()!=null && device.getModel()==GnssDevice.MODEL_G510)){
needInsert1005 = true; // 原兼容逻辑
}
if (TARGET_BASE_STATION_ID_FOR_1005.equals(deviceBs.getDeviceId())) {
needInsert1005 = true; // 仅特定基站额外插入
}
if (needInsert1005) {
buf = insert1005(deviceBs, deviceId, buf);
}
// 实际发送到设备通道
deviceChannel.writeAndFlush(buf);
}
}
@ -226,9 +204,7 @@ public class D331RtcmMessageExecutor implements Executor<D331RtcmMessage, Void>
//logger.info("Adding D300 string for device: {}", deviceId);
// 获取当前buf中的数据
int readableLen = buf.readableBytes();
byte[] originalData = new byte[readableLen];
buf.getBytes(0, originalData);
byte[] originalData = buf.array();
String originalHex = ByteUtil.bytesToHexString(originalData);
// 找到D300和D301的位置