diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/udp/thailand/service/ThailandSectionServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/udp/thailand/service/ThailandSectionServiceImpl.java index d0d9f9145..e10db5a5c 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/udp/thailand/service/ThailandSectionServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/real/udp/thailand/service/ThailandSectionServiceImpl.java @@ -3,7 +3,6 @@ package club.joylink.rtss.simulation.cbtc.device.real.udp.thailand.service; import club.joylink.rtss.constants.ProjectCode; import club.joylink.rtss.constants.ProjectDeviceType; import club.joylink.rtss.simulation.cbtc.Simulation; -import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.device.RealDeviceConfig; @@ -14,7 +13,6 @@ import club.joylink.rtss.simulation.cbtc.device.real.udp.thailand.config.Thailan import io.netty.buffer.ByteBuf; import java.time.LocalDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; @@ -35,26 +33,26 @@ public class ThailandSectionServiceImpl implements UDPRealDeviceService { @Override public void run(Simulation simulation, UDPLowConfig udpLowConfig, RealDeviceConfig realDevice) { - // TODO: 2023/7/5 模拟计轴占压数据 - List trainList = simulation.getRepository().getOnlineTrainList(); - LocalDateTime now = LocalDateTime.now(); - for (VirtualRealityTrain train : trainList) { - LocalDateTime time = map.computeIfAbsent(train, K -> now.plusSeconds(7)); - Section section = train.getHeadPosition().getSection(); - VirtualRealitySectionAxleCounter currentAxle = section.findAxle(); - if (!train.isStop() && !now.isBefore(time)) { - Section nextSection = section.getNextRunningSectionOf(train.isRight()); - if (nextSection == null) { - continue; - } - VirtualRealitySectionAxleCounter nextAxle = nextSection.findAxle(); - if (nextAxle != currentAxle) { - nextAxle.occupied(train.isRight()); - currentAxle.setOccupy(false); - } - map.put(train, time.plusSeconds(7)); - } - } + //本地测试模拟计轴占用 +// List trainList = simulation.getRepository().getOnlineTrainList(); +// LocalDateTime now = LocalDateTime.now(); +// for (VirtualRealityTrain train : trainList) { +// LocalDateTime time = map.computeIfAbsent(train, K -> now.plusSeconds(7)); +// Section section = train.getHeadPosition().getSection(); +// VirtualRealitySectionAxleCounter currentAxle = section.findAxle(); +// if (!train.isStop() && !now.isBefore(time)) { +// Section nextSection = section.getNextRunningSectionOf(train.isRight()); +// if (nextSection == null) { +// continue; +// } +// VirtualRealitySectionAxleCounter nextAxle = nextSection.findAxle(); +// if (nextAxle != currentAxle) { +// nextAxle.occupied(train.isRight()); +// currentAxle.setOccupy(false); +// } +// map.put(train, time.plusSeconds(7)); +// } +// } } @Override