泰国沙盘增加进路解锁逻辑

This commit is contained in:
joylink_zhangsai 2023-06-12 15:54:42 +08:00
parent 9001cb5df9
commit 3c6cb3a994
2 changed files with 12 additions and 7 deletions

View File

@ -2,7 +2,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.ATP.ground.MaService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.device.RealDeviceConfig;
@ -15,18 +14,12 @@ import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class ThailandSectionServiceImpl implements UDPRealDeviceService {
@Autowired
private MaService maService;
@Autowired
private ThailandTrainServiceImpl thailandTrainService;
@Override
public boolean isMatch(RealDeviceConfig realDevice) {
return realDevice instanceof UDPClientConfig && ProjectCode.THAILAND_SANDBOX

View File

@ -3,11 +3,13 @@ package club.joylink.rtss.simulation.cbtc.device.real.udp.thailand.service;
import club.joylink.rtss.constants.ProjectDeviceType;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsTrainLoadService;
import club.joylink.rtss.simulation.cbtc.CI.CiLogic;
import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
import club.joylink.rtss.simulation.cbtc.data.map.Route;
import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
@ -46,6 +48,8 @@ public class ThailandTrainServiceImpl implements UDPRealDeviceService {
private AtsTrainLoadService atsTrainLoadService;
@Autowired
private SimulationRobotService simulationRobotService;
@Autowired
private CiLogic ciLogic;
@Override
public boolean isMatch(UDPLowConfig udpLowConfig) {
@ -111,6 +115,14 @@ public class ThailandTrainServiceImpl implements UDPRealDeviceService {
nextSection = null;
}
}
//如果列车车头在进路首个区段进路开始解锁
//加此逻辑是因为有些进路首区段太短偶尔会出现前两个区段同时占压导致无法正常解锁
Route route = headSection.getRoute();
if (headSection.isLocked() && route != null) {
if (route.getFirstPhysicalSection().equals(headSection)) {
ciLogic.trainUnlockStart(simulation, route);
}
}
//根据区段的配置信息设置车头位置更新至停车点的时间
// fill(headSection, sectionConfig.getConfigVO());
LocalDateTime now = LocalDateTime.now();