Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
927b5bb83c
@ -12,6 +12,7 @@ import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapElement;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.util.JsonUtils;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.map.MapVO;
|
||||
@ -144,6 +145,18 @@ public class RunPlanRoutingService implements IRunPlanRoutingService {
|
||||
if (!planRunlevelService.isExisted(l)) {
|
||||
Section startSection = (Section) deviceMap.get(l.getStartSectionCode());
|
||||
Section endSection = (Section) deviceMap.get(l.getEndSectionCode());
|
||||
if((startSection.isStandTrack() && endSection.isTransferTrack()) || (endSection.isStandTrack() && startSection.isTransferTrack())){
|
||||
Float distance;
|
||||
try{
|
||||
distance = CalculateService.calculateDistance(startSection, endSection, l.getRight());
|
||||
}catch (SimulationException e){
|
||||
distance = CalculateService.calculateDistance(startSection, endSection, !l.getRight());
|
||||
}
|
||||
l.setDistance(distance);
|
||||
l.generateDefaultRunLevel();
|
||||
planRunlevelService.createUserRunlevel(l);
|
||||
return;
|
||||
}
|
||||
Float distance = CalculateService.calculateDistance(startSection, endSection, l.getRight());
|
||||
l.setDistance(distance);
|
||||
l.generateDefaultRunLevel();
|
||||
|
@ -18,6 +18,7 @@ import org.springframework.util.StringUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -155,13 +156,30 @@ public interface GeneratorNew {
|
||||
// 添加步骤
|
||||
List<TrainingStepVO> steps = new ArrayList<>(stepList.size());
|
||||
stepList.forEach(operateStepVO -> {
|
||||
|
||||
|
||||
TrainingStepVO stepVO = new TrainingStepVO(operateStepVO);
|
||||
// if(StringUtils.hasText(stepVO.getCode()) && MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) {
|
||||
// stepVO.setCode(((Route)mapDevice).getStart().getCode());
|
||||
// }
|
||||
if (containPlaceholder(stepVO.getTip())) {
|
||||
if (StringUtils.hasText(operateStepVO.getCodeType())) {
|
||||
TrainingConsts.CodeType codeType = TrainingConsts.CodeType.valueOf(operateStepVO.getCodeType());
|
||||
MapElement operSignal = null;
|
||||
if (Objects.nonNull(codeType) && MapElement.DeviceType.ROUTE.equals(mapDevice.getDeviceType())) {
|
||||
if (codeType == TrainingConsts.CodeType.START_SIGNAL) {
|
||||
operSignal = ((Route) mapDevice).getStart();
|
||||
} else if (codeType == TrainingConsts.CodeType.END_SIGNAL) {
|
||||
operSignal = ((Route) mapDevice).getDestination();
|
||||
} else if (codeType == TrainingConsts.CodeType.SIGNAL) {
|
||||
operSignal = ((Route) mapDevice).getStart();
|
||||
}
|
||||
}
|
||||
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal, simulation.getBuildParams().getMap()));
|
||||
} else {
|
||||
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, simulation.getBuildParams().getMap()));
|
||||
}
|
||||
}
|
||||
if (containPlaceholder(stepVO.getVal())) {
|
||||
stepVO.setVal(replacePlaceholder(stepVO.getVal(), placeholderVOMap,mapDevice, simulation.getBuildParams().getMap()));
|
||||
}
|
||||
|
@ -76,8 +76,12 @@ public class SectionGeneratorNew implements GeneratorNew {
|
||||
case Section_Fault_Unlock:
|
||||
// 设置区段故障锁闭(这只是区故解的一种情况,后面再补其他情况)
|
||||
section.setFaultLock(true);
|
||||
section.setRouteLock(true);
|
||||
if (section.isShowLogic()) {
|
||||
section.getLogicList().forEach(s -> s.setFaultLock(true));
|
||||
section.getLogicList().forEach(s -> {
|
||||
s.setFaultLock(true);
|
||||
s.setRouteLock(true);
|
||||
});
|
||||
}
|
||||
break;
|
||||
case Section_Axis_Pre_Reset:
|
||||
|
Loading…
Reference in New Issue
Block a user