实训修改

This commit is contained in:
DU 2021-01-28 18:16:11 +08:00
parent 32972e5697
commit a6cae4e14c
3 changed files with 4 additions and 152 deletions

View File

@ -138,7 +138,7 @@ public interface GeneratorNew {
} }
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal,null, simulation.getBuildParams().getMap())); stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, Objects.isNull(operSignal) ? mapDevice : operSignal,null, simulation.getBuildParams().getMap()));
} else { } else {
stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, null,simulation.getBuildParams().getMap())); stepVO.setTip(replacePlaceholder(stepVO.getTip(), placeholderVOMap, mapDevice, mapButton,simulation.getBuildParams().getMap()));
} }
} }
if (containPlaceholder(stepVO.getVal())) { if (containPlaceholder(stepVO.getVal())) {

View File

@ -6,7 +6,6 @@ import club.joylink.rtss.services.training.generatornew.annotation.GeneratorSele
import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Section;
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
import club.joylink.rtss.vo.client.OperateDefinitionVO; import club.joylink.rtss.vo.client.OperateDefinitionVO;
import club.joylink.rtss.vo.client.training.TrainingNewVO; import club.joylink.rtss.vo.client.training.TrainingNewVO;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -97,151 +96,4 @@ public class SectionGeneratorNew implements GeneratorNew {
} }
return trainingVOList; return trainingVOList;
} }
protected TrainingNewVO sectionUnlock(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
//设置故障
section.setFaultLock(true);
section.setOverlapLock(true);
section.setRouteLock(true);
// settingDirectly(simulation, route);
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
//恢复背景
section.setFaultLock(false);
section.setOverlapLock(false);
section.setRouteLock(false);
return build;
}
protected TrainingNewVO sectionCutOff(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 无背景
return build(config, simulation, section, null,operateDefinitionVO);
}
protected TrainingNewVO sectionActive(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 区段切除
if (section.isPhysical()) {
section.setCutOff(true);
if (section.isShowLogic()) { //有逻辑区段
section.getLogicList().forEach(lc -> lc.setCutOff(true));
}
} else {
Section parentSection = section.getParent();
parentSection.setCutOff(true);
parentSection.getLogicList().forEach(ls -> ls.setCutOff(true));
}
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
// 区段切除
if(section.isPhysical()){
section.setCutOff(true);
if(section.isShowLogic()){ //有逻辑区段
section.getLogicList().forEach(lc->lc.setCutOff(true));
}
}else{
Section parentSection = section.getParent();
parentSection.setCutOff(true);
parentSection.getLogicList().forEach(ls->ls.setCutOff(true));
}
return build;
}
protected TrainingNewVO sectionAxisPreReset(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 设置故障
// TODO
return build(config, simulation, section,null, operateDefinitionVO);
}
protected TrainingNewVO sectionBlock(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 无背景
return build(config, simulation, section,null, operateDefinitionVO);
}
protected TrainingNewVO sectionUnblock(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 区段封锁
section.setRouteLock(false);
section.setOverlapLock(false);
if (Objects.nonNull(section.getParent())) { // 取计轴区段
Section sectionParent = section.getParent();
sectionParent.setBlockade(true);
if (!CollectionUtils.isEmpty(sectionParent.getLogicList())) {
sectionParent.getLogicList().forEach(logic -> logic.setBlockade(true));
}
}
// sectionService.blockade(section);
TrainingNewVO build = build(config, simulation, section,null, operateDefinitionVO);
section.setBlockade(false);
if (Objects.nonNull(section.getParent())) { // 取计轴区段
Section sectionParent = section.getParent();
sectionParent.setBlockade(true);
if (!CollectionUtils.isEmpty(sectionParent.getLogicList())) {
sectionParent.getLogicList().forEach(logic -> logic.setBlockade(true));
}
}
return build;
}
protected TrainingNewVO sectionSetSpeedLimit(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 设置背景
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.setSpeedUpperLimit(-1);
} else if (section.isLogicSection()) {
section.getParent().setSpeedUpLimit(-1);
} else {
section.setSpeedUpLimit(-1);
}
TrainingNewVO build = build(config, simulation, section, null,operateDefinitionVO);
// 区段设置限速
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.setSpeedUpperLimit(LIMITED_SPEED);
} else if (section.isLogicSection()) {
section.getParent().setSpeedUpLimit(LIMITED_SPEED);
} else {
section.setSpeedUpLimit(LIMITED_SPEED);
}
return build;
}
protected TrainingNewVO sectionCancelSpeedLimit(Section section, GenerateConfig config, Simulation simulation,
OperateDefinitionVO operateDefinitionVO) {
// 区段设置限速
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.setSpeedUpperLimit(LIMITED_SPEED);
} else if (section.isLogicSection()) {
section.getParent().setSpeedUpLimit(LIMITED_SPEED);
} else {
section.setSpeedUpLimit(LIMITED_SPEED);
}
TrainingNewVO build = build(config, simulation, section, null,operateDefinitionVO);
if (section.isSwitchTrack()) {
Switch relSwitch = section.getRelSwitch();
relSwitch.setSpeedUpperLimit(-1);
} else if (section.isLogicSection()) {
section.getParent().setSpeedUpLimit(-1);
} else {
section.setSpeedUpLimit(-1);
}
return build;
}
protected TrainingNewVO sectionDetail(Section section, GenerateConfig config, Simulation simulation, OperateDefinitionVO operateDefinitionVO) {
//区段详情
return build(config, simulation, section, null,operateDefinitionVO);
}
} }

View File

@ -81,7 +81,7 @@ public class OperateStepVO {
private String tip; private String tip;
/** /**
* 步骤提示信息 * 步骤指定设备
*/ */
@ApiModelProperty(value = "所需code类型") @ApiModelProperty(value = "所需code类型")
private String codeType; private String codeType;